diff --git a/emissary-ml/llm-scripts/fine-tuning/llama3/venv/share/jupyter/lab/static/6831.1df8fa4cabb5b1c19803.js b/emissary-ml/llm-scripts/fine-tuning/llama3/venv/share/jupyter/lab/static/6831.1df8fa4cabb5b1c19803.js new file mode 100644 index 0000000000000000000000000000000000000000..2d0dd31d2ce27968b8198fa4bb483aba20cebbcf --- /dev/null +++ b/emissary-ml/llm-scripts/fine-tuning/llama3/venv/share/jupyter/lab/static/6831.1df8fa4cabb5b1c19803.js @@ -0,0 +1 @@ +"use strict";(self["webpackChunk_jupyterlab_application_top"]=self["webpackChunk_jupyterlab_application_top"]||[]).push([[6831],{86831:(e,t,r)=>{r.r(t);r.d(t,{fcl:()=>d});var n={term:true,method:true,accu:true,rule:true,then:true,is:true,and:true,or:true,if:true,default:true};var u={var_input:true,var_output:true,fuzzify:true,defuzzify:true,function_block:true,ruleblock:true};var i={end_ruleblock:true,end_defuzzify:true,end_function_block:true,end_fuzzify:true,end_var:true};var a={true:true,false:true,nan:true,real:true,min:true,max:true,cog:true,cogs:true};var o=/[+\-*&^%:=<>!|\/]/;function l(e,t){var r=e.next();if(/[\d\.]/.test(r)){if(r=="."){e.match(/^[0-9]+([eE][\-+]?[0-9]+)?/)}else if(r=="0"){e.match(/^[xX][0-9a-fA-F]+/)||e.match(/^0[0-7]+/)}else{e.match(/^[0-9]*\.?[0-9]*([eE][\-+]?[0-9]+)?/)}return"number"}if(r=="/"||r=="("){if(e.eat("*")){t.tokenize=f;return f(e,t)}if(e.eat("/")){e.skipToEnd();return"comment"}}if(o.test(r)){e.eatWhile(o);return"operator"}e.eatWhile(/[\w\$_\xa1-\uffff]/);var l=e.current().toLowerCase();if(n.propertyIsEnumerable(l)||u.propertyIsEnumerable(l)||i.propertyIsEnumerable(l)){return"keyword"}if(a.propertyIsEnumerable(l))return"atom";return"variable"}function f(e,t){var r=false,n;while(n=e.next()){if((n=="/"||n==")")&&r){t.tokenize=l;break}r=n=="*"}return"comment"}function c(e,t,r,n,u){this.indented=e;this.column=t;this.type=r;this.align=n;this.prev=u}function s(e,t,r){return e.context=new c(e.indented,t,r,null,e.context)}function p(e){if(!e.context.prev)return;var t=e.context.type;if(t=="end_block")e.indented=e.context.indented;return e.context=e.context.prev}const d={name:"fcl",startState:function(e){return{tokenize:null,context:new c(-e,0,"top",false),indented:0,startOfLine:true}},token:function(e,t){var r=t.context;if(e.sol()){if(r.align==null)r.align=false;t.indented=e.indentation();t.startOfLine=true}if(e.eatSpace())return null;var n=(t.tokenize||l)(e,t);if(n=="comment")return n;if(r.align==null)r.align=true;var a=e.current().toLowerCase();if(u.propertyIsEnumerable(a))s(t,e.column(),"end_block");else if(i.propertyIsEnumerable(a))p(t);t.startOfLine=false;return n},indent:function(e,t,r){if(e.tokenize!=l&&e.tokenize!=null)return 0;var n=e.context;var u=i.propertyIsEnumerable(t);if(n.align)return n.column+(u?0:1);else return n.indented+(u?0:r.unit)},languageData:{commentTokens:{line:"//",block:{open:"(*",close:"*)"}}}}}}]); \ No newline at end of file diff --git a/emissary-ml/llm-scripts/fine-tuning/llama3/venv/share/jupyter/lab/static/7587.3112240b6b82407b0f16.js b/emissary-ml/llm-scripts/fine-tuning/llama3/venv/share/jupyter/lab/static/7587.3112240b6b82407b0f16.js new file mode 100644 index 0000000000000000000000000000000000000000..49def792277cebebd480b44268961297018f2d7d --- /dev/null +++ b/emissary-ml/llm-scripts/fine-tuning/llama3/venv/share/jupyter/lab/static/7587.3112240b6b82407b0f16.js @@ -0,0 +1 @@ +"use strict";(self["webpackChunk_jupyterlab_application_top"]=self["webpackChunk_jupyterlab_application_top"]||[]).push([[7587],{17587:(e,t,a)=>{a.r(t);a.d(t,{ebnf:()=>c});var s={slash:0,parenthesis:1};var r={comment:0,_string:1,characterClass:2};const c={name:"ebnf",startState:function(){return{stringType:null,commentType:null,braced:0,lhs:true,localState:null,stack:[],inDefinition:false}},token:function(e,t){if(!e)return;if(t.stack.length===0){if(e.peek()=='"'||e.peek()=="'"){t.stringType=e.peek();e.next();t.stack.unshift(r._string)}else if(e.match("/*")){t.stack.unshift(r.comment);t.commentType=s.slash}else if(e.match("(*")){t.stack.unshift(r.comment);t.commentType=s.parenthesis}}switch(t.stack[0]){case r._string:while(t.stack[0]===r._string&&!e.eol()){if(e.peek()===t.stringType){e.next();t.stack.shift()}else if(e.peek()==="\\"){e.next();e.next()}else{e.match(/^.[^\\\"\']*/)}}return t.lhs?"property":"string";case r.comment:while(t.stack[0]===r.comment&&!e.eol()){if(t.commentType===s.slash&&e.match("*/")){t.stack.shift();t.commentType=null}else if(t.commentType===s.parenthesis&&e.match("*)")){t.stack.shift();t.commentType=null}else{e.match(/^.[^\*]*/)}}return"comment";case r.characterClass:while(t.stack[0]===r.characterClass&&!e.eol()){if(!(e.match(/^[^\]\\]+/)||e.match("."))){t.stack.shift()}}return"operator"}var a=e.peek();switch(a){case"[":e.next();t.stack.unshift(r.characterClass);return"bracket";case":":case"|":case";":e.next();return"operator";case"%":if(e.match("%%")){return"header"}else if(e.match(/[%][A-Za-z]+/)){return"keyword"}else if(e.match(/[%][}]/)){return"bracket"}break;case"/":if(e.match(/[\/][A-Za-z]+/)){return"keyword"}case"\\":if(e.match(/[\][a-z]+/)){return"string.special"}case".":if(e.match(".")){return"atom"}case"*":case"-":case"+":case"^":if(e.match(a)){return"atom"}case"$":if(e.match("$$")){return"builtin"}else if(e.match(/[$][0-9]+/)){return"variableName.special"}case"<":if(e.match(/<<[a-zA-Z_]+>>/)){return"builtin"}}if(e.match("//")){e.skipToEnd();return"comment"}else if(e.match("return")){return"operator"}else if(e.match(/^[a-zA-Z_][a-zA-Z0-9_]*/)){if(e.match(/(?=[\(.])/)){return"variable"}else if(e.match(/(?=[\s\n]*[:=])/)){return"def"}return"variableName.special"}else if(["[","]","(",")"].indexOf(e.peek())!=-1){e.next();return"bracket"}else if(!e.eatSpace()){e.next()}return null}}}}]); \ No newline at end of file diff --git a/emissary-ml/llm-scripts/fine-tuning/llama3/venv/share/jupyter/lab/static/8855.b17b9969fce42d0398e4.js b/emissary-ml/llm-scripts/fine-tuning/llama3/venv/share/jupyter/lab/static/8855.b17b9969fce42d0398e4.js new file mode 100644 index 0000000000000000000000000000000000000000..a7f223a7fcf4d56daea1e5165c37a9376b4202a4 --- /dev/null +++ b/emissary-ml/llm-scripts/fine-tuning/llama3/venv/share/jupyter/lab/static/8855.b17b9969fce42d0398e4.js @@ -0,0 +1 @@ +"use strict";(self["webpackChunk_jupyterlab_application_top"]=self["webpackChunk_jupyterlab_application_top"]||[]).push([[8855],{88855:(t,e,s)=>{s.d(e,{Zk:()=>l,q7:()=>Q,tM:()=>Tt,u4:()=>_t});var i=s(15051);var r=s(94065);var n=s(96049);var a=s(75905);var o=function(){var t=(0,a.K2)((function(t,e,s,i){for(s=s||{},i=t.length;i--;s[t[i]]=e);return s}),"o"),e=[1,2],s=[1,3],i=[1,4],r=[2,4],n=[1,9],o=[1,11],l=[1,16],c=[1,17],h=[1,18],d=[1,19],u=[1,32],p=[1,20],f=[1,21],y=[1,22],g=[1,23],m=[1,24],S=[1,26],b=[1,27],k=[1,28],_=[1,29],v=[1,30],T=[1,31],E=[1,34],D=[1,35],x=[1,36],C=[1,37],$=[1,33],I=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,42,45,48,49,50,51,54],L=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,42,45,48,49,50,51,54],A=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,42,45,48,49,50,51,54];var w={trace:(0,a.K2)((function t(){}),"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"--\x3e":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,classDef:38,CLASSDEF_ID:39,CLASSDEF_STYLEOPTS:40,DEFAULT:41,style:42,STYLE_IDS:43,STYLEDEF_STYLEOPTS:44,class:45,CLASSENTITY_IDS:46,STYLECLASS:47,direction_tb:48,direction_bt:49,direction_rl:50,direction_lr:51,eol:52,";":53,EDGE_STATE:54,STYLE_SEPARATOR:55,left_of:56,right_of:57,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",14:"DESCR",15:"--\x3e",16:"HIDE_EMPTY",17:"scale",18:"WIDTH",19:"COMPOSIT_STATE",20:"STRUCT_START",21:"STRUCT_STOP",22:"STATE_DESCR",23:"AS",24:"ID",25:"FORK",26:"JOIN",27:"CHOICE",28:"CONCURRENT",29:"note",31:"NOTE_TEXT",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",38:"classDef",39:"CLASSDEF_ID",40:"CLASSDEF_STYLEOPTS",41:"DEFAULT",42:"style",43:"STYLE_IDS",44:"STYLEDEF_STYLEOPTS",45:"class",46:"CLASSENTITY_IDS",47:"STYLECLASS",48:"direction_tb",49:"direction_bt",50:"direction_rl",51:"direction_lr",53:";",54:"EDGE_STATE",55:"STYLE_SEPARATOR",56:"left_of",57:"right_of"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[52,1],[52,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:(0,a.K2)((function t(e,s,i,r,n,a,o){var l=a.length-1;switch(n){case 3:r.setRootDoc(a[l]);return a[l];break;case 4:this.$=[];break;case 5:if(a[l]!="nl"){a[l-1].push(a[l]);this.$=a[l-1]}break;case 6:case 7:this.$=a[l];break;case 8:this.$="nl";break;case 12:this.$=a[l];break;case 13:const t=a[l-1];t.description=r.trimColon(a[l]);this.$=t;break;case 14:this.$={stmt:"relation",state1:a[l-2],state2:a[l]};break;case 15:const e=r.trimColon(a[l]);this.$={stmt:"relation",state1:a[l-3],state2:a[l-1],description:e};break;case 19:this.$={stmt:"state",id:a[l-3],type:"default",description:"",doc:a[l-1]};break;case 20:var c=a[l];var h=a[l-2].trim();if(a[l].match(":")){var d=a[l].split(":");c=d[0];h=[h,d[1]]}this.$={stmt:"state",id:c,type:"default",description:h};break;case 21:this.$={stmt:"state",id:a[l-3],type:"default",description:a[l-5],doc:a[l-1]};break;case 22:this.$={stmt:"state",id:a[l],type:"fork"};break;case 23:this.$={stmt:"state",id:a[l],type:"join"};break;case 24:this.$={stmt:"state",id:a[l],type:"choice"};break;case 25:this.$={stmt:"state",id:r.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:a[l-1].trim(),note:{position:a[l-2].trim(),text:a[l].trim()}};break;case 29:this.$=a[l].trim();r.setAccTitle(this.$);break;case 30:case 31:this.$=a[l].trim();r.setAccDescription(this.$);break;case 32:case 33:this.$={stmt:"classDef",id:a[l-1].trim(),classes:a[l].trim()};break;case 34:this.$={stmt:"style",id:a[l-1].trim(),styleClass:a[l].trim()};break;case 35:this.$={stmt:"applyClass",id:a[l-1].trim(),styleClass:a[l].trim()};break;case 36:r.setDirection("TB");this.$={stmt:"dir",value:"TB"};break;case 37:r.setDirection("BT");this.$={stmt:"dir",value:"BT"};break;case 38:r.setDirection("RL");this.$={stmt:"dir",value:"RL"};break;case 39:r.setDirection("LR");this.$={stmt:"dir",value:"LR"};break;case 42:case 43:this.$={stmt:"state",id:a[l].trim(),type:"default",description:""};break;case 44:this.$={stmt:"state",id:a[l-2].trim(),classes:[a[l].trim()],type:"default",description:""};break;case 45:this.$={stmt:"state",id:a[l-2].trim(),classes:[a[l].trim()],type:"default",description:""};break}}),"anonymous"),table:[{3:1,4:e,5:s,6:i},{1:[3]},{3:5,4:e,5:s,6:i},{3:6,4:e,5:s,6:i},t([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,42,45,48,49,50,51,54],r,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:n,5:o,8:8,9:10,10:12,11:13,12:14,13:15,16:l,17:c,19:h,22:d,24:u,25:p,26:f,27:y,28:g,29:m,32:25,33:S,35:b,37:k,38:_,42:v,45:T,48:E,49:D,50:x,51:C,54:$},t(I,[2,5]),{9:38,10:12,11:13,12:14,13:15,16:l,17:c,19:h,22:d,24:u,25:p,26:f,27:y,28:g,29:m,32:25,33:S,35:b,37:k,38:_,42:v,45:T,48:E,49:D,50:x,51:C,54:$},t(I,[2,7]),t(I,[2,8]),t(I,[2,9]),t(I,[2,10]),t(I,[2,11]),t(I,[2,12],{14:[1,39],15:[1,40]}),t(I,[2,16]),{18:[1,41]},t(I,[2,18],{20:[1,42]}),{23:[1,43]},t(I,[2,22]),t(I,[2,23]),t(I,[2,24]),t(I,[2,25]),{30:44,31:[1,45],56:[1,46],57:[1,47]},t(I,[2,28]),{34:[1,48]},{36:[1,49]},t(I,[2,31]),{39:[1,50],41:[1,51]},{43:[1,52]},{46:[1,53]},t(L,[2,42],{55:[1,54]}),t(L,[2,43],{55:[1,55]}),t(I,[2,36]),t(I,[2,37]),t(I,[2,38]),t(I,[2,39]),t(I,[2,6]),t(I,[2,13]),{13:56,24:u,54:$},t(I,[2,17]),t(A,r,{7:57}),{24:[1,58]},{24:[1,59]},{23:[1,60]},{24:[2,46]},{24:[2,47]},t(I,[2,29]),t(I,[2,30]),{40:[1,61]},{40:[1,62]},{44:[1,63]},{47:[1,64]},{24:[1,65]},{24:[1,66]},t(I,[2,14],{14:[1,67]}),{4:n,5:o,8:8,9:10,10:12,11:13,12:14,13:15,16:l,17:c,19:h,21:[1,68],22:d,24:u,25:p,26:f,27:y,28:g,29:m,32:25,33:S,35:b,37:k,38:_,42:v,45:T,48:E,49:D,50:x,51:C,54:$},t(I,[2,20],{20:[1,69]}),{31:[1,70]},{24:[1,71]},t(I,[2,32]),t(I,[2,33]),t(I,[2,34]),t(I,[2,35]),t(L,[2,44]),t(L,[2,45]),t(I,[2,15]),t(I,[2,19]),t(A,r,{7:72}),t(I,[2,26]),t(I,[2,27]),{4:n,5:o,8:8,9:10,10:12,11:13,12:14,13:15,16:l,17:c,19:h,21:[1,73],22:d,24:u,25:p,26:f,27:y,28:g,29:m,32:25,33:S,35:b,37:k,38:_,42:v,45:T,48:E,49:D,50:x,51:C,54:$},t(I,[2,21])],defaultActions:{5:[2,1],6:[2,2],46:[2,46],47:[2,47]},parseError:(0,a.K2)((function t(e,s){if(s.recoverable){this.trace(e)}else{var i=new Error(e);i.hash=s;throw i}}),"parseError"),parse:(0,a.K2)((function t(e){var s=this,i=[0],r=[],n=[null],o=[],l=this.table,c="",h=0,d=0,u=0,p=2,f=1;var y=o.slice.call(arguments,1);var g=Object.create(this.lexer);var m={yy:{}};for(var S in this.yy){if(Object.prototype.hasOwnProperty.call(this.yy,S)){m.yy[S]=this.yy[S]}}g.setInput(e,m.yy);m.yy.lexer=g;m.yy.parser=this;if(typeof g.yylloc=="undefined"){g.yylloc={}}var b=g.yylloc;o.push(b);var k=g.options&&g.options.ranges;if(typeof m.yy.parseError==="function"){this.parseError=m.yy.parseError}else{this.parseError=Object.getPrototypeOf(this).parseError}function _(t){i.length=i.length-2*t;n.length=n.length-t;o.length=o.length-t}(0,a.K2)(_,"popStack");function v(){var t;t=r.pop()||g.lex()||f;if(typeof t!=="number"){if(t instanceof Array){r=t;t=r.pop()}t=s.symbols_[t]||t}return t}(0,a.K2)(v,"lex");var T,E,D,x,C,$,I={},L,A,w,R;while(true){D=i[i.length-1];if(this.defaultActions[D]){x=this.defaultActions[D]}else{if(T===null||typeof T=="undefined"){T=v()}x=l[D]&&l[D][T]}if(typeof x==="undefined"||!x.length||!x[0]){var O="";R=[];for(L in l[D]){if(this.terminals_[L]&&L>p){R.push("'"+this.terminals_[L]+"'")}}if(g.showPosition){O="Parse error on line "+(h+1)+":\n"+g.showPosition()+"\nExpecting "+R.join(", ")+", got '"+(this.terminals_[T]||T)+"'"}else{O="Parse error on line "+(h+1)+": Unexpected "+(T==f?"end of input":"'"+(this.terminals_[T]||T)+"'")}this.parseError(O,{text:g.match,token:this.terminals_[T]||T,line:g.yylineno,loc:b,expected:R})}if(x[0]instanceof Array&&x.length>1){throw new Error("Parse Error: multiple actions possible at state: "+D+", token: "+T)}switch(x[0]){case 1:i.push(T);n.push(g.yytext);o.push(g.yylloc);i.push(x[1]);T=null;if(!E){d=g.yyleng;c=g.yytext;h=g.yylineno;b=g.yylloc;if(u>0){u--}}else{T=E;E=null}break;case 2:A=this.productions_[x[1]][1];I.$=n[n.length-A];I._$={first_line:o[o.length-(A||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(A||1)].first_column,last_column:o[o.length-1].last_column};if(k){I._$.range=[o[o.length-(A||1)].range[0],o[o.length-1].range[1]]}$=this.performAction.apply(I,[c,d,h,m.yy,x[1],n,o].concat(y));if(typeof $!=="undefined"){return $}if(A){i=i.slice(0,-1*A*2);n=n.slice(0,-1*A);o=o.slice(0,-1*A)}i.push(this.productions_[x[1]][0]);n.push(I.$);o.push(I._$);w=l[i[i.length-2]][i[i.length-1]];i.push(w);break;case 3:return true}}return true}),"parse")};var R=function(){var t={EOF:1,parseError:(0,a.K2)((function t(e,s){if(this.yy.parser){this.yy.parser.parseError(e,s)}else{throw new Error(e)}}),"parseError"),setInput:(0,a.K2)((function(t,e){this.yy=e||this.yy||{};this._input=t;this._more=this._backtrack=this.done=false;this.yylineno=this.yyleng=0;this.yytext=this.matched=this.match="";this.conditionStack=["INITIAL"];this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0};if(this.options.ranges){this.yylloc.range=[0,0]}this.offset=0;return this}),"setInput"),input:(0,a.K2)((function(){var t=this._input[0];this.yytext+=t;this.yyleng++;this.offset++;this.match+=t;this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);if(e){this.yylineno++;this.yylloc.last_line++}else{this.yylloc.last_column++}if(this.options.ranges){this.yylloc.range[1]++}this._input=this._input.slice(1);return t}),"input"),unput:(0,a.K2)((function(t){var e=t.length;var s=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input;this.yytext=this.yytext.substr(0,this.yytext.length-e);this.offset-=e;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1);this.matched=this.matched.substr(0,this.matched.length-1);if(s.length-1){this.yylineno-=s.length-1}var r=this.yylloc.range;this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:s?(s.length===i.length?this.yylloc.first_column:0)+i[i.length-s.length].length-s[0].length:this.yylloc.first_column-e};if(this.options.ranges){this.yylloc.range=[r[0],r[0]+this.yyleng-e]}this.yyleng=this.yytext.length;return this}),"unput"),more:(0,a.K2)((function(){this._more=true;return this}),"more"),reject:(0,a.K2)((function(){if(this.options.backtrack_lexer){this._backtrack=true}else{return this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}return this}),"reject"),less:(0,a.K2)((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:(0,a.K2)((function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")}),"pastInput"),upcomingInput:(0,a.K2)((function(){var t=this.match;if(t.length<20){t+=this._input.substr(0,20-t.length)}return(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")}),"upcomingInput"),showPosition:(0,a.K2)((function(){var t=this.pastInput();var e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:(0,a.K2)((function(t,e){var s,i,r;if(this.options.backtrack_lexer){r={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done};if(this.options.ranges){r.yylloc.range=this.yylloc.range.slice(0)}}i=t[0].match(/(?:\r\n?|\n).*/g);if(i){this.yylineno+=i.length}this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length};this.yytext+=t[0];this.match+=t[0];this.matches=t;this.yyleng=this.yytext.length;if(this.options.ranges){this.yylloc.range=[this.offset,this.offset+=this.yyleng]}this._more=false;this._backtrack=false;this._input=this._input.slice(t[0].length);this.matched+=t[0];s=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]);if(this.done&&this._input){this.done=false}if(s){return s}else if(this._backtrack){for(var n in r){this[n]=r[n]}return false}return false}),"test_match"),next:(0,a.K2)((function(){if(this.done){return this.EOF}if(!this._input){this.done=true}var t,e,s,i;if(!this._more){this.yytext="";this.match=""}var r=this._currentRules();for(var n=0;ne[0].length)){e=s;i=n;if(this.options.backtrack_lexer){t=this.test_match(s,r[n]);if(t!==false){return t}else if(this._backtrack){e=false;continue}else{return false}}else if(!this.options.flex){break}}}if(e){t=this.test_match(e,r[i]);if(t!==false){return t}return false}if(this._input===""){return this.EOF}else{return this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}}),"next"),lex:(0,a.K2)((function t(){var e=this.next();if(e){return e}else{return this.lex()}}),"lex"),begin:(0,a.K2)((function t(e){this.conditionStack.push(e)}),"begin"),popState:(0,a.K2)((function t(){var e=this.conditionStack.length-1;if(e>0){return this.conditionStack.pop()}else{return this.conditionStack[0]}}),"popState"),_currentRules:(0,a.K2)((function t(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules}else{return this.conditions["INITIAL"].rules}}),"_currentRules"),topState:(0,a.K2)((function t(e){e=this.conditionStack.length-1-Math.abs(e||0);if(e>=0){return this.conditionStack[e]}else{return"INITIAL"}}),"topState"),pushState:(0,a.K2)((function t(e){this.begin(e)}),"pushState"),stateStackSize:(0,a.K2)((function t(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":true},performAction:(0,a.K2)((function t(e,s,i,r){var n=r;switch(i){case 0:return 41;break;case 1:return 48;break;case 2:return 49;break;case 3:return 50;break;case 4:return 51;break;case 5:break;case 6:{}break;case 7:return 5;break;case 8:break;case 9:break;case 10:break;case 11:break;case 12:this.pushState("SCALE");return 17;break;case 13:return 18;break;case 14:this.popState();break;case 15:this.begin("acc_title");return 33;break;case 16:this.popState();return"acc_title_value";break;case 17:this.begin("acc_descr");return 35;break;case 18:this.popState();return"acc_descr_value";break;case 19:this.begin("acc_descr_multiline");break;case 20:this.popState();break;case 21:return"acc_descr_multiline_value";break;case 22:this.pushState("CLASSDEF");return 38;break;case 23:this.popState();this.pushState("CLASSDEFID");return"DEFAULT_CLASSDEF_ID";break;case 24:this.popState();this.pushState("CLASSDEFID");return 39;break;case 25:this.popState();return 40;break;case 26:this.pushState("CLASS");return 45;break;case 27:this.popState();this.pushState("CLASS_STYLE");return 46;break;case 28:this.popState();return 47;break;case 29:this.pushState("STYLE");return 42;break;case 30:this.popState();this.pushState("STYLEDEF_STYLES");return 43;break;case 31:this.popState();return 44;break;case 32:this.pushState("SCALE");return 17;break;case 33:return 18;break;case 34:this.popState();break;case 35:this.pushState("STATE");break;case 36:this.popState();s.yytext=s.yytext.slice(0,-8).trim();return 25;break;case 37:this.popState();s.yytext=s.yytext.slice(0,-8).trim();return 26;break;case 38:this.popState();s.yytext=s.yytext.slice(0,-10).trim();return 27;break;case 39:this.popState();s.yytext=s.yytext.slice(0,-8).trim();return 25;break;case 40:this.popState();s.yytext=s.yytext.slice(0,-8).trim();return 26;break;case 41:this.popState();s.yytext=s.yytext.slice(0,-10).trim();return 27;break;case 42:return 48;break;case 43:return 49;break;case 44:return 50;break;case 45:return 51;break;case 46:this.pushState("STATE_STRING");break;case 47:this.pushState("STATE_ID");return"AS";break;case 48:this.popState();return"ID";break;case 49:this.popState();break;case 50:return"STATE_DESCR";break;case 51:return 19;break;case 52:this.popState();break;case 53:this.popState();this.pushState("struct");return 20;break;case 54:break;case 55:this.popState();return 21;break;case 56:break;case 57:this.begin("NOTE");return 29;break;case 58:this.popState();this.pushState("NOTE_ID");return 56;break;case 59:this.popState();this.pushState("NOTE_ID");return 57;break;case 60:this.popState();this.pushState("FLOATING_NOTE");break;case 61:this.popState();this.pushState("FLOATING_NOTE_ID");return"AS";break;case 62:break;case 63:return"NOTE_TEXT";break;case 64:this.popState();return"ID";break;case 65:this.popState();this.pushState("NOTE_TEXT");return 24;break;case 66:this.popState();s.yytext=s.yytext.substr(2).trim();return 31;break;case 67:this.popState();s.yytext=s.yytext.slice(0,-8).trim();return 31;break;case 68:return 6;break;case 69:return 6;break;case 70:return 16;break;case 71:return 54;break;case 72:return 24;break;case 73:s.yytext=s.yytext.trim();return 14;break;case 74:return 15;break;case 75:return 28;break;case 76:return 55;break;case 77:return 5;break;case 78:return"INVALID";break}}),"anonymous"),rules:[/^(?:default\b)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:classDef\s+)/i,/^(?:DEFAULT\s+)/i,/^(?:\w+\s+)/i,/^(?:[^\n]*)/i,/^(?:class\s+)/i,/^(?:(\w+)+((,\s*\w+)*))/i,/^(?:[^\n]*)/i,/^(?:style\s+)/i,/^(?:[\w,]+\s+)/i,/^(?:[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:state\s+)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*\[\[fork\]\])/i,/^(?:.*\[\[join\]\])/i,/^(?:.*\[\[choice\]\])/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:["])/i,/^(?:\s*as\s+)/i,/^(?:[^\n\{]*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:\})/i,/^(?:[\n])/i,/^(?:note\s+)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:")/i,/^(?:\s*as\s*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n]*)/i,/^(?:\s*[^:\n\s\-]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:[\s\S]*?end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?::::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[9,10],inclusive:false},struct:{rules:[9,10,22,26,29,35,42,43,44,45,54,55,56,57,71,72,73,74,75],inclusive:false},FLOATING_NOTE_ID:{rules:[64],inclusive:false},FLOATING_NOTE:{rules:[61,62,63],inclusive:false},NOTE_TEXT:{rules:[66,67],inclusive:false},NOTE_ID:{rules:[65],inclusive:false},NOTE:{rules:[58,59,60],inclusive:false},STYLEDEF_STYLEOPTS:{rules:[],inclusive:false},STYLEDEF_STYLES:{rules:[31],inclusive:false},STYLE_IDS:{rules:[],inclusive:false},STYLE:{rules:[30],inclusive:false},CLASS_STYLE:{rules:[28],inclusive:false},CLASS:{rules:[27],inclusive:false},CLASSDEFID:{rules:[25],inclusive:false},CLASSDEF:{rules:[23,24],inclusive:false},acc_descr_multiline:{rules:[20,21],inclusive:false},acc_descr:{rules:[18],inclusive:false},acc_title:{rules:[16],inclusive:false},SCALE:{rules:[13,14,33,34],inclusive:false},ALIAS:{rules:[],inclusive:false},STATE_ID:{rules:[48],inclusive:false},STATE_STRING:{rules:[49,50],inclusive:false},FORK_STATE:{rules:[],inclusive:false},STATE:{rules:[9,10,36,37,38,39,40,41,46,47,51,52,53],inclusive:false},ID:{rules:[9,10],inclusive:false},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,10,11,12,15,17,19,22,26,29,32,35,53,57,68,69,70,71,72,73,74,76,77,78],inclusive:true}}};return t}();w.lexer=R;function O(){this.yy={}}(0,a.K2)(O,"Parser");O.prototype=w;w.Parser=O;return new O}();o.parser=o;var l=o;var c="TB";var h="TB";var d="dir";var u="state";var p="relation";var f="classDef";var y="style";var g="applyClass";var m="default";var S="divider";var b="fill:none";var k="fill: #333";var _="c";var v="text";var T="normal";var E="rect";var D="rectWithTitle";var x="stateStart";var C="stateEnd";var $="divider";var I="roundedWithTitle";var L="note";var A="noteGroup";var w="statediagram";var R="state";var O=`${w}-${R}`;var N="transition";var K="note";var B="note-edge";var F=`${N} ${B}`;var Y=`${w}-${K}`;var P="cluster";var G=`${w}-${P}`;var j="cluster-alt";var z=`${w}-${j}`;var U="parent";var M="note";var V="state";var X="----";var W=`${X}${M}`;var H=`${X}${U}`;var J=(0,a.K2)(((t,e=h)=>{if(!t.doc){return e}let s=e;for(const i of t.doc){if(i.stmt==="dir"){s=i.value}}return s}),"getDir");var q=(0,a.K2)((function(t,e){return e.db.getClasses()}),"getClasses");var Z=(0,a.K2)((async function(t,e,s,o){a.Rm.info("REF0:");a.Rm.info("Drawing state diagram (v2)",e);const{securityLevel:l,state:c,layout:h}=(0,a.D7)();o.db.extract(o.db.getRootDocV2());const d=o.db.getData();const u=(0,i.A)(e,l);d.type=o.type;d.layoutAlgorithm=h;d.nodeSpacing=c?.nodeSpacing||50;d.rankSpacing=c?.rankSpacing||50;d.markers=["barb"];d.diagramId=e;await(0,r.XX)(d,u);const p=8;n._K.insertTitle(u,"statediagramTitleText",c?.titleTopMargin??25,o.db.getDiagramTitle());(0,i.P)(u,p,w,c?.useMaxWidth??true)}),"draw");var Q={getClasses:q,draw:Z,getDir:J};var tt=new Map;var et=0;function st(t="",e=0,s="",i=X){const r=s!==null&&s.length>0?`${i}${s}`:"";return`${V}-${t}${r}-${e}`}(0,a.K2)(st,"stateDomId");var it=(0,a.K2)(((t,e,s,i,r,n,o,l)=>{a.Rm.trace("items",e);e.forEach((e=>{switch(e.stmt){case u:lt(t,e,s,i,r,n,o,l);break;case m:lt(t,e,s,i,r,n,o,l);break;case p:{lt(t,e.state1,s,i,r,n,o,l);lt(t,e.state2,s,i,r,n,o,l);const c={id:"edge"+et,start:e.state1.id,end:e.state2.id,arrowhead:"normal",arrowTypeEnd:"arrow_barb",style:b,labelStyle:"",label:a.Y2.sanitizeText(e.description,(0,a.D7)()),arrowheadStyle:k,labelpos:_,labelType:v,thickness:T,classes:N,look:o};r.push(c);et++}break}}))}),"setupDoc");var rt=(0,a.K2)(((t,e=h)=>{let s=e;if(t.doc){for(const e of t.doc){if(e.stmt==="dir"){s=e.value}}}return s}),"getDir");function nt(t,e,s){if(!e.id||e.id===""||e.id===""){return}if(e.cssClasses){if(!Array.isArray(e.cssCompiledStyles)){e.cssCompiledStyles=[]}e.cssClasses.split(" ").forEach((t=>{if(s.get(t)){const i=s.get(t);e.cssCompiledStyles=[...e.cssCompiledStyles,...i.styles]}}))}const i=t.find((t=>t.id===e.id));if(i){Object.assign(i,e)}else{t.push(e)}}(0,a.K2)(nt,"insertOrUpdateNode");function at(t){return t?.classes?.join(" ")??""}(0,a.K2)(at,"getClassesFromDbInfo");function ot(t){return t?.styles??[]}(0,a.K2)(ot,"getStylesFromDbInfo");var lt=(0,a.K2)(((t,e,s,i,r,n,o,l)=>{const c=e.id;const h=s.get(c);const d=at(h);const u=ot(h);a.Rm.info("dataFetcher parsedItem",e,h,u);if(c!=="root"){let s=E;if(e.start===true){s=x}else if(e.start===false){s=C}if(e.type!==m){s=e.type}if(!tt.get(c)){tt.set(c,{id:c,shape:s,description:a.Y2.sanitizeText(c,(0,a.D7)()),cssClasses:`${d} ${O}`,cssStyles:u})}const h=tt.get(c);if(e.description){if(Array.isArray(h.description)){h.shape=D;h.description.push(e.description)}else{if(h.description?.length>0){h.shape=D;if(h.description===c){h.description=[e.description]}else{h.description=[h.description,e.description]}}else{h.shape=E;h.description=e.description}}h.description=a.Y2.sanitizeTextOrArray(h.description,(0,a.D7)())}if(h.description?.length===1&&h.shape===D){if(h.type==="group"){h.shape=I}else{h.shape=E}}if(!h.type&&e.doc){a.Rm.info("Setting cluster for XCX",c,rt(e));h.type="group";h.isGroup=true;h.dir=rt(e);h.shape=e.type===S?$:I;h.cssClasses=`${h.cssClasses} ${G} ${n?z:""}`}const p={labelStyle:"",shape:h.shape,label:h.description,cssClasses:h.cssClasses,cssCompiledStyles:[],cssStyles:h.cssStyles,id:c,dir:h.dir,domId:st(c,et),type:h.type,isGroup:h.type==="group",padding:8,rx:10,ry:10,look:o};if(p.shape===$){p.label=""}if(t&&t.id!=="root"){a.Rm.trace("Setting node ",c," to be child of its parent ",t.id);p.parentId=t.id}p.centerLabel=true;if(e.note){const t={labelStyle:"",shape:L,label:e.note.text,cssClasses:Y,cssStyles:[],cssCompilesStyles:[],id:c+W+"-"+et,domId:st(c,et,M),type:h.type,isGroup:h.type==="group",padding:(0,a.D7)().flowchart.padding,look:o,position:e.note.position};const s=c+H;const n={labelStyle:"",shape:A,label:e.note.text,cssClasses:h.cssClasses,cssStyles:[],id:c+H,domId:st(c,et,U),type:"group",isGroup:true,padding:16,look:o,position:e.note.position};et++;n.id=s;t.parentId=s;nt(i,n,l);nt(i,t,l);nt(i,p,l);let d=c;let u=t.id;if(e.note.position==="left of"){d=t.id;u=c}r.push({id:d+"-"+u,start:d,end:u,arrowhead:"none",arrowTypeEnd:"",style:b,labelStyle:"",classes:F,arrowheadStyle:k,labelpos:_,labelType:v,thickness:T,look:o})}else{nt(i,p,l)}}if(e.doc){a.Rm.trace("Adding nodes children ");it(e,e.doc,s,i,r,!n,o,l)}}),"dataFetcher");var ct=(0,a.K2)((()=>{tt.clear();et=0}),"reset");var ht="[*]";var dt="start";var ut=ht;var pt="end";var ft="color";var yt="fill";var gt="bgFill";var mt=",";function St(){return new Map}(0,a.K2)(St,"newClassesList");var bt=(0,a.K2)((()=>({relations:[],states:new Map,documents:{}})),"newDoc");var kt=(0,a.K2)((t=>JSON.parse(JSON.stringify(t))),"clone");var _t=class{static{(0,a.K2)(this,"StateDB")}constructor(t){this.clear();this.version=t;this.setRootDoc=this.setRootDoc.bind(this);this.getDividerId=this.getDividerId.bind(this);this.setDirection=this.setDirection.bind(this);this.trimColon=this.trimColon.bind(this)}version;nodes=[];edges=[];rootDoc=[];classes=St();documents={root:bt()};currentDocument=this.documents.root;startEndCount=0;dividerCnt=0;static relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3};setRootDoc(t){a.Rm.info("Setting root doc",t);this.rootDoc=t;if(this.version===1){this.extract(t)}else{this.extract(this.getRootDocV2())}}getRootDoc(){return this.rootDoc}docTranslator(t,e,s){if(e.stmt===p){this.docTranslator(t,e.state1,true);this.docTranslator(t,e.state2,false)}else{if(e.stmt===u){if(e.id==="[*]"){e.id=s?t.id+"_start":t.id+"_end";e.start=s}else{e.id=e.id.trim()}}if(e.doc){const t=[];let s=[];let i;for(i=0;i0&&s.length>0){const i={stmt:u,id:(0,n.$C)(),type:"divider",doc:kt(s)};t.push(kt(i));e.doc=t}e.doc.forEach((t=>this.docTranslator(e,t,true)))}}}getRootDocV2(){this.docTranslator({id:"root"},{id:"root",doc:this.rootDoc},true);return{id:"root",doc:this.rootDoc}}extract(t){let e;if(t.doc){e=t.doc}else{e=t}a.Rm.info(e);this.clear(true);a.Rm.info("Extract initial document:",e);e.forEach((t=>{a.Rm.warn("Statement",t.stmt);switch(t.stmt){case u:this.addState(t.id.trim(),t.type,t.doc,t.description,t.note,t.classes,t.styles,t.textStyles);break;case p:this.addRelation(t.state1,t.state2,t.description);break;case f:this.addStyleClass(t.id.trim(),t.classes);break;case y:{const e=t.id.trim().split(",");const s=t.styleClass.split(",");e.forEach((t=>{let e=this.getState(t);if(e===void 0){const s=t.trim();this.addState(s);e=this.getState(s)}e.styles=s.map((t=>t.replace(/;/g,"")?.trim()))}))}break;case g:this.setCssClass(t.id.trim(),t.styleClass);break}}));const s=this.getStates();const i=(0,a.D7)();const r=i.look;ct();lt(void 0,this.getRootDocV2(),s,this.nodes,this.edges,true,r,this.classes);this.nodes.forEach((t=>{if(Array.isArray(t.label)){t.description=t.label.slice(1);if(t.isGroup&&t.description.length>0){throw new Error("Group nodes can only have label. Remove the additional description for node ["+t.id+"]")}t.label=t.label[0]}}))}addState(t,e=m,s=null,i=null,r=null,n=null,o=null,l=null){const c=t?.trim();if(!this.currentDocument.states.has(c)){a.Rm.info("Adding state ",c,i);this.currentDocument.states.set(c,{id:c,descriptions:[],type:e,doc:s,note:r,classes:[],styles:[],textStyles:[]})}else{if(!this.currentDocument.states.get(c).doc){this.currentDocument.states.get(c).doc=s}if(!this.currentDocument.states.get(c).type){this.currentDocument.states.get(c).type=e}}if(i){a.Rm.info("Setting state description",c,i);if(typeof i==="string"){this.addDescription(c,i.trim())}if(typeof i==="object"){i.forEach((t=>this.addDescription(c,t.trim())))}}if(r){const t=this.currentDocument.states.get(c);t.note=r;t.note.text=a.Y2.sanitizeText(t.note.text,(0,a.D7)())}if(n){a.Rm.info("Setting state classes",c,n);const t=typeof n==="string"?[n]:n;t.forEach((t=>this.setCssClass(c,t.trim())))}if(o){a.Rm.info("Setting state styles",c,o);const t=typeof o==="string"?[o]:o;t.forEach((t=>this.setStyle(c,t.trim())))}if(l){a.Rm.info("Setting state styles",c,o);const t=typeof l==="string"?[l]:l;t.forEach((t=>this.setTextStyle(c,t.trim())))}}clear(t){this.nodes=[];this.edges=[];this.documents={root:bt()};this.currentDocument=this.documents.root;this.startEndCount=0;this.classes=St();if(!t){(0,a.IU)()}}getState(t){return this.currentDocument.states.get(t)}getStates(){return this.currentDocument.states}logDocuments(){a.Rm.info("Documents = ",this.documents)}getRelations(){return this.currentDocument.relations}startIdIfNeeded(t=""){let e=t;if(t===ht){this.startEndCount++;e=`${dt}${this.startEndCount}`}return e}startTypeIfNeeded(t="",e=m){return t===ht?dt:e}endIdIfNeeded(t=""){let e=t;if(t===ut){this.startEndCount++;e=`${pt}${this.startEndCount}`}return e}endTypeIfNeeded(t="",e=m){return t===ut?pt:e}addRelationObjs(t,e,s){let i=this.startIdIfNeeded(t.id.trim());let r=this.startTypeIfNeeded(t.id.trim(),t.type);let n=this.startIdIfNeeded(e.id.trim());let o=this.startTypeIfNeeded(e.id.trim(),e.type);this.addState(i,r,t.doc,t.description,t.note,t.classes,t.styles,t.textStyles);this.addState(n,o,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles);this.currentDocument.relations.push({id1:i,id2:n,relationTitle:a.Y2.sanitizeText(s,(0,a.D7)())})}addRelation(t,e,s){if(typeof t==="object"){this.addRelationObjs(t,e,s)}else{const i=this.startIdIfNeeded(t.trim());const r=this.startTypeIfNeeded(t);const n=this.endIdIfNeeded(e.trim());const o=this.endTypeIfNeeded(e);this.addState(i,r);this.addState(n,o);this.currentDocument.relations.push({id1:i,id2:n,title:a.Y2.sanitizeText(s,(0,a.D7)())})}}addDescription(t,e){const s=this.currentDocument.states.get(t);const i=e.startsWith(":")?e.replace(":","").trim():e;s.descriptions.push(a.Y2.sanitizeText(i,(0,a.D7)()))}cleanupLabel(t){if(t.substring(0,1)===":"){return t.substr(2).trim()}else{return t.trim()}}getDividerId(){this.dividerCnt++;return"divider-id-"+this.dividerCnt}addStyleClass(t,e=""){if(!this.classes.has(t)){this.classes.set(t,{id:t,styles:[],textStyles:[]})}const s=this.classes.get(t);if(e!==void 0&&e!==null){e.split(mt).forEach((t=>{const e=t.replace(/([^;]*);/,"$1").trim();if(RegExp(ft).exec(t)){const t=e.replace(yt,gt);const i=t.replace(ft,yt);s.textStyles.push(i)}s.styles.push(e)}))}}getClasses(){return this.classes}setCssClass(t,e){t.split(",").forEach((t=>{let s=this.getState(t);if(s===void 0){const e=t.trim();this.addState(e);s=this.getState(e)}s.classes.push(e)}))}setStyle(t,e){const s=this.getState(t);if(s!==void 0){s.styles.push(e)}}setTextStyle(t,e){const s=this.getState(t);if(s!==void 0){s.textStyles.push(e)}}getDirectionStatement(){return this.rootDoc.find((t=>t.stmt===d))}getDirection(){return this.getDirectionStatement()?.value??c}setDirection(t){const e=this.getDirectionStatement();if(e){e.value=t}else{this.rootDoc.unshift({stmt:d,value:t})}}trimColon(t){return t&&t[0]===":"?t.substr(1).trim():t.trim()}getData(){const t=(0,a.D7)();return{nodes:this.nodes,edges:this.edges,other:{},config:t,direction:J(this.getRootDocV2())}}getConfig(){return(0,a.D7)().state}getAccTitle=a.iN;setAccTitle=a.SV;getAccDescription=a.m7;setAccDescription=a.EI;setDiagramTitle=a.ke;getDiagramTitle=a.ab};var vt=(0,a.K2)((t=>`\ndefs #statediagram-barbEnd {\n fill: ${t.transitionColor};\n stroke: ${t.transitionColor};\n }\ng.stateGroup text {\n fill: ${t.nodeBorder};\n stroke: none;\n font-size: 10px;\n}\ng.stateGroup text {\n fill: ${t.textColor};\n stroke: none;\n font-size: 10px;\n\n}\ng.stateGroup .state-title {\n font-weight: bolder;\n fill: ${t.stateLabelColor};\n}\n\ng.stateGroup rect {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n}\n\ng.stateGroup line {\n stroke: ${t.lineColor};\n stroke-width: 1;\n}\n\n.transition {\n stroke: ${t.transitionColor};\n stroke-width: 1;\n fill: none;\n}\n\n.stateGroup .composit {\n fill: ${t.background};\n border-bottom: 1px\n}\n\n.stateGroup .alt-composit {\n fill: #e0e0e0;\n border-bottom: 1px\n}\n\n.state-note {\n stroke: ${t.noteBorderColor};\n fill: ${t.noteBkgColor};\n\n text {\n fill: ${t.noteTextColor};\n stroke: none;\n font-size: 10px;\n }\n}\n\n.stateLabel .box {\n stroke: none;\n stroke-width: 0;\n fill: ${t.mainBkg};\n opacity: 0.5;\n}\n\n.edgeLabel .label rect {\n fill: ${t.labelBackgroundColor};\n opacity: 0.5;\n}\n.edgeLabel {\n background-color: ${t.edgeLabelBackground};\n p {\n background-color: ${t.edgeLabelBackground};\n }\n rect {\n opacity: 0.5;\n background-color: ${t.edgeLabelBackground};\n fill: ${t.edgeLabelBackground};\n }\n text-align: center;\n}\n.edgeLabel .label text {\n fill: ${t.transitionLabelColor||t.tertiaryTextColor};\n}\n.label div .edgeLabel {\n color: ${t.transitionLabelColor||t.tertiaryTextColor};\n}\n\n.stateLabel text {\n fill: ${t.stateLabelColor};\n font-size: 10px;\n font-weight: bold;\n}\n\n.node circle.state-start {\n fill: ${t.specialStateColor};\n stroke: ${t.specialStateColor};\n}\n\n.node .fork-join {\n fill: ${t.specialStateColor};\n stroke: ${t.specialStateColor};\n}\n\n.node circle.state-end {\n fill: ${t.innerEndBackground};\n stroke: ${t.background};\n stroke-width: 1.5\n}\n.end-state-inner {\n fill: ${t.compositeBackground||t.background};\n // stroke: ${t.background};\n stroke-width: 1.5\n}\n\n.node rect {\n fill: ${t.stateBkg||t.mainBkg};\n stroke: ${t.stateBorder||t.nodeBorder};\n stroke-width: 1px;\n}\n.node polygon {\n fill: ${t.mainBkg};\n stroke: ${t.stateBorder||t.nodeBorder};;\n stroke-width: 1px;\n}\n#statediagram-barbEnd {\n fill: ${t.lineColor};\n}\n\n.statediagram-cluster rect {\n fill: ${t.compositeTitleBackground};\n stroke: ${t.stateBorder||t.nodeBorder};\n stroke-width: 1px;\n}\n\n.cluster-label, .nodeLabel {\n color: ${t.stateLabelColor};\n // line-height: 1;\n}\n\n.statediagram-cluster rect.outer {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-state .divider {\n stroke: ${t.stateBorder||t.nodeBorder};\n}\n\n.statediagram-state .title-state {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-cluster.statediagram-cluster .inner {\n fill: ${t.compositeBackground||t.background};\n}\n.statediagram-cluster.statediagram-cluster-alt .inner {\n fill: ${t.altBackground?t.altBackground:"#efefef"};\n}\n\n.statediagram-cluster .inner {\n rx:0;\n ry:0;\n}\n\n.statediagram-state rect.basic {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-state rect.divider {\n stroke-dasharray: 10,10;\n fill: ${t.altBackground?t.altBackground:"#efefef"};\n}\n\n.note-edge {\n stroke-dasharray: 5;\n}\n\n.statediagram-note rect {\n fill: ${t.noteBkgColor};\n stroke: ${t.noteBorderColor};\n stroke-width: 1px;\n rx: 0;\n ry: 0;\n}\n.statediagram-note rect {\n fill: ${t.noteBkgColor};\n stroke: ${t.noteBorderColor};\n stroke-width: 1px;\n rx: 0;\n ry: 0;\n}\n\n.statediagram-note text {\n fill: ${t.noteTextColor};\n}\n\n.statediagram-note .nodeLabel {\n color: ${t.noteTextColor};\n}\n.statediagram .edgeLabel {\n color: red; // ${t.noteTextColor};\n}\n\n#dependencyStart, #dependencyEnd {\n fill: ${t.lineColor};\n stroke: ${t.lineColor};\n stroke-width: 1;\n}\n\n.statediagramTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${t.textColor};\n}\n`),"getStyles");var Tt=vt},15051:(t,e,s)=>{s.d(e,{A:()=>n,P:()=>a});var i=s(75905);var r=s(24982);var n=(0,i.K2)(((t,e)=>{let s;if(e==="sandbox"){s=(0,r.Ltv)("#i"+t)}const i=e==="sandbox"?(0,r.Ltv)(s.nodes()[0].contentDocument.body):(0,r.Ltv)("body");const n=i.select(`[id="${t}"]`);return n}),"getDiagramElement");var a=(0,i.K2)(((t,e,s,r)=>{t.attr("class",s);const{width:n,height:a,x:c,y:h}=o(t,e);(0,i.a$)(t,a,n,r);const d=l(c,h,n,a,e);t.attr("viewBox",d);i.Rm.debug(`viewBox configured: ${d} with padding: ${e}`)}),"setupViewPortForSVG");var o=(0,i.K2)(((t,e)=>{const s=t.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:s.width+e*2,height:s.height+e*2,x:s.x,y:s.y}}),"calculateDimensionsWithPadding");var l=(0,i.K2)(((t,e,s,i,r)=>`${t-r} ${e-r} ${s} ${i}`),"createViewBox")}}]); \ No newline at end of file diff --git a/emissary-ml/llm-scripts/fine-tuning/llama3/venv/share/jupyter/lab/static/c49810b53ecc0d87d802.woff b/emissary-ml/llm-scripts/fine-tuning/llama3/venv/share/jupyter/lab/static/c49810b53ecc0d87d802.woff new file mode 100644 index 0000000000000000000000000000000000000000..e735ddf8505afa47b3901ab90560caa72e57b755 Binary files /dev/null and b/emissary-ml/llm-scripts/fine-tuning/llama3/venv/share/jupyter/lab/static/c49810b53ecc0d87d802.woff differ diff --git a/emissary-ml/llm-scripts/fine-tuning/llama3/venv/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/launch-tree.json b/emissary-ml/llm-scripts/fine-tuning/llama3/venv/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/launch-tree.json new file mode 100644 index 0000000000000000000000000000000000000000..0cf51ba56c6bf7b6d2c26a4c24ca8ab2e78b00f6 --- /dev/null +++ b/emissary-ml/llm-scripts/fine-tuning/llama3/venv/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/launch-tree.json @@ -0,0 +1,20 @@ +{ + "title": "Launch Shortcuts", + "description": "Launch Shortcuts.", + "jupyter.lab.menus": { + "main": [ + { + "id": "jp-mainmenu-help", + "items": [ + { + "command": "jupyter-notebook:launch-tree", + "rank": 1 + } + ] + } + ] + }, + "properties": {}, + "additionalProperties": false, + "type": "object" +} diff --git a/emissary-ml/llm-scripts/fine-tuning/llama3/venv/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/package.json.orig b/emissary-ml/llm-scripts/fine-tuning/llama3/venv/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/package.json.orig new file mode 100644 index 0000000000000000000000000000000000000000..f44fb94254c7c36ebe4dfbf0223dbebfdf1f13f8 --- /dev/null +++ b/emissary-ml/llm-scripts/fine-tuning/llama3/venv/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/package.json.orig @@ -0,0 +1,104 @@ +{ + "name": "@jupyter-notebook/lab-extension", + "version": "7.4.2", + "description": "Jupyter Notebook - Lab Extension", + "homepage": "https://github.com/jupyter/notebook", + "bugs": { + "url": "https://github.com/jupyter/notebook/issues" + }, + "repository": { + "type": "git", + "url": "https://github.com/jupyter/notebook.git" + }, + "license": "BSD-3-Clause", + "author": "Project Jupyter", + "sideEffects": [ + "style/**/*.css", + "style/index.js" + ], + "main": "lib/index.js", + "types": "lib/index.d.ts", + "style": "style/index.css", + "directories": { + "lib": "lib/" + }, + "files": [ + "lib/*.d.ts", + "lib/*.js.map", + "lib/*.js", + "schema/*.json", + "style/index.js" + ], + "scripts": { + "build": "jlpm run build:labextension:dev", + "build:labextension": "jupyter labextension build .", + "build:labextension:dev": "jupyter labextension build --development True .", + "build:lib": "tsc -b", + "build:prod": "jlpm run build:labextension", + "clean": "jlpm run clean:lib && jlpm run clean:labextension", + "clean:labextension": "rimraf ../../notebook/labextension", + "clean:lib": "rimraf lib tsconfig.tsbuildinfo", + "watch": "run-p watch:src watch:labextension", + "watch:labextension": "jupyter labextension watch .", + "watch:src": "tsc -w" + }, + "dependencies": { + "@jupyter-notebook/application": "^7.4.2", + "@jupyterlab/application": "~4.4.2", + "@jupyterlab/apputils": "~4.5.2", + "@jupyterlab/coreutils": "~6.4.2", + "@jupyterlab/docregistry": "~4.4.2", + "@jupyterlab/notebook": "~4.4.2", + "@jupyterlab/translation": "~4.4.2", + "@jupyterlab/ui-components": "~4.4.2", + "@lumino/commands": "^2.3.2", + "@lumino/disposable": "^2.1.4" + }, + "devDependencies": { + "@jupyterlab/builder": "~4.4.2", + "rimraf": "^3.0.2", + "typescript": "~5.5.4" + }, + "publishConfig": { + "access": "public" + }, + "jupyterlab": { + "extension": true, + "outputDir": "../../notebook/labextension", + "schemaDir": "schema" + }, + "nx": { + "targets": { + "build:labextension:dev": { + "dependsOn": [ + "^build:lib", + "build:lib" + ], + "outputs": [ + "{workspaceRoot}/notebook/labextension", + "{workspaceRoot}/notebook/labextension/build_log.json" + ] + }, + "build:labextension": { + "dependsOn": [ + "^build:lib", + "build:lib" + ], + "outputs": [ + "{workspaceRoot}/notebook/labextension" + ] + }, + "build": { + "dependsOn": [ + "build:labextension:dev" + ] + }, + "build:prod": { + "dependsOn": [ + "build:labextension" + ] + } + } + }, + "styleModule": "style/index.js" +} diff --git a/emissary-ml/llm-scripts/fine-tuning/llama3/venv/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/199.f16f9d1ce907d41fa0e1.js b/emissary-ml/llm-scripts/fine-tuning/llama3/venv/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/199.f16f9d1ce907d41fa0e1.js new file mode 100644 index 0000000000000000000000000000000000000000..1161a77f15e406fec8a4c72284d121417ccc6342 --- /dev/null +++ b/emissary-ml/llm-scripts/fine-tuning/llama3/venv/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/199.f16f9d1ce907d41fa0e1.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_jupyter_notebook_lab_extension=self.webpackChunk_jupyter_notebook_lab_extension||[]).push([[199],{30:(e,t,i)=>{i.r(t),i.d(t,{INotebookPathOpener:()=>C,INotebookShell:()=>k,NotebookApp:()=>b,NotebookShell:()=>y,PanelHandler:()=>w,Private:()=>P,SidePanelHandler:()=>f,SidePanelPalette:()=>W,defaultNotebookPathOpener:()=>H});var n,s=i(40),a=i(151),r=i(950),d=i(448),o=i(571),l=i(797),h=i(188),p=i(697),g=i(930),u=i(901),c=i(882),_=i(801),m=i(633);class w{constructor(){this._panelChildHook=(e,t)=>{if("child-removed"===t.type){const e=t.child;p.ArrayExt.removeFirstWhere(this._items,(t=>t.widget===e))}return!0},this._items=new Array,this._panel=new c.Panel,m.MessageLoop.installMessageHook(this._panel,this._panelChildHook)}get panel(){return this._panel}addWidget(e,t){e.parent=null;const i={widget:e,rank:t},s=p.ArrayExt.upperBound(this._items,i,n.itemCmp);p.ArrayExt.insert(this._items,s,i),this._panel.insertWidget(s,e)}}class f extends w{constructor(e){super(),this._isHiddenByUser=!1,this._widgetAdded=new u.Signal(this),this._widgetRemoved=new u.Signal(this),this._area=e,this._panel.hide(),this._currentWidget=null,this._lastCurrentWidget=null,this._widgetPanel=new c.StackedPanel,this._widgetPanel.widgetRemoved.connect(this._onWidgetRemoved,this),this._closeButton=document.createElement("button"),_.closeIcon.element({container:this._closeButton,height:"16px",width:"auto"}),this._closeButton.onclick=()=>{this.collapse(),this.hide()},this._closeButton.className="jp-Button jp-SidePanel-collapse",this._closeButton.title="Collapse side panel";const t=new c.Widget({node:this._closeButton});this._panel.addWidget(t),this._panel.addWidget(this._widgetPanel)}get currentWidget(){return this._currentWidget||this._lastCurrentWidget||(this._items.length>0?this._items[0].widget:null)}get area(){return this._area}get isVisible(){return this._panel.isVisible}get panel(){return this._panel}get widgets(){return this._items.map((e=>e.widget))}get widgetAdded(){return this._widgetAdded}get widgetRemoved(){return this._widgetRemoved}get closeButton(){return this._closeButton}expand(e){e?this._currentWidget&&this._currentWidget.id===e?(this.collapse(),this.hide()):(this.collapse(),this.hide(),this.activate(e),this.show()):this.currentWidget&&(this._currentWidget=this.currentWidget,this.activate(this._currentWidget.id),this.show())}activate(e){const t=this._findWidgetByID(e);t&&(this._currentWidget=t,t.show(),t.activate())}has(e){return null!==this._findWidgetByID(e)}collapse(){var e;null===(e=this._currentWidget)||void 0===e||e.hide(),this._currentWidget=null}addWidget(e,t){e.parent=null,e.hide();const i={widget:e,rank:t},n=this._findInsertIndex(i);p.ArrayExt.insert(this._items,n,i),this._widgetPanel.insertWidget(n,e),this._refreshVisibility(),this._widgetAdded.emit(e)}hide(){this._isHiddenByUser=!0,this._refreshVisibility()}show(){this._isHiddenByUser=!1,this._refreshVisibility()}_findInsertIndex(e){return p.ArrayExt.upperBound(this._items,e,n.itemCmp)}_findWidgetIndex(e){return p.ArrayExt.findFirstIndex(this._items,(t=>t.widget===e))}_findWidgetByID(e){const t=(0,p.find)(this._items,(t=>t.widget.id===e));return t?t.widget:null}_refreshVisibility(){this._panel.setHidden(this._isHiddenByUser)}_onWidgetRemoved(e,t){t===this._lastCurrentWidget&&(this._lastCurrentWidget=null),p.ArrayExt.removeAt(this._items,this._findWidgetIndex(t)),this._refreshVisibility(),this._widgetRemoved.emit(t)}}class W{constructor(e){this._items=[],this._commandPalette=e.commandPalette,this._command=e.command}getItem(e,t){const i=this._items;for(let n=0;nt.id===e));i&&("left"===t?this.expandLeft(e):"right"===t?this.expandRight(e):"down"===t?(this._downPanel.show(),i.activate()):i.activate())}}add(e,t,i){var n,s;let a;a=(null==i?void 0:i.type)&&this._userLayout[i.type]?this._userLayout[i.type]:this._userLayout[e.id],t=null!==(n=null==a?void 0:a.area)&&void 0!==n?n:t;const r=null!==(s=null==(i=i||(null==a?void 0:a.options)?{...i,...null==a?void 0:a.options}:void 0)?void 0:i.rank)&&void 0!==s?s:900;switch(t){case"top":return this._topHandler.addWidget(e,r);case"menu":return this._menuHandler.addWidget(e,r);case"main":case void 0:{if(this._main.widgets.length>0)return;const t=this.currentWidget;this._main.addWidget(e),this._main.update(),this._currentChanged.emit({newValue:e,oldValue:t}),this._mainWidgetLoaded.resolve();break}case"left":return this._leftHandler.addWidget(e,r);case"right":return this._rightHandler.addWidget(e,r);case"down":return this._downPanel.addWidget(e);default:console.warn(`Cannot add widget to area: ${t}`)}}collapseTop(){this._topWrapper.setHidden(!0),this._spacer_top.setHidden(!0)}expandTop(){this._topWrapper.setHidden(!1),this._spacer_top.setHidden(!1)}*widgets(e){switch(null!=e?e:"main"){case"top":return void(yield*this._topHandler.panel.widgets);case"menu":return void(yield*this._menuHandler.panel.widgets);case"main":return void(yield*this._main.widgets);case"left":return void(yield*this._leftHandler.widgets);case"right":return void(yield*this._rightHandler.widgets);case"down":return void(yield*this._downPanel.widgets);default:return void console.error(`This shell has no area called "${e}"`)}}expandLeft(e){this._leftHandler.panel.show(),this._leftHandler.expand(e)}collapseLeft(){this._leftHandler.collapse(),this._leftHandler.panel.hide()}expandRight(e){this._rightHandler.panel.show(),this._rightHandler.expand(e)}collapseRight(){this._rightHandler.collapse(),this._rightHandler.panel.hide()}async restoreLayout(e){this._userLayout=e}_onTabPanelChanged(){0===this._downPanel.stackedPanel.widgets.length&&this._downPanel.hide()}}var P,v;!function(e){e.SkipLinkWidgetHandler=class{constructor(e){this._isDisposed=!1;const t=this._skipLinkWidget=new c.Widget,i=document.createElement("a");i.href="#first-cell",i.tabIndex=1,i.text="Skip to Main",i.className="skip-link",i.addEventListener("click",this),t.addClass("jp-skiplink"),t.id="jp-skiplink",t.node.appendChild(i)}handleEvent(e){"click"===e.type&&this._focusMain()}_focusMain(){const e=document.querySelector("#main-panel .jp-InputArea-editor");e.tabIndex=1,e.focus()}get skipLinkWidget(){return this._skipLinkWidget}dispose(){this.isDisposed||(this._isDisposed=!0,this._skipLinkWidget.node.removeEventListener("click",this),this._skipLinkWidget.dispose())}hide(){this._skipLinkWidget.hide()}show(){this._skipLinkWidget.show()}get isDisposed(){return this._isDisposed}}}(P||(P={}));class b extends s.JupyterFrontEnd{constructor(e={shell:new y}){var t,i;if(super({...e,shell:null!==(t=e.shell)&&void 0!==t?t:new y}),this.name="Jupyter Notebook",this.namespace=this.name,this.status=new d.J(this),this.version=null!==(i=o.PageConfig.getOption("appVersion"))&&void 0!==i?i:"unknown",this._info=s.JupyterLab.defaultInfo,this._formatter=new l.Throttler((()=>{v.setFormat(this)}),250),this.docRegistry.addModelFactory(new a.Base64ModelFactory),e.mimeExtensions)for(const t of(0,r.as)(e.mimeExtensions))this.registerPlugin(t);const n=Object.keys(s.JupyterLab.defaultInfo).reduce(((t,i)=>(i in e&&(t[i]=JSON.parse(JSON.stringify(e[i]))),t)),{});this._info={...s.JupyterLab.defaultInfo,...n},this.restored=this.shell.restored,this.restored.then((()=>this._formatter.invoke()))}get info(){return this._info}get paths(){return{urls:{base:o.PageConfig.getOption("baseUrl"),notFound:o.PageConfig.getOption("notFoundUrl"),app:o.PageConfig.getOption("appUrl"),static:o.PageConfig.getOption("staticUrl"),settings:o.PageConfig.getOption("settingsUrl"),themes:o.PageConfig.getOption("themesUrl"),doc:o.PageConfig.getOption("docUrl"),translations:o.PageConfig.getOption("translationsApiUrl"),hubHost:o.PageConfig.getOption("hubHost")||void 0,hubPrefix:o.PageConfig.getOption("hubPrefix")||void 0,hubUser:o.PageConfig.getOption("hubUser")||void 0,hubServerName:o.PageConfig.getOption("hubServerName")||void 0},directories:{appSettings:o.PageConfig.getOption("appSettingsDir"),schemas:o.PageConfig.getOption("schemasDir"),static:o.PageConfig.getOption("staticDir"),templates:o.PageConfig.getOption("templatesDir"),themes:o.PageConfig.getOption("themesDir"),userSettings:o.PageConfig.getOption("userSettingsDir"),serverRoot:o.PageConfig.getOption("serverRoot"),workspaces:o.PageConfig.getOption("workspacesDir")}}}handleEvent(e){super.handleEvent(e),"resize"===e.type&&this._formatter.invoke()}registerPluginModule(e){let t=e.default;Object.prototype.hasOwnProperty.call(e,"__esModule")||(t=e),Array.isArray(t)||(t=[t]),t.forEach((e=>{try{this.registerPlugin(e)}catch(e){console.error(e)}}))}registerPluginModules(e){e.forEach((e=>{this.registerPluginModule(e)}))}}!function(e){e.setFormat=function(e){e.format=window.matchMedia("only screen and (max-width: 760px)").matches?"mobile":"desktop"}}(v||(v={}));const H=new class{open(e){const{prefix:t,path:i,searchParams:n,target:s,features:a}=e,r=new URL(o.URLExt.join(t,null!=i?i:""),window.location.origin);return n&&(r.search=n.toString()),window.open(r,s,a)}},C=new g.Token("@jupyter-notebook/application:INotebookPathOpener")}}]); \ No newline at end of file diff --git a/emissary-ml/llm-scripts/fine-tuning/llama3/venv/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/568.4abd86605f9970bf2af0.js b/emissary-ml/llm-scripts/fine-tuning/llama3/venv/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/568.4abd86605f9970bf2af0.js new file mode 100644 index 0000000000000000000000000000000000000000..70f65f8cb3c1cc67b05a3ea903eebaf7c2dccf74 --- /dev/null +++ b/emissary-ml/llm-scripts/fine-tuning/llama3/venv/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/568.4abd86605f9970bf2af0.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_jupyter_notebook_lab_extension=self.webpackChunk_jupyter_notebook_lab_extension||[]).push([[568],{568:(e,o,t)=>{t.r(o),t.d(o,{default:()=>m});var n,a=t(40),r=t(780),c=t(571),l=t(474),i=t(188),s=t(882),b=t(343),d=t(801);!function(e){e.launchNotebookTree="jupyter-notebook:launch-tree",e.openNotebook="jupyter-notebook:open-notebook",e.openLab="jupyter-notebook:open-lab",e.openNbClassic="jupyter-notebook:open-nbclassic"}(n||(n={}));const u={id:"@jupyter-notebook/lab-extension:interface-switcher",description:"A plugin to add custom toolbar items to the notebook page.",autoStart:!0,requires:[i.ITranslator],optional:[l.INotebookTracker,r.ICommandPalette,b.INotebookPathOpener,b.INotebookShell,a.ILabShell,r.IToolbarWidgetRegistry],activate:(e,o,t,a,r,l,i,u)=>{if(!t)return;const{commands:m,shell:p}=e,k=c.PageConfig.getBaseUrl(),h=o.load("notebook"),_="true"===c.PageConfig.getOption("nbclassic_enabled"),g=new s.Menu({commands:m}),f=[],N=null!=r?r:b.defaultNotebookPathOpener;l||f.push({command:n.openNotebook,commandLabel:h.__("Notebook"),commandDescription:h.__("Open in %1","Jupyter Notebook"),buttonLabel:"openNotebook",urlPrefix:`${k}tree`}),i||f.push({command:n.openLab,commandLabel:h.__("JupyterLab"),commandDescription:h.__("Open in %1","JupyterLab"),buttonLabel:"openLab",urlPrefix:`${k}doc/tree`}),_&&f.push({command:n.openNbClassic,commandLabel:h.__("NbClassic"),commandDescription:h.__("Open in %1","NbClassic"),buttonLabel:"openNbClassic",urlPrefix:`${k}nbclassic/notebooks`});const y=()=>null!==t.currentWidget&&t.currentWidget===p.currentWidget;let C;if(f.forEach((e=>{const{command:o}=e;(e=>{const{command:o,commandLabel:n,commandDescription:r,urlPrefix:c}=e;m.addCommand(o,{label:e=>(e.noLabel,e.isMenu||e.isPalette?r:n),caption:n,execute:()=>{const e=t.currentWidget;e&&N.open({prefix:c,path:e.context.path})},isEnabled:y}),a&&a.addItem({command:o,category:"Other",args:{isPalette:!0}})})(e),g.addItem({command:o})})),1===f.length)C=e=>{const o=new d.CommandToolbarButton({commands:m,id:f[0].command,label:f[0].commandLabel,icon:d.launchIcon});return o.addClass("jp-nb-interface-switcher-button"),o};else{const e={overflowMenuOptions:{isVisible:!1}},o=new s.MenuBar(e);g.title.label=h.__("Open in..."),g.title.icon=d.caretDownIcon,o.addMenu(g),C=o=>{const t=new s.MenuBar(e);return t.addMenu(g),t.addClass("jp-InterfaceSwitcher"),t}}u&&u.addFactory("Notebook","interfaceSwitcher",C)}},m=[{id:"@jupyter-notebook/lab-extension:launch-tree",description:"A plugin to add a command to open the Jupyter Notebook Tree.",autoStart:!0,requires:[i.ITranslator],optional:[r.ICommandPalette],activate:(e,o,t)=>{const{commands:a}=e,r=o.load("notebook"),l=r.__("Help");a.addCommand(n.launchNotebookTree,{label:r.__("Launch Jupyter Notebook File Browser"),execute:()=>{const e=c.URLExt.join(c.PageConfig.getBaseUrl(),"tree");window.open(e)}}),t&&t.addItem({command:n.launchNotebookTree,category:l})}},u]}}]); \ No newline at end of file diff --git a/emissary-ml/llm-scripts/fine-tuning/llama3/venv/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/928.327ec9d7a9413375ec45.js b/emissary-ml/llm-scripts/fine-tuning/llama3/venv/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/928.327ec9d7a9413375ec45.js new file mode 100644 index 0000000000000000000000000000000000000000..d04ed409a0f51159733e10a80737f06a19f9435e --- /dev/null +++ b/emissary-ml/llm-scripts/fine-tuning/llama3/venv/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/928.327ec9d7a9413375ec45.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_jupyter_notebook_lab_extension=self.webpackChunk_jupyter_notebook_lab_extension||[]).push([[928],{950:(t,e,r)=>{r.d(e,{as:()=>p});var n=r(780),i=r(151),a=r(160),o=r(188),s=r(801),c=r(930),d=r(4);const u=new c.Token("@jupyterlab/application:ILayoutRestorer","A service providing application layout restoration functionality. Use this to have your activities restored across page loads.");var y;!function(t){function e(r){return r&&r.type?"tab-area"===r.type?{type:"tab-area",currentIndex:r.currentIndex,widgets:r.widgets.map((e=>t.nameProperty.get(e))).filter((t=>!!t))}:{type:"split-area",orientation:r.orientation,sizes:r.sizes,children:r.children.map(e).filter((t=>!!t))}:null}function r(t,e){if(!t)return null;const n=t.type||"unknown";if("unknown"===n||"tab-area"!==n&&"split-area"!==n)return console.warn(`Attempted to deserialize unknown type: ${n}`),null;if("tab-area"===n){const{currentIndex:r,widgets:n}=t,i={type:"tab-area",currentIndex:r||0,widgets:n&&n.map((t=>e.get(t))).filter((t=>!!t))||[]};return i.currentIndex>i.widgets.length-1&&(i.currentIndex=0),i}const{orientation:i,sizes:a,children:o}=t;return{type:"split-area",orientation:i,sizes:a||[],children:o&&o.map((t=>r(t,e))).filter((t=>!!t))||[]}}t.nameProperty=new d.AttachedProperty({name:"name",create:t=>""}),t.serializeMain=function(r){const n={dock:r&&r.dock&&e(r.dock.main)||null};if(r&&r.currentWidget){const e=t.nameProperty.get(r.currentWidget);e&&(n.current=e)}return n},t.deserializeMain=function(t,e){if(!t)return null;const n=t.current||null,i=t.dock||null;return{currentWidget:n&&e.has(n)&&e.get(n)||null,dock:i?{main:r(i,e)}:null}}}(y||(y={}));const l=new c.Token("@jupyterlab/application:IMimeDocumentTracker","A widget tracker for documents rendered using a mime renderer extension. Use this if you want to list and interact with documents rendered by such extensions.");function p(t){const e=[],r=new n.WidgetTracker({namespace:"application-mimedocuments"});return t.forEach((t=>{let n=t.default;t.hasOwnProperty("__esModule")||(n=t),Array.isArray(n)||(n=[n]),n.forEach((t=>{e.push(function(t,e){return{id:e.id,description:e.description,requires:[a.IRenderMimeRegistry,o.ITranslator],autoStart:!0,activate:(r,n,a)=>{if(void 0!==e.rank?n.addFactory(e.rendererFactory,e.rank):n.addFactory(e.rendererFactory),!e.documentWidgetFactoryOptions)return;const o=r.docRegistry;let c=[];c=Array.isArray(e.documentWidgetFactoryOptions)?e.documentWidgetFactoryOptions:[e.documentWidgetFactoryOptions],e.fileTypes&&e.fileTypes.forEach((t=>{t.icon&&(t={...t,icon:s.LabIcon.resolve({icon:t.icon})}),r.docRegistry.addFileType(t)})),c.forEach((r=>{const s=r.toolbarFactory?t=>r.toolbarFactory(t.content.renderer):void 0,c=new i.MimeDocumentFactory({renderTimeout:e.renderTimeout,dataType:e.dataType,rendermime:n,modelName:r.modelName,name:r.name,primaryFileType:o.getFileType(r.primaryFileType),fileTypes:r.fileTypes,defaultFor:r.defaultFor,defaultRendered:r.defaultRendered,toolbarFactory:s,translator:a,factory:e.rendererFactory});o.addWidgetFactory(c),c.widgetCreated.connect(((e,r)=>{m.factoryNameProperty.set(r,c.name),r.context.pathChanged.connect((()=>{t.save(r)})),t.add(r)}))}))}}}(r,t))}))})),e.push({id:"@jupyterlab/application-extension:mimedocument",description:"Provides a mime document widget tracker.",optional:[u],provides:l,autoStart:!0,activate:(t,e)=>(e&&e.restore(r,{command:"docmanager:open",args:t=>({path:t.context.path,factory:m.factoryNameProperty.get(t)}),name:t=>`${t.context.path}:${m.factoryNameProperty.get(t)}`}),r)}),e}var m;!function(t){t.factoryNameProperty=new d.AttachedProperty({name:"factoryName",create:()=>{}})}(m||(m={}))},448:(t,e,r)=>{r.d(e,{J:()=>a});var n=r(717),i=r(901);class a{constructor(t){this._busyCount=0,this._dirtyCount=0,this._busySignal=new i.Signal(t),this._dirtySignal=new i.Signal(t)}get busySignal(){return this._busySignal}get dirtySignal(){return this._dirtySignal}get isBusy(){return this._busyCount>0}get isDirty(){return this._dirtyCount>0}setDirty(){const t=this.isDirty;return this._dirtyCount++,this.isDirty!==t&&this._dirtySignal.emit(this.isDirty),new n.DisposableDelegate((()=>{const t=this.isDirty;this._dirtyCount=Math.max(0,this._dirtyCount-1),this.isDirty!==t&&this._dirtySignal.emit(this.isDirty)}))}setBusy(){const t=this.isBusy;return this._busyCount++,this.isBusy!==t&&this._busySignal.emit(this.isBusy),new n.DisposableDelegate((()=>{const t=this.isBusy;this._busyCount--,this.isBusy!==t&&this._busySignal.emit(this.isBusy)}))}}}}]); \ No newline at end of file diff --git a/emissary-ml/llm-scripts/fine-tuning/llama3/venv/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/93.eae3497dd223d842d198.js b/emissary-ml/llm-scripts/fine-tuning/llama3/venv/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/93.eae3497dd223d842d198.js new file mode 100644 index 0000000000000000000000000000000000000000..0580b73a7c09f9f441524857bc7f5943e338c6ea --- /dev/null +++ b/emissary-ml/llm-scripts/fine-tuning/llama3/venv/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/93.eae3497dd223d842d198.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_jupyter_notebook_lab_extension=self.webpackChunk_jupyter_notebook_lab_extension||[]).push([[93],{122:(e,n,t)=>{t.d(n,{Z:()=>c});var r=t(961),o=t.n(r),a=t(242),i=t.n(a)()(o());i.push([e.id,"/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n.jp-InterfaceSwitcher {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n}\n\n.jp-InterfaceSwitcher .lm-MenuBar-itemIcon svg {\n vertical-align: sub;\n}\n\n.jp-nb-interface-switcher-button > .jp-ToolbarButtonComponent::part(content) {\n flex-direction: row-reverse;\n}\n\n.jp-nb-interface-switcher-button > .jp-ToolbarButtonComponent > svg {\n padding-left: 3px;\n}\n",""]);const c=i},242:e=>{e.exports=function(e){var n=[];return n.toString=function(){return this.map((function(n){var t="",r=void 0!==n[5];return n[4]&&(t+="@supports (".concat(n[4],") {")),n[2]&&(t+="@media ".concat(n[2]," {")),r&&(t+="@layer".concat(n[5].length>0?" ".concat(n[5]):""," {")),t+=e(n),r&&(t+="}"),n[2]&&(t+="}"),n[4]&&(t+="}"),t})).join("")},n.i=function(e,t,r,o,a){"string"==typeof e&&(e=[[null,e,void 0]]);var i={};if(r)for(var c=0;c0?" ".concat(p[5]):""," {").concat(p[1],"}")),p[5]=a),t&&(p[2]?(p[1]="@media ".concat(p[2]," {").concat(p[1],"}"),p[2]=t):p[2]=t),o&&(p[4]?(p[1]="@supports (".concat(p[4],") {").concat(p[1],"}"),p[4]=o):p[4]="".concat(o)),n.push(p))}},n}},961:e=>{e.exports=function(e){return e[1]}},398:e=>{var n=[];function t(e){for(var t=-1,r=0;r{var n={};e.exports=function(e,t){var r=function(e){if(void 0===n[e]){var t=document.querySelector(e);if(window.HTMLIFrameElement&&t instanceof window.HTMLIFrameElement)try{t=t.contentDocument.head}catch(e){t=null}n[e]=t}return n[e]}(e);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(t)}},133:e=>{e.exports=function(e){var n=document.createElement("style");return e.setAttributes(n,e.attributes),e.insert(n,e.options),n}},826:(e,n,t)=>{e.exports=function(e){var n=t.nc;n&&e.setAttribute("nonce",n)}},608:e=>{e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var n=e.insertStyleElement(e);return{update:function(t){!function(e,n,t){var r="";t.supports&&(r+="@supports (".concat(t.supports,") {")),t.media&&(r+="@media ".concat(t.media," {"));var o=void 0!==t.layer;o&&(r+="@layer".concat(t.layer.length>0?" ".concat(t.layer):""," {")),r+=t.css,o&&(r+="}"),t.media&&(r+="}"),t.supports&&(r+="}");var a=t.sourceMap;a&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(a))))," */")),n.styleTagTransform(r,e,n.options)}(n,e,t)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(n)}}}},51:e=>{e.exports=function(e,n){if(n.styleSheet)n.styleSheet.cssText=e;else{for(;n.firstChild;)n.removeChild(n.firstChild);n.appendChild(document.createTextNode(e))}}},93:(e,n,t)=>{t.r(n);var r=t(398),o=t.n(r),a=t(608),i=t.n(a),c=t(955),s=t.n(c),u=t(826),p=t.n(u),l=t(133),f=t.n(l),d=t(51),v=t.n(d),m=t(122),h={};h.styleTagTransform=v(),h.setAttributes=p(),h.insert=s().bind(null,"head"),h.domAPI=i(),h.insertStyleElement=f(),o()(m.Z,h),m.Z&&m.Z.locals&&m.Z.locals}}]); \ No newline at end of file diff --git a/emissary-ml/llm-scripts/fine-tuning/llama3/venv/share/jupyter/labextensions/jupyterlab-plotly/install.json b/emissary-ml/llm-scripts/fine-tuning/llama3/venv/share/jupyter/labextensions/jupyterlab-plotly/install.json new file mode 100644 index 0000000000000000000000000000000000000000..556c5ebc7902957f507877cef8f35bc372fd98ef --- /dev/null +++ b/emissary-ml/llm-scripts/fine-tuning/llama3/venv/share/jupyter/labextensions/jupyterlab-plotly/install.json @@ -0,0 +1,9 @@ +{ + "schemaVersion": 1, + "name": "jupyterlab-plotly", + "version": "6.0.1", + "jupyterlab": { + "mimeExtension": "lib/mimeExtension.js" + } +} + \ No newline at end of file diff --git a/emissary-ml/llm-scripts/fine-tuning/llama3/venv/share/jupyter/labextensions/jupyterlab-plotly/static/340.2a23c8275d47a2531dae.js b/emissary-ml/llm-scripts/fine-tuning/llama3/venv/share/jupyter/labextensions/jupyterlab-plotly/static/340.2a23c8275d47a2531dae.js new file mode 100644 index 0000000000000000000000000000000000000000..d763c0743d66d10186d2f05ed3298b8d82a7bc18 --- /dev/null +++ b/emissary-ml/llm-scripts/fine-tuning/llama3/venv/share/jupyter/labextensions/jupyterlab-plotly/static/340.2a23c8275d47a2531dae.js @@ -0,0 +1,2 @@ +/*! For license information please see 340.2a23c8275d47a2531dae.js.LICENSE.txt */ +(self.webpackChunkjupyterlab_plotly=self.webpackChunkjupyterlab_plotly||[]).push([[340],{340:(t,e,r)=>{"use strict";r.r(e),r.d(e,{MIME_TYPE:()=>Ht,RenderedPlotly:()=>Gt,default:()=>Zt,rendererFactory:()=>Wt});var n,i,a,o,s,l,c=r(606),u=Object.create,h=Object.defineProperty,p=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,d=Object.getPrototypeOf,m=Object.prototype.hasOwnProperty,g=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),y=(t,e,r)=>(r=null!=t?u(d(t)):{},((t,e,r,n)=>{if(e&&"object"==typeof e||"function"==typeof e)for(let r of f(e))!m.call(t,r)&&undefined!==r&&h(t,r,{get:()=>e[r],enumerable:!(n=p(e,r))||n.enumerable});return t})(!e&&t&&t.__esModule?r:h(r,"default",{value:t,enumerable:!0}),t)),v=g(((t,e)=>{var n,i;n=t,i=function(t){function e(t,e){let r=0;for(let n of t)if(!1===e(n,r++))return!1;return!0}var r;t.ArrayExt=void 0,function(t){function e(t,e,r=0,n=-1){let i,a=t.length;if(0===a)return-1;r=r<0?Math.max(0,r+a):Math.min(r,a-1),i=(n=n<0?Math.max(0,n+a):Math.min(n,a-1))=r)return;let n=t[e];for(let n=e+1;n0;){let n=s>>1,i=o+n;r(t[i],e)<0?(o=i+1,s-=n+1):s=n}return o},t.upperBound=function(t,e,r,n=0,i=-1){let a=t.length;if(0===a)return 0;let o=n=n<0?Math.max(0,n+a):Math.min(n,a-1),s=(i=i<0?Math.max(0,i+a):Math.min(i,a-1))-n+1;for(;s>0;){let n=s>>1,i=o+n;r(t[i],e)>0?s=n:(o=i+1,s-=n+1)}return o},t.shallowEqual=function(t,e,r){if(t===e)return!0;if(t.length!==e.length)return!1;for(let n=0,i=t.length;n=o&&(r=i<0?o-1:o),void 0===n?n=i<0?-1:o:n<0?n=Math.max(n+o,i<0?-1:0):n>=o&&(n=i<0?o-1:o),a=i<0&&n>=r||i>0&&r>=n?0:i<0?Math.floor((n-r+1)/i+1):Math.floor((n-r-1)/i+1);let s=[];for(let e=0;e=(n=n<0?Math.max(0,n+i):Math.min(n,i-1)))return;let o=n-r+1;if(e>0?e%=o:e<0&&(e=(e%o+o)%o),0===e)return;let s=r+e;a(t,r,s-1),a(t,s,n),a(t,r,n)},t.fill=function(t,e,r=0,n=-1){let i,a=t.length;if(0!==a){r=r<0?Math.max(0,r+a):Math.min(r,a-1),i=(n=n<0?Math.max(0,n+a):Math.min(n,a-1))e;--r)t[r]=t[r-1];t[e]=r},t.removeAt=o,t.removeFirstOf=function(t,r,n=0,i=-1){let a=e(t,r,n,i);return-1!==a&&o(t,a),a},t.removeLastOf=function(t,e,n=-1,i=0){let a=r(t,e,n,i);return-1!==a&&o(t,a),a},t.removeAllOf=function(t,e,r=0,n=-1){let i=t.length;if(0===i)return 0;r=r<0?Math.max(0,r+i):Math.min(r,i-1),n=n<0?Math.max(0,n+i):Math.min(n,i-1);let a=0;for(let o=0;o=r&&o<=n&&t[o]===e||n=r)&&t[o]===e?a++:a>0&&(t[o-a]=t[o]);return a>0&&(t.length=i-a),a},t.removeFirstWhere=function(t,e,r=0,i=-1){let a,s=n(t,e,r,i);return-1!==s&&(a=o(t,s)),{index:s,value:a}},t.removeLastWhere=function(t,e,r=-1,n=0){let a,s=i(t,e,r,n);return-1!==s&&(a=o(t,s)),{index:s,value:a}},t.removeAllWhere=function(t,e,r=0,n=-1){let i=t.length;if(0===i)return 0;r=r<0?Math.max(0,r+i):Math.min(r,i-1),n=n<0?Math.max(0,n+i):Math.min(n,i-1);let a=0;for(let o=0;o=r&&o<=n&&e(t[o],o)||n=r)&&e(t[o],o)?a++:a>0&&(t[o-a]=t[o]);return a>0&&(t.length=i-a),a}}(t.ArrayExt||(t.ArrayExt={})),(r||(r={})).rangeLength=function(t,e,r){return 0===r?1/0:t>e&&r>0||te?1:0}}(t.StringExt||(t.StringExt={})),t.chain=function*(...t){for(let e of t)yield*e},t.each=function(t,e){let r=0;for(let n of t)if(!1===e(n,r++))return},t.empty=function*(){},t.enumerate=function*(t,e=0){for(let r of t)yield[e++,r]},t.every=e,t.filter=function*(t,e){let r=0;for(let n of t)e(n,r++)&&(yield n)},t.find=function(t,e){let r=0;for(let n of t)if(e(n,r++))return n},t.findIndex=function(t,e){let r=0;for(let n of t)if(e(n,r++))return r-1;return-1},t.map=function*(t,e){let r=0;for(let n of t)yield e(n,r++)},t.max=function(t,e){let r;for(let n of t)void 0!==r?e(n,r)>0&&(r=n):r=n;return r},t.min=function(t,e){let r;for(let n of t)void 0!==r?e(n,r)<0&&(r=n):r=n;return r},t.minmax=function(t,e){let r,n,i=!0;for(let a of t)i?(r=a,n=a,i=!1):e(a,r)<0?r=a:e(a,n)>0&&(n=a);return i?void 0:[r,n]},t.once=function*(t){yield t},t.range=function*(t,e,n){void 0===e?(e=t,t=0,n=1):void 0===n&&(n=1);let i=r.rangeLength(t,e,n);for(let e=0;e-1;e--)yield t[e]},t.some=function(t,e){let r=0;for(let n of t)if(e(n,r++))return!0;return!1},t.stride=function*(t,e){let r=0;for(let n of t)r++%e==0&&(yield n)},t.take=function*(t,e){if(e<1)return;let r,n=t[Symbol.iterator]();for(;0t[Symbol.iterator]())),n=r.map((t=>t.next()));for(;e(n,(t=>!t.done));n=r.map((t=>t.next())))yield n.map((t=>t.value))}},"object"==typeof t&&typeof e<"u"?i(t):"function"==typeof define&&r.amdO?define(["exports"],i):i((n=typeof globalThis<"u"?globalThis:n||self).lumino_algorithm={})})),x=g(((t,e)=>{var n,i;n=t,i=function(t,e){var r;function n(t){let e=0;for(let r=0,n=t.length;r>>0),t[r]=255&e,e>>>=8}t.JSONExt=void 0,function(t){function e(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t}function r(t){return Array.isArray(t)}t.emptyObject=Object.freeze({}),t.emptyArray=Object.freeze([]),t.isPrimitive=e,t.isArray=r,t.isObject=function(t){return!e(t)&&!r(t)},t.deepEqual=function t(n,i){if(n===i)return!0;if(e(n)||e(i))return!1;let a=r(n),o=r(i);return a===o&&(a&&o?function(e,r){if(e===r)return!0;if(e.length!==r.length)return!1;for(let n=0,i=e.length;n{if(n===t.provides)return!0;let o=r.get(n);if(!o)return!1;let s=e.get(o),l=[...s.requires,...s.optional];return 0!==l.length&&(a.push(o),!!l.some(i)||(a.pop(),!1))};if(!t.provides||0===n.length)return;let a=[t.id];if(n.some(i))throw new ReferenceError(`Cycle detected: ${a.join(" -> ")}.`)},t.findDependents=function(t,r,n){let i=new Array,a=t=>{let e=r.get(t),a=[...e.requires,...e.optional];i.push(...a.reduce(((e,r)=>{let i=n.get(r);return i&&e.push([t,i]),e}),[]))};for(let t of r.keys())a(t);let o=i.filter((e=>e[1]===t)),s=0;for(;o.length>s;){let t=o.length,e=new Set(o.map((t=>t[0])));for(let t of e)i.filter((e=>e[1]===t)).forEach((t=>{o.includes(t)||o.push(t)}));s=t}let l=e.topologicSort(o),c=l.findIndex((e=>e===t));return-1===c?[t]:l.slice(0,c+1)},t.collectStartupPlugins=function(t,e){let r=new Set;for(let e of t.keys())!0===t.get(e).autoStart&&r.add(e);if(e.startPlugins)for(let t of e.startPlugins)r.add(t);if(e.ignorePlugins)for(let t of e.ignorePlugins)r.delete(t);return Array.from(r)}}(r||(r={})),t.Random=void 0,(t.Random||(t.Random={})).getRandomValues=(()=>{let t=typeof window<"u"&&(window.crypto||window.msCrypto)||null;return t&&"function"==typeof t.getRandomValues?function(e){return t.getRandomValues(e)}:n})(),t.UUID=void 0,(t.UUID||(t.UUID={})).uuid4=function(t){let e=new Uint8Array(16),r=new Array(256);for(let t=0;t<16;++t)r[t]="0"+t.toString(16);for(let t=16;t<256;++t)r[t]=t.toString(16);return function(){return t(e),e[6]=64|15&e[6],e[8]=128|63&e[8],r[e[0]]+r[e[1]]+r[e[2]]+r[e[3]]+"-"+r[e[4]]+r[e[5]]+"-"+r[e[6]]+r[e[7]]+"-"+r[e[8]]+r[e[9]]+"-"+r[e[10]]+r[e[11]]+r[e[12]]+r[e[13]]+r[e[14]]+r[e[15]]}}(t.Random.getRandomValues),t.MimeData=class{constructor(){this._types=[],this._values=[]}types(){return this._types.slice()}hasData(t){return-1!==this._types.indexOf(t)}getData(t){let e=this._types.indexOf(t);return-1!==e?this._values[e]:void 0}setData(t,e){this.clearData(t),this._types.push(t),this._values.push(e)}clearData(t){let e=this._types.indexOf(t);-1!==e&&(this._types.splice(e,1),this._values.splice(e,1))}clear(){this._types.length=0,this._values.length=0}},t.PluginRegistry=class{constructor(t={}){this._application=null,this._validatePlugin=()=>!0,this._plugins=new Map,this._services=new Map,t.validatePlugin&&(console.info("Plugins may be rejected by the custom validation plugin method."),this._validatePlugin=t.validatePlugin)}get application(){return this._application}set application(t){if(null!==this._application)throw Error("PluginRegistry.application is already set. It cannot be overridden.");this._application=t}get deferredPlugins(){return Array.from(this._plugins).filter((([t,e])=>"defer"===e.autoStart)).map((([t,e])=>t))}getPluginDescription(t){var e,r;return null!==(r=null===(e=this._plugins.get(t))||void 0===e?void 0:e.description)&&void 0!==r?r:""}hasPlugin(t){return this._plugins.has(t)}isPluginActivated(t){var e,r;return null!==(r=null===(e=this._plugins.get(t))||void 0===e?void 0:e.activated)&&void 0!==r&&r}listPlugins(){return Array.from(this._plugins.keys())}registerPlugin(t){if(this._plugins.has(t.id))throw new TypeError(`Plugin '${t.id}' is already registered.`);if(!this._validatePlugin(t))throw new Error(`Plugin '${t.id}' is not valid.`);let e=r.createPluginData(t);r.ensureNoCycle(e,this._plugins,this._services),e.provides&&this._services.set(e.provides,e.id),this._plugins.set(e.id,e)}registerPlugins(t){for(let e of t)this.registerPlugin(e)}deregisterPlugin(t,e){let r=this._plugins.get(t);if(r){if(r.activated&&!e)throw new Error(`Plugin '${t}' is still active.`);this._plugins.delete(t)}}async activatePlugin(t){let e=this._plugins.get(t);if(!e)throw new ReferenceError(`Plugin '${t}' is not registered.`);if(e.activated)return;if(e.promise)return e.promise;let r=e.requires.map((t=>this.resolveRequiredService(t))),n=e.optional.map((t=>this.resolveOptionalService(t)));return e.promise=Promise.all([...r,...n]).then((t=>e.activate.apply(void 0,[this.application,...t]))).then((t=>{e.service=t,e.activated=!0,e.promise=null})).catch((t=>{throw e.promise=null,t})),e.promise}async activatePlugins(t,e={}){switch(t){case"defer":{let t=this.deferredPlugins.filter((t=>this._plugins.get(t).autoStart)).map((t=>this.activatePlugin(t)));await Promise.all(t);break}case"startUp":{let t=r.collectStartupPlugins(this._plugins,e).map((async t=>{try{return await this.activatePlugin(t)}catch(e){console.error(`Plugin '${t}' failed to activate.`,e)}}));await Promise.all(t);break}}}async deactivatePlugin(t){let e=this._plugins.get(t);if(!e)throw new ReferenceError(`Plugin '${t}' is not registered.`);if(!e.activated)return[];if(!e.deactivate)throw new TypeError(`Plugin '${t}'#deactivate() method missing`);let n=r.findDependents(t,this._plugins,this._services),i=n.map((t=>this._plugins.get(t)));for(let e of i)if(!e.deactivate)throw new TypeError(`Plugin ${e.id}#deactivate() method missing (depends on ${t})`);for(let t of i){let e=[...t.requires,...t.optional].map((t=>{let e=this._services.get(t);return e?this._plugins.get(e).service:null}));await t.deactivate(this.application,...e),t.service=null,t.activated=!1}return n.pop(),n}async resolveRequiredService(t){let e=this._services.get(t);if(!e)throw new TypeError(`No provider for: ${t.name}.`);let r=this._plugins.get(e);return r.activated||await this.activatePlugin(e),r.service}async resolveOptionalService(t){let e=this._services.get(t);if(!e)return null;let r=this._plugins.get(e);if(!r.activated)try{await this.activatePlugin(e)}catch(t){return console.error(t),null}return r.service}},t.PromiseDelegate=class{constructor(){this.promise=new Promise(((t,e)=>{this._resolve=t,this._reject=e}))}resolve(t){(0,this._resolve)(t)}reject(t){(0,this._reject)(t)}},t.Token=class{constructor(t,e){this.name=t,this.description=e??"",this._tokenStructuralPropertyT=null}}},"object"==typeof t&&typeof e<"u"?i(t,v()):"function"==typeof define&&r.amdO?define(["exports","@lumino/algorithm"],i):i((n=typeof globalThis<"u"?globalThis:n||self).lumino_coreutils={},n.lumino_algorithm)})),_=g(((t,e)=>{var r,n;r=typeof self<"u"?self:t,n=()=>{var t=(()=>{var t=Object.create,e=Object.defineProperty,r=Object.defineProperties,n=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyDescriptors,a=Object.getOwnPropertyNames,o=Object.getOwnPropertySymbols,s=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable,h=(t,r,n)=>r in t?e(t,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[r]=n,p=(t,e)=>function(){return t&&(e=(0,t[a(t)[0]])(t=0)),e},f=(t,e)=>function(){return e||(0,t[a(t)[0]])((e={exports:{}}).exports,e),e.exports},d=(t,r)=>{for(var n in r)e(t,n,{get:r[n],enumerable:!0})},m=(t,r,i,o)=>{if(r&&"object"==typeof r||"function"==typeof r)for(let s of a(r))!l.call(t,s)&&s!==i&&e(t,s,{get:()=>r[s],enumerable:!(o=n(r,s))||o.enumerable});return t},g=t=>m(e({},"__esModule",{value:!0}),t),y=f({"src/version.js"(t){t.version="3.0.1"}}),v=f({"node_modules/native-promise-only/lib/npo.src.js"(t,e){var r,n;r="Promise",(n=typeof window<"u"?window:t)[r]=n[r]||function(){var t,e,r,n=Object.prototype.toString,i=typeof setImmediate<"u"?function(t){return setImmediate(t)}:setTimeout;try{Object.defineProperty({},"x",{}),t=function(t,e,r,n){return Object.defineProperty(t,e,{value:r,writable:!0,configurable:!1!==n})}}catch{t=function(t,e,r){return t[e]=r,t}}function a(t,n){r.add(t,n),e||(e=i(r.drain))}function o(t){var e,r=typeof t;return null!=t&&("object"==r||"function"==r)&&(e=t.then),"function"==typeof e&&e}function s(){for(var t=0;t0&&a(s,r))}catch(t){u.call(new p(r),t)}}}function u(t){var e=this;e.triggered||(e.triggered=!0,e.def&&(e=e.def),e.msg=t,e.state=2,e.chain.length>0&&a(s,e))}function h(t,e,r,n){for(var i=0;ie?1:t>=e?0:NaN}function f(t){return null===t?NaN:+t}function d(t){return!isNaN(t)}function m(t){return{left:function(e,r,n,i){for(arguments.length<3&&(n=0),arguments.length<4&&(i=e.length);n>>1;t(e[a],r)<0?n=a+1:i=a}return n},right:function(e,r,n,i){for(arguments.length<3&&(n=0),arguments.length<4&&(i=e.length);n>>1;t(e[a],r)>0?i=a:n=a+1}return n}}}t.ascending=p,t.descending=function(t,e){return et?1:e>=t?0:NaN},t.min=function(t,e){var r,n,i=-1,a=t.length;if(1===arguments.length){for(;++i=n){r=n;break}for(;++in&&(r=n)}else{for(;++i=n){r=n;break}for(;++in&&(r=n)}return r},t.max=function(t,e){var r,n,i=-1,a=t.length;if(1===arguments.length){for(;++i=n){r=n;break}for(;++ir&&(r=n)}else{for(;++i=n){r=n;break}for(;++ir&&(r=n)}return r},t.extent=function(t,e){var r,n,i,a=-1,o=t.length;if(1===arguments.length){for(;++a=n){r=i=n;break}for(;++an&&(r=n),i=n){r=i=n;break}for(;++an&&(r=n),i1)return o/(l-1)},t.deviation=function(){var e=t.variance.apply(this,arguments);return e&&Math.sqrt(e)};var g=m(p);function y(t){return t.length}t.bisectLeft=g.left,t.bisect=t.bisectRight=g.right,t.bisector=function(t){return m(1===t.length?function(e,r){return p(t(e),r)}:t)},t.shuffle=function(t,e,r){(a=arguments.length)<3&&(r=t.length,a<2&&(e=0));for(var n,i,a=r-e;a;)i=Math.random()*a--|0,n=t[a+e],t[a+e]=t[i+e],t[i+e]=n;return t},t.permute=function(t,e){for(var r=e.length,n=new Array(r);r--;)n[r]=t[e[r]];return n},t.pairs=function(t){for(var e=0,r=t.length-1,n=t[0],i=new Array(r<0?0:r);e=0;)for(e=(n=t[i]).length;--e>=0;)r[--o]=n[e];return r};var v=Math.abs;function x(t,e){for(var r in e)Object.defineProperty(t.prototype,r,{value:e[r],enumerable:!1})}function _(){this._=Object.create(null)}function b(t){return"__proto__"==(t+="")||"\0"===t[0]?"\0"+t:t}function w(t){return"\0"===(t+="")[0]?t.slice(1):t}function T(t){return b(t)in this._}function A(t){return(t=b(t))in this._&&delete this._[t]}function k(){var t=[];for(var e in this._)t.push(w(e));return t}function M(){var t=0;for(var e in this._)++t;return t}function S(){for(var t in this._)return!1;return!0}function E(){this._=Object.create(null)}function C(t){return t}function I(t,e,r){return function(){var n=r.apply(e,arguments);return n===e?t:n}}function L(t,e){if(e in t)return e;e=e.charAt(0).toUpperCase()+e.slice(1);for(var r=0,n=P.length;re;)i.push(n/a);else for(;(n=t+r*++o)=i.length)return r?r.call(n,a):e?a.sort(e):a;for(var l,c,u,h,p=-1,f=a.length,d=i[s++],m=new _;++p=i.length)return t;var r=[],n=a[e++];return t.forEach((function(t,n){r.push({key:t,values:s(n,e)})})),n?r.sort((function(t,e){return n(t.key,e.key)})):r}return n.map=function(t,e){return o(e,t,0)},n.entries=function(e){return s(o(t.map,e,0),0)},n.key=function(t){return i.push(t),n},n.sortKeys=function(t){return a[i.length-1]=t,n},n.sortValues=function(t){return e=t,n},n.rollup=function(t){return r=t,n},n},t.set=function(t){var e=new E;if(t)for(var r=0,n=t.length;r=0&&(n=t.slice(r+1),t=t.slice(0,r)),t)return arguments.length<2?this[t].on(n):this[t].on(n,e);if(2===arguments.length){if(null==e)for(t in this)this.hasOwnProperty(t)&&this[t].on(n,null);return this}},t.event=null,t.requote=function(t){return t.replace(j,"\\$&")};var j=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,N={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)t[r]=e[r]};function U(t){return N(t,G),t}var V=function(t,e){return e.querySelector(t)},q=function(t,e){return e.querySelectorAll(t)},H=function(t,e){var r=t.matches||t[L(t,"matchesSelector")];return(H=function(t,e){return r.call(t,e)})(t,e)};"function"==typeof Sizzle&&(V=function(t,e){return Sizzle(t,e)[0]||null},q=Sizzle,H=Sizzle.matchesSelector),t.selection=function(){return t.select(i.documentElement)};var G=t.selection.prototype=[];function W(t){return"function"==typeof t?t:function(){return V(t,this)}}function Z(t){return"function"==typeof t?t:function(){return q(t,this)}}G.select=function(t){var e,r,n,i,a=[];t=W(t);for(var o=-1,s=this.length;++o=0&&"xmlns"!==(r=t.slice(0,e))&&(t=t.slice(e+1)),X.hasOwnProperty(r)?{space:X[r],local:t}:t}},G.attr=function(e,r){if(arguments.length<2){if("string"==typeof e){var n=this.node();return(e=t.ns.qualify(e)).local?n.getAttributeNS(e.space,e.local):n.getAttribute(e)}for(r in e)this.each($(r,e[r]));return this}return this.each($(e,r))},G.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node(),n=(t=Q(t)).length,i=-1;if(e=r.classList){for(;++i=0;)(r=n[i])&&(a&&a!==r.nextSibling&&a.parentNode.insertBefore(r,a),a=r);return this},G.sort=function(t){t=lt.apply(this,arguments);for(var e=-1,r=this.length;++e0&&(e=e.slice(0,o));var l=ft.get(e);function c(){var t=this[a];t&&(this.removeEventListener(e,t,t.$),delete this[a])}return l&&(e=l,s=mt),o?r?function(){var t=s(r,n(arguments));c.call(this),this.addEventListener(e,this[a]=t,t.$=i),t._=r}:c:r?z:function(){var r,n=new RegExp("^__on([^.]+)"+t.requote(e)+"$");for(var i in this)if(r=i.match(n)){var a=this[i];this.removeEventListener(r[1],a,a.$),delete this[i]}}}t.selection.enter=ut,t.selection.enter.prototype=ht,ht.append=G.append,ht.empty=G.empty,ht.node=G.node,ht.call=G.call,ht.size=G.size,ht.select=function(t){for(var e,r,n,i,a,o=[],s=-1,l=this.length;++s=e&&(e=i+1);!(o=s[e])&&++e1?Mt:t<-1?-Mt:Math.asin(t)}function Lt(t){return((t=Math.exp(t))+1/t)/2}var Pt=Math.SQRT2;t.interpolateZoom=function(t,e){var r,n,i=t[0],a=t[1],o=t[2],s=e[0],l=e[1],c=e[2],u=s-i,h=l-a,p=u*u+h*h;if(p<1e-12)n=Math.log(c/o)/Pt,r=function(t){return[i+t*u,a+t*h,o*Math.exp(Pt*t*n)]};else{var f=Math.sqrt(p),d=(c*c-o*o+4*p)/(2*o*2*f),m=(c*c-o*o-4*p)/(2*c*2*f),g=Math.log(Math.sqrt(d*d+1)-d),y=Math.log(Math.sqrt(m*m+1)-m);n=(y-g)/Pt,r=function(t){var e=t*n,r=Lt(g),s=o/(2*f)*(r*function(t){return((t=Math.exp(2*t))-1)/(t+1)}(Pt*e+g)-function(t){return((t=Math.exp(t))-1/t)/2}(g));return[i+s*u,a+s*h,o*r/Lt(Pt*e+g)]}}return r.duration=1e3*n,r},t.behavior.zoom=function(){var e,r,n,a,s,l,c,u,h,p={x:0,y:0,k:1},f=[960,500],d=Ot,m=250,g=0,y="mousedown.zoom",v="mousemove.zoom",x="mouseup.zoom",_="touchstart.zoom",b=B(w,"zoomstart","zoom","zoomend");function w(t){t.on(y,L).on(Dt+".zoom",z).on("dblclick.zoom",D).on(_,P)}function T(t){return[(t[0]-p.x)/p.k,(t[1]-p.y)/p.k]}function A(t){p.k=Math.max(d[0],Math.min(d[1],t))}function k(t,e){e=function(t){return[t[0]*p.k+p.x,t[1]*p.k+p.y]}(e),p.x+=t[0]-e[0],p.y+=t[1]-e[1]}function M(e,n,i,a){e.__chart__={x:p.x,y:p.y,k:p.k},A(Math.pow(2,a)),k(r=n,i),e=t.select(e),m>0&&(e=e.transition().duration(m)),e.call(w.event)}function S(){c&&c.domain(l.range().map((function(t){return(t-p.x)/p.k})).map(l.invert)),h&&h.domain(u.range().map((function(t){return(t-p.y)/p.k})).map(u.invert))}function E(t){g++||t({type:"zoomstart"})}function C(t){S(),t({type:"zoom",scale:p.k,translate:[p.x,p.y]})}function I(t){--g||(t({type:"zoomend"}),r=null)}function L(){var e=this,r=b.of(e,arguments),n=0,i=t.select(o(e)).on(v,(function(){n=1,k(t.mouse(e),a),C(r)})).on(x,(function(){i.on(v,null).on(x,null),s(n),I(r)})),a=T(t.mouse(e)),s=vt(e);Wi.call(e),E(r)}function P(){var e,r=this,n=b.of(r,arguments),i={},a=0,o=".zoom-"+t.event.changedTouches[0].identifier,l="touchmove"+o,c="touchend"+o,u=[],h=t.select(r),f=vt(r);function d(){var n=t.touches(r);return e=p.k,n.forEach((function(t){t.identifier in i&&(i[t.identifier]=T(t))})),n}function m(){var e=t.event.target;t.select(e).on(l,g).on(c,v),u.push(e);for(var n=t.event.changedTouches,o=0,h=n.length;o1){y=f[0];var x=f[1],_=y[0]-x[0],b=y[1]-x[1];a=_*_+b*b}}function g(){var o,l,c,u,h=t.touches(r);Wi.call(r);for(var p=0,f=h.length;p360?t-=360:t<0&&(t+=360),t<60?n+(i-n)*t/60:t<180?i:t<240?n+(i-n)*(240-t)/60:n}(t))}return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)||e<0?0:e>1?1:e,n=2*(r=r<0?0:r>1?1:r)-(i=r<=.5?r*(1+e):r+e-r*e),new Qt(a(t+120),a(t),a(t-120))}function Nt(e,r,n){return this instanceof Nt?(this.h=+e,this.c=+r,void(this.l=+n)):arguments.length<2?e instanceof Nt?new Nt(e.h,e.c,e.l):function(t,e,r){return t>0?new Nt(Math.atan2(r,e)*Et,Math.sqrt(e*e+r*r),t):new Nt(NaN,NaN,t)}(e instanceof qt?e.l:(e=oe((e=t.rgb(e)).r,e.g,e.b)).l,e.a,e.b):new Nt(e,r,n)}Bt.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),new Ft(this.h,this.s,this.l/t)},Bt.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new Ft(this.h,this.s,t*this.l)},Bt.rgb=function(){return jt(this.h,this.s,this.l)},t.hcl=Nt;var Ut=Nt.prototype=new Rt;function Vt(t,e,r){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new qt(r,Math.cos(t*=St)*e,Math.sin(t)*e)}function qt(t,e,r){return this instanceof qt?(this.l=+t,this.a=+e,void(this.b=+r)):arguments.length<2?t instanceof qt?new qt(t.l,t.a,t.b):t instanceof Nt?Vt(t.h,t.c,t.l):oe((t=Qt(t)).r,t.g,t.b):new qt(t,e,r)}Ut.brighter=function(t){return new Nt(this.h,this.c,Math.min(100,this.l+Ht*(arguments.length?t:1)))},Ut.darker=function(t){return new Nt(this.h,this.c,Math.max(0,this.l-Ht*(arguments.length?t:1)))},Ut.rgb=function(){return Vt(this.h,this.c,this.l).rgb()},t.lab=qt;var Ht=18,Gt=.95047,Wt=1,Zt=1.08883,Yt=qt.prototype=new Rt;function Xt(t,e,r){var n=(t+16)/116,i=n+e/500,a=n-r/200;return new Qt(Jt(3.2404542*(i=$t(i)*Gt)-1.5371385*(n=$t(n)*Wt)-.4985314*(a=$t(a)*Zt)),Jt(-.969266*i+1.8760108*n+.041556*a),Jt(.0556434*i-.2040259*n+1.0572252*a))}function $t(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function Kt(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function Jt(t){return Math.round(255*(t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function Qt(t,e,r){return this instanceof Qt?(this.r=~~t,this.g=~~e,void(this.b=~~r)):arguments.length<2?t instanceof Qt?new Qt(t.r,t.g,t.b):ie(""+t,Qt,jt):new Qt(t,e,r)}function te(t){return new Qt(t>>16,t>>8&255,255&t)}function ee(t){return te(t)+""}Yt.brighter=function(t){return new qt(Math.min(100,this.l+Ht*(arguments.length?t:1)),this.a,this.b)},Yt.darker=function(t){return new qt(Math.max(0,this.l-Ht*(arguments.length?t:1)),this.a,this.b)},Yt.rgb=function(){return Xt(this.l,this.a,this.b)},t.rgb=Qt;var re=Qt.prototype=new Rt;function ne(t){return t<16?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function ie(t,e,r){var n,i,a,o=0,s=0,l=0;if(n=/([a-z]+)\((.*)\)/.exec(t=t.toLowerCase()))switch(i=n[2].split(","),n[1]){case"hsl":return r(parseFloat(i[0]),parseFloat(i[1])/100,parseFloat(i[2])/100);case"rgb":return e(le(i[0]),le(i[1]),le(i[2]))}return(a=ce.get(t))?e(a.r,a.g,a.b):(null!=t&&"#"===t.charAt(0)&&!isNaN(a=parseInt(t.slice(1),16))&&(4===t.length?(o=(3840&a)>>4,o|=o>>4,s=240&a,s|=s>>4,l=15&a,l|=l<<4):7===t.length&&(o=(16711680&a)>>16,s=(65280&a)>>8,l=255&a)),e(o,s,l))}function ae(t,e,r){var n,i,a=Math.min(t/=255,e/=255,r/=255),o=Math.max(t,e,r),s=o-a,l=(o+a)/2;return s?(i=l<.5?s/(o+a):s/(2-o-a),n=t==o?(e-r)/s+(e0&&l<1?0:n),new Ft(n,i,l)}function oe(t,e,r){var n=Kt((.4124564*(t=se(t))+.3575761*(e=se(e))+.1804375*(r=se(r)))/Gt),i=Kt((.2126729*t+.7151522*e+.072175*r)/Wt);return qt(116*i-16,500*(n-i),200*(i-Kt((.0193339*t+.119192*e+.9503041*r)/Zt)))}function se(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function le(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}re.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);var e=this.r,r=this.g,n=this.b,i=30;return e||r||n?(e&&e=200&&e<300||304===e){try{t=i.call(o,c)}catch(t){return void s.error.call(o,t)}s.load.call(o,t)}else s.error.call(o,c)}return self.XDomainRequest&&!("withCredentials"in c)&&/^(http(s)?:)?\/\//.test(e)&&(c=new XDomainRequest),"onload"in c?c.onload=c.onerror=h:c.onreadystatechange=function(){c.readyState>3&&h()},c.onprogress=function(e){var r=t.event;t.event=e;try{s.progress.call(o,c)}finally{t.event=r}},o.header=function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?l[t]:(null==e?delete l[t]:l[t]=e+"",o)},o.mimeType=function(t){return arguments.length?(r=null==t?null:t+"",o):r},o.responseType=function(t){return arguments.length?(u=t,o):u},o.response=function(t){return i=t,o},["get","post"].forEach((function(t){o[t]=function(){return o.send.apply(o,[t].concat(n(arguments)))}})),o.send=function(t,n,i){if(2===arguments.length&&"function"==typeof n&&(i=n,n=null),c.open(t,e,!0),null!=r&&!("accept"in l)&&(l.accept=r+",*/*"),c.setRequestHeader)for(var a in l)c.setRequestHeader(a,l[a]);return null!=r&&c.overrideMimeType&&c.overrideMimeType(r),null!=u&&(c.responseType=u),null!=i&&o.on("error",i).on("load",(function(t){i(null,t)})),s.beforesend.call(o,c),c.send(n??null),o},o.abort=function(){return c.abort(),o},t.rebind(o,s,"on"),null==a?o:o.get(function(t){return 1===t.length?function(e,r){t(null==e?r:null)}:t}(a))}ce.forEach((function(t,e){ce.set(t,te(e))})),t.functor=ue,t.xhr=he(C),t.dsv=function(t,e){var r=new RegExp('["'+t+"\n]"),n=t.charCodeAt(0);function i(t,r,n){arguments.length<3&&(n=r,r=null);var i=pe(t,e,null==r?a:o(r),n);return i.row=function(t){return arguments.length?i.response(null==(r=t)?a:o(t)):r},i}function a(t){return i.parse(t.responseText)}function o(t){return function(e){return i.parse(e.responseText,t)}}function s(e){return e.map(l).join(t)}function l(t){return r.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}return i.parse=function(t,e){var r;return i.parseRows(t,(function(t,n){if(r)return r(t,n-1);var i=function(e){for(var r={},n=t.length,i=0;i=l)return o;if(i)return i=!1,a;var e=c;if(34===t.charCodeAt(e)){for(var r=e;r++24?(isFinite(e)&&(clearTimeout(ge),ge=setTimeout(xe,e)),me=0):(me=1,ye(xe))}function _e(){for(var t=Date.now(),e=fe;e;)t>=e.t&&e.c(t-e.t)&&(e.c=null),e=e.n;return t}function be(){for(var t,e=fe,r=1/0;e;)e.c?(e.t1&&Ct(t[r[n-2]],t[r[n-1]],t[i])<=0;)--n;r[n++]=i}return r.slice(0,n)}function ke(t,e){return t[0]-e[0]||t[1]-e[1]}t.timer=function(){ve.apply(this,arguments)},t.timer.flush=function(){_e(),be()},t.round=function(t,e){return e?Math.round(t*(e=Math.pow(10,e)))/e:Math.round(t)},t.geom={},t.geom.hull=function(t){var e=we,r=Te;if(arguments.length)return n(t);function n(t){if(t.length<3)return[];var n,i=ue(e),a=ue(r),o=t.length,s=[],l=[];for(n=0;n=0;--n)f.push(t[s[c[n]][2]]);for(n=+h;nwt)s=s.L;else{if(!((i=a-qe(s,o))>wt)){n>-wt?(e=s.P,r=s):i>-wt?(e=s,r=s.N):e=r=s;break}if(!s.R){e=s;break}s=s.R}var l=Be(t);if(Pe.insert(e,l),e||r){if(e===r)return Ye(e),r=Be(e.site),Pe.insert(l,r),l.edge=r.edge=Ke(e.site,l.site),Ze(e),void Ze(r);if(!r)return void(l.edge=Ke(e.site,l.site));Ye(e),Ye(r);var c=e.site,u=c.x,h=c.y,p=t.x-u,f=t.y-h,d=r.site,m=d.x-u,g=d.y-h,y=2*(p*g-f*m),v=p*p+f*f,x=m*m+g*g,_={x:(g*v-f*x)/y+u,y:(p*x-m*v)/y+h};Qe(r.edge,c,d,_),l.edge=Ke(c,t,null,_),r.edge=Ke(t,d,null,_),Ze(e),Ze(r)}}function Ve(t,e){var r=t.site,n=r.x,i=r.y,a=i-e;if(!a)return n;var o=t.P;if(!o)return-1/0;var s=(r=o.site).x,l=r.y,c=l-e;if(!c)return s;var u=s-n,h=1/a-1/c,p=u/c;return h?(-p+Math.sqrt(p*p-2*h*(u*u/(-2*c)-l+c/2+i-a/2)))/h+n:(n+s)/2}function qe(t,e){var r=t.N;if(r)return Ve(r,e);var n=t.site;return n.y===e?n.x:1/0}function He(t){this.site=t,this.edges=[]}function Ge(t,e){return e.angle-t.angle}function We(){rr(this),this.x=this.y=this.arc=this.site=this.cy=null}function Ze(t){var e=t.P,r=t.N;if(e&&r){var n=e.site,i=t.site,a=r.site;if(n!==a){var o=i.x,s=i.y,l=n.x-o,c=n.y-s,u=a.x-o,h=2*(l*(g=a.y-s)-c*u);if(!(h>=-1e-12)){var p=l*l+c*c,f=u*u+g*g,d=(g*p-c*f)/h,m=(l*f-u*p)/h,g=m+s,y=Re.pop()||new We;y.arc=t,y.site=i,y.x=d+o,y.y=g+Math.sqrt(d*d+m*m),y.cy=g,t.circle=y;for(var v=null,x=De._;x;)if(y.y=s)return;if(p>d){if(a){if(a.y>=c)return}else a={x:g,y:l};r={x:g,y:c}}else{if(a){if(a.y1)if(p>d){if(a){if(a.y>=c)return}else a={x:(l-i)/n,y:l};r={x:(c-i)/n,y:c}}else{if(a){if(a.y=s)return}else a={x:o,y:n*o+i};r={x:s,y:n*s+i}}else{if(a){if(a.x0)){if(a/=p,p<0){if(a0){if(a>h)return;a>u&&(u=a)}if(a=r-l,p||!(a<0)){if(a/=p,p<0){if(a>h)return;a>u&&(u=a)}else if(p>0){if(a0)){if(a/=f,f<0){if(a0){if(a>h)return;a>u&&(u=a)}if(a=n-c,f||!(a<0)){if(a/=f,f<0){if(a>h)return;a>u&&(u=a)}else if(f>0){if(a0&&(i.a={x:l+u*p,y:c+u*f}),h<1&&(i.b={x:l+h*p,y:c+h*f}),i}}}}}}(t[0][0],t[0][1],t[1][0],t[1][1]),i=r.length;i--;)(!Xe(e=r[i],t)||!n(e)||v(e.a.x-e.b.x)wt||v(i-r)>wt)&&(s.splice(o,0,new tr(Je(a.site,u,v(n-h)wt?{x:h,y:v(e-h)wt?{x:v(r-d)wt?{x:p,y:v(e-p)wt?{x:v(r-f)=r&&c.x<=i&&c.y>=n&&c.y<=o?[[r,o],[i,o],[i,n],[r,n]]:[]).point=t[s]})),e}function s(t){return t.map((function(t,e){return{x:Math.round(n(t,e)/wt)*wt,y:Math.round(i(t,e)/wt)*wt,i:e}}))}return o.links=function(t){return or(s(t)).edges.filter((function(t){return t.l&&t.r})).map((function(e){return{source:t[e.l.i],target:t[e.r.i]}}))},o.triangles=function(t){var e=[];return or(s(t)).cells.forEach((function(r,n){for(var i,a=r.site,o=r.edges.sort(Ge),s=-1,l=o.length,c=o[l-1].edge,u=c.l===a?c.r:c.l;++sa&&(i=e.slice(a,i),s[o]?s[o]+=i:s[++o]=i),(r=r[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,l.push({i:o,x:mr(r,n)})),a=vr.lastIndex;return am&&(m=l.x),l.y>g&&(g=l.y),c.push(l.x),u.push(l.y);else for(h=0;hm&&(m=_),b>g&&(g=b),c.push(_),u.push(b)}var w=m-f,T=g-d;function A(t,e,r,n,i,a,o,s){if(!isNaN(r)&&!isNaN(n))if(t.leaf){var l=t.x,c=t.y;if(null!=l)if(v(l-r)+v(c-n)<.01)k(t,e,r,n,i,a,o,s);else{var u=t.point;t.x=t.y=t.point=null,k(t,u,l,c,i,a,o,s),k(t,e,r,n,i,a,o,s)}else t.x=r,t.y=n,t.point=e}else k(t,e,r,n,i,a,o,s)}function k(t,e,r,n,i,a,o,s){var l=.5*(i+o),c=.5*(a+s),u=r>=l,h=n>=c,p=h<<1|u;t.leaf=!1,u?i=l:o=l,h?a=c:s=c,A(t=t.nodes[p]||(t.nodes[p]={leaf:!0,nodes:[],point:null,x:null,y:null}),e,r,n,i,a,o,s)}w>T?g=d+w:m=f+T;var M={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(t){A(M,t,+y(t,++h),+x(t,h),f,d,m,g)},visit:function(t){pr(t,M,f,d,m,g)},find:function(t){return function(t,e,r,n,i,a,o){var s,l=1/0;return function t(c,u,h,p,f){if(!(u>a||h>o||p=b)<<1|e>=_,T=w+4;w=0&&!(n=t.interpolators[i](e,r)););return n}function _r(t,e){var r,n=[],i=[],a=t.length,o=e.length,s=Math.min(t.length,e.length);for(r=0;r=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}function Cr(t){return 1-Math.cos(t*Mt)}function Ir(t){return Math.pow(2,10*(t-1))}function Lr(t){return 1-Math.sqrt(1-t*t)}function Pr(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}function zr(t,e){return e-=t,function(r){return Math.round(t+e*r)}}function Dr(t){var e=[t.a,t.b],r=[t.c,t.d],n=Rr(e),i=Or(e,r),a=Rr(function(t,e,r){return t[0]+=r*e[0],t[1]+=r*e[1],t}(r,e,-i))||0;e[0]*r[1]=0?t.slice(0,e):t,i=e>=0?t.slice(e+1):"in";return n=wr.get(n)||br,function(t){return function(e){return e<=0?0:e>=1?1:t(e)}}((i=Tr.get(i)||C)(n.apply(null,r.call(arguments,1))))},t.interpolateHcl=function(e,r){e=t.hcl(e),r=t.hcl(r);var n=e.h,i=e.c,a=e.l,o=r.h-n,s=r.c-i,l=r.l-a;return isNaN(s)&&(s=0,i=isNaN(i)?r.c:i),isNaN(o)?(o=0,n=isNaN(n)?r.h:n):o>180?o-=360:o<-180&&(o+=360),function(t){return Vt(n+o*t,i+s*t,a+l*t)+""}},t.interpolateHsl=function(e,r){e=t.hsl(e),r=t.hsl(r);var n=e.h,i=e.s,a=e.l,o=r.h-n,s=r.s-i,l=r.l-a;return isNaN(s)&&(s=0,i=isNaN(i)?r.s:i),isNaN(o)?(o=0,n=isNaN(n)?r.h:n):o>180?o-=360:o<-180&&(o+=360),function(t){return jt(n+o*t,i+s*t,a+l*t)+""}},t.interpolateLab=function(e,r){e=t.lab(e),r=t.lab(r);var n=e.l,i=e.a,a=e.b,o=r.l-n,s=r.a-i,l=r.b-a;return function(t){return Xt(n+o*t,i+s*t,a+l*t)+""}},t.interpolateRound=zr,t.transform=function(e){var r=i.createElementNS(t.ns.prefix.svg,"g");return(t.transform=function(t){if(null!=t){r.setAttribute("transform",t);var e=r.transform.baseVal.consolidate()}return new Dr(e?e.matrix:Fr)})(e)},Dr.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var Fr={a:1,b:0,c:0,d:1,e:0,f:0};function Br(t){return t.length?t.pop()+",":""}function jr(e,r){var n=[],i=[];return e=t.transform(e),r=t.transform(r),function(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var i=r.push("translate(",null,",",null,")");n.push({i:i-4,x:mr(t[0],e[0])},{i:i-2,x:mr(t[1],e[1])})}else(e[0]||e[1])&&r.push("translate("+e+")")}(e.translate,r.translate,n,i),function(t,e,r,n){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),n.push({i:r.push(Br(r)+"rotate(",null,")")-2,x:mr(t,e)})):e&&r.push(Br(r)+"rotate("+e+")")}(e.rotate,r.rotate,n,i),function(t,e,r,n){t!==e?n.push({i:r.push(Br(r)+"skewX(",null,")")-2,x:mr(t,e)}):e&&r.push(Br(r)+"skewX("+e+")")}(e.skew,r.skew,n,i),function(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var i=r.push(Br(r)+"scale(",null,",",null,")");n.push({i:i-4,x:mr(t[0],e[0])},{i:i-2,x:mr(t[1],e[1])})}else(1!==e[0]||1!==e[1])&&r.push(Br(r)+"scale("+e+")")}(e.scale,r.scale,n,i),e=r=null,function(t){for(var e,r=-1,a=i.length;++r0?n=t:(e.c=null,e.t=NaN,e=null,l.end({type:"end",alpha:n=0})):t>0&&(l.start({type:"start",alpha:n=t}),e=ve(s.tick)),s):n},s.start=function(){var t,e,r,n=y.length,l=v.length,u=c[0],d=c[1];for(t=0;t=0;)r.push(i[n])}function tn(t,e){for(var r=[t],n=[];null!=(t=r.pop());)if(n.push(t),(a=t.children)&&(i=a.length))for(var i,a,o=-1;++o=0;)o.push(u=c[l]),u.parent=a,u.depth=a.depth+1;r&&(a.value=0),a.children=c}else r&&(a.value=+r.call(n,a,a.depth)||0),delete a.children;return tn(i,(function(e){var n,i;t&&(n=e.children)&&n.sort(t),r&&(i=e.parent)&&(i.value+=e.value)})),s}return n.sort=function(e){return arguments.length?(t=e,n):t},n.children=function(t){return arguments.length?(e=t,n):e},n.value=function(t){return arguments.length?(r=t,n):r},n.revalue=function(t){return r&&(Qr(t,(function(t){t.children&&(t.value=0)})),tn(t,(function(t){var e;t.children||(t.value=+r.call(n,t,t.depth)||0),(e=t.parent)&&(e.value+=t.value)}))),t},n},t.layout.partition=function(){var e=t.layout.hierarchy(),r=[1,1];function n(t,e,r,i){var a=t.children;if(t.x=e,t.y=t.depth*i,t.dx=r,t.dy=i,a&&(o=a.length)){var o,s,l,c=-1;for(r=t.value?r/t.value:0;++cs&&(s=n),o.push(n)}for(r=0;ri&&(n=r,i=e);return n}function mn(t){return t.reduce(gn,0)}function gn(t,e){return t+e[1]}function yn(t,e){return vn(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function vn(t,e){for(var r=-1,n=+t[0],i=(t[1]-n)/e,a=[];++r<=e;)a[r]=i*r+n;return a}function xn(e){return[t.min(e),t.max(e)]}function _n(t,e){return t.value-e.value}function bn(t,e){var r=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=r,r._pack_prev=e}function wn(t,e){t._pack_next=e,e._pack_prev=t}function Tn(t,e){var r=e.x-t.x,n=e.y-t.y,i=t.r+e.r;return.999*i*i>r*r+n*n}function An(t){if((e=t.children)&&(l=e.length)){var e,r,n,i,a,o,s,l,c=1/0,u=-1/0,h=1/0,p=-1/0;if(e.forEach(kn),(r=e[0]).x=-r.r,r.y=0,x(r),l>1&&((n=e[1]).x=n.r,n.y=0,x(n),l>2))for(En(r,n,i=e[2]),x(i),bn(r,i),r._pack_prev=i,bn(i,n),n=r._pack_next,a=3;a0)for(o=-1;++o=h[0]&&l<=h[1]&&((s=c[t.bisect(p,l,1,d)-1]).y+=m,s.push(a[o]));return c}return a.value=function(t){return arguments.length?(r=t,a):r},a.range=function(t){return arguments.length?(n=ue(t),a):n},a.bins=function(t){return arguments.length?(i="number"==typeof t?function(e){return vn(e,t)}:ue(t),a):i},a.frequency=function(t){return arguments.length?(e=!!t,a):e},a},t.layout.pack=function(){var e,r=t.layout.hierarchy().sort(_n),n=0,i=[1,1];function a(t,a){var o=r.call(this,t,a),s=o[0],l=i[0],c=i[1],u=null==e?Math.sqrt:"function"==typeof e?e:function(){return e};if(s.x=s.y=0,tn(s,(function(t){t.r=+u(t.value)})),tn(s,An),n){var h=n*(e?1:Math.max(2*s.r/l,2*s.r/c))/2;tn(s,(function(t){t.r+=h})),tn(s,An),tn(s,(function(t){t.r-=h}))}return Sn(s,l/2,c/2,e?1:1/Math.max(2*s.r/l,2*s.r/c)),o}return a.size=function(t){return arguments.length?(i=t,a):i},a.radius=function(t){return arguments.length?(e=null==t||"function"==typeof t?t:+t,a):e},a.padding=function(t){return arguments.length?(n=+t,a):n},Jr(a,r)},t.layout.tree=function(){var e=t.layout.hierarchy().sort(null).value(null),r=Cn,n=[1,1],i=null;function a(t,a){var c=e.call(this,t,a),u=c[0],h=function(t){for(var e,r={A:null,children:[t]},n=[r];null!=(e=n.pop());)for(var i,a=e.children,o=0,s=a.length;of.x&&(f=t),t.depth>d.depth&&(d=t)}));var m=r(p,f)/2-p.x,g=n[0]/(f.x+r(f,p)/2+m),y=n[1]/(d.depth||1);Qr(u,(function(t){t.x=(t.x+m)*g,t.y=t.depth*y}))}return c}function o(t){var e=t.children,n=t.parent.children,i=t.i?n[t.i-1]:null;if(e.length){!function(t){for(var e,r=0,n=0,i=t.children,a=i.length;--a>=0;)(e=i[a]).z+=r,e.m+=r,r+=e.s+(n+=e.c)}(t);var a=(e[0].z+e[e.length-1].z)/2;i?(t.z=i.z+r(t._,i._),t.m=t.z-a):t.z=a}else i&&(t.z=i.z+r(t._,i._));t.parent.A=function(t,e,n){if(e){for(var i,a=t,o=t,s=e,l=a.parent.children[0],c=a.m,u=o.m,h=s.m,p=l.m;s=Ln(s),a=In(a),s&&a;)l=In(l),(o=Ln(o)).a=t,(i=s.z+h-a.z-c+r(s._,a._))>0&&(Pn(zn(s,t,n),t,i),c+=i,u+=i),h+=s.m,c+=a.m,p+=l.m,u+=o.m;s&&!Ln(o)&&(o.t=s,o.m+=h-u),a&&!In(l)&&(l.t=a,l.m+=c-p,n=t)}return n}(t,i,t.parent.A||n[0])}function s(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function l(t){t.x*=n[0],t.y=t.depth*n[1]}return a.separation=function(t){return arguments.length?(r=t,a):r},a.size=function(t){return arguments.length?(i=null==(n=t)?l:null,a):i?null:n},a.nodeSize=function(t){return arguments.length?(i=null==(n=t)?null:l,a):i?n:null},Jr(a,e)},t.layout.cluster=function(){var e=t.layout.hierarchy().sort(null).value(null),r=Cn,n=[1,1],i=!1;function a(a,o){var s,l=e.call(this,a,o),c=l[0],u=0;tn(c,(function(e){var n=e.children;n&&n.length?(e.x=function(t){return t.reduce((function(t,e){return t+e.x}),0)/t.length}(n),e.y=function(e){return 1+t.max(e,(function(t){return t.y}))}(n)):(e.x=s?u+=r(e,s):0,e.y=0,s=e)}));var h=Dn(c),p=On(c),f=h.x-r(h,p)/2,d=p.x+r(p,h)/2;return tn(c,i?function(t){t.x=(t.x-c.x)*n[0],t.y=(c.y-t.y)*n[1]}:function(t){t.x=(t.x-f)/(d-f)*n[0],t.y=(1-(c.y?t.y/c.y:1))*n[1]}),l}return a.separation=function(t){return arguments.length?(r=t,a):r},a.size=function(t){return arguments.length?(i=null==(n=t),a):i?null:n},a.nodeSize=function(t){return arguments.length?(i=null!=(n=t),a):i?n:null},Jr(a,e)},t.layout.treemap=function(){var e,r=t.layout.hierarchy(),n=Math.round,i=[1,1],a=null,o=Rn,s=!1,l="squarify",c=.5*(1+Math.sqrt(5));function u(t,e){for(var r,n,i=-1,a=t.length;++i0;)s.push(r=c[i-1]),s.area+=r.area,"squarify"!==l||(n=f(s,m))<=p?(c.pop(),p=n):(s.area-=s.pop().area,d(s,m,a,!1),m=Math.min(a.dx,a.dy),s.length=s.area=0,p=1/0);s.length&&(d(s,m,a,!0),s.length=s.area=0),e.forEach(h)}}function p(t){var e=t.children;if(e&&e.length){var r,n=o(t),i=e.slice(),a=[];for(u(i,n.dx*n.dy/t.value),a.area=0;r=i.pop();)a.push(r),a.area+=r.area,null!=r.z&&(d(a,r.z?n.dx:n.dy,n,!i.length),a.length=a.area=0);e.forEach(p)}}function f(t,e){for(var r,n=t.area,i=0,a=1/0,o=-1,s=t.length;++oi&&(i=r));return e*=e,(n*=n)?Math.max(e*i*c/n,n/(e*a*c)):1/0}function d(t,e,r,i){var a,o=-1,s=t.length,l=r.x,c=r.y,u=e?n(t.area/e):0;if(e==r.dx){for((i||u>r.dy)&&(u=r.dy);++or.dx)&&(u=r.dx);++o1);return t+e*r*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var e=t.random.normal.apply(t,arguments);return function(){return Math.exp(e())}},bates:function(e){var r=t.random.irwinHall(e);return function(){return r()/e}},irwinHall:function(t){return function(){for(var e=0,r=0;r2?Hn:Nn,l=n?Ur:Nr;return i=o(t,e,l,r),a=o(e,t,l,xr),s}function s(t){return i(t)}return s.invert=function(t){return a(t)},s.domain=function(e){return arguments.length?(t=e.map(Number),o()):t},s.range=function(t){return arguments.length?(e=t,o()):e},s.rangeRound=function(t){return s.range(t).interpolate(zr)},s.clamp=function(t){return arguments.length?(n=t,o()):n},s.interpolate=function(t){return arguments.length?(r=t,o()):r},s.ticks=function(e){return Xn(t,e)},s.tickFormat=function(e,r){return d3_scale_linearTickFormat(t,e,r)},s.nice=function(e){return Zn(t,e),o()},s.copy=function(){return Gn(t,e,r,n)},o()}function Wn(e,r){return t.rebind(e,r,"range","rangeRound","interpolate","clamp")}function Zn(t,e){return Un(t,Vn(Yn(t,e)[2])),Un(t,Vn(Yn(t,e)[2])),t}function Yn(t,e){null==e&&(e=10);var r=Bn(t),n=r[1]-r[0],i=Math.pow(10,Math.floor(Math.log(n/e)/Math.LN10)),a=e/n*i;return a<=.15?i*=10:a<=.35?i*=5:a<=.75&&(i*=2),r[0]=Math.ceil(r[0]/i)*i,r[1]=Math.floor(r[1]/i)*i+.5*i,r[2]=i,r}function Xn(e,r){return t.range.apply(t,Yn(e,r))}function $n(t,e,r,n){function i(t){return(r?Math.log(t<0?0:t):-Math.log(t>0?0:-t))/Math.log(e)}function a(t){return r?Math.pow(e,t):-Math.pow(e,-t)}function o(e){return t(i(e))}return o.invert=function(e){return a(t.invert(e))},o.domain=function(e){return arguments.length?(r=e[0]>=0,t.domain((n=e.map(Number)).map(i)),o):n},o.base=function(r){return arguments.length?(e=+r,t.domain(n.map(i)),o):e},o.nice=function(){var e=Un(n.map(i),r?Math:Kn);return t.domain(e),n=e.map(a),o},o.ticks=function(){var t=Bn(n),o=[],s=t[0],l=t[1],c=Math.floor(i(s)),u=Math.ceil(i(l)),h=e%1?2:e;if(isFinite(u-c)){if(r){for(;c0;p--)o.push(a(c)*p);for(c=0;o[c]l;u--);o=o.slice(c,u)}return o},o.copy=function(){return $n(t.copy(),e,r,n)},Wn(o,t)}t.scale.linear=function(){return Gn([0,1],[0,1],xr,!1)},t.scale.log=function(){return $n(t.scale.linear().domain([0,1]),10,!0,[1,10])};var Kn={floor:function(t){return-Math.ceil(-t)},ceil:function(t){return-Math.floor(-t)}};function Jn(t,e,r){var n=Qn(e),i=Qn(1/e);function a(e){return t(n(e))}return a.invert=function(e){return i(t.invert(e))},a.domain=function(e){return arguments.length?(t.domain((r=e.map(Number)).map(n)),a):r},a.ticks=function(t){return Xn(r,t)},a.tickFormat=function(t,e){return d3_scale_linearTickFormat(r,t,e)},a.nice=function(t){return a.domain(Zn(r,t))},a.exponent=function(o){return arguments.length?(n=Qn(e=o),i=Qn(1/e),t.domain(r.map(n)),a):e},a.copy=function(){return Jn(t.copy(),e,r)},Wn(a,t)}function Qn(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function ti(e,r){var n,i,a;function o(t){return i[((n.get(t)||("range"===r.t?n.set(t,e.push(t)):NaN))-1)%i.length]}function s(r,n){return t.range(e.length).map((function(t){return r+n*t}))}return o.domain=function(t){if(!arguments.length)return e;e=[],n=new _;for(var i,a=-1,s=t.length;++a0?n[t-1]:e[0],th?0:1;if(c=kt)return l(c,f)+(s?l(s,1-f):"")+"Z";var d,m,g,y,v,x,_,b,w,T,A,k,M=0,S=0,E=[];if((y=(+o.apply(this,arguments)||0)/2)&&(g=n===ui?Math.sqrt(s*s+c*c):+n.apply(this,arguments),f||(S*=-1),c&&(S=It(g/c*Math.sin(y))),s&&(M=It(g/s*Math.sin(y)))),c){v=c*Math.cos(u+S),x=c*Math.sin(u+S),_=c*Math.cos(h-S),b=c*Math.sin(h-S);var C=Math.abs(h-u-2*S)<=Tt?0:1;if(S&&gi(v,x,_,b)===f^C){var I=(u+h)/2;v=c*Math.cos(I),x=c*Math.sin(I),_=b=null}}else v=x=0;if(s){w=s*Math.cos(h-M),T=s*Math.sin(h-M),A=s*Math.cos(u+M),k=s*Math.sin(u+M);var L=Math.abs(u-h+2*M)<=Tt?0:1;if(M&&gi(w,T,A,k)===1-f^L){var P=(u+h)/2;w=s*Math.cos(P),T=s*Math.sin(P),A=k=null}}else w=T=0;if(p>wt&&(d=Math.min(Math.abs(c-s)/2,+r.apply(this,arguments)))>.001){m=s0?0:1}function yi(t,e,r,n,i){var a=t[0]-e[0],o=t[1]-e[1],s=(i?n:-n)/Math.sqrt(a*a+o*o),l=s*o,c=-s*a,u=t[0]+l,h=t[1]+c,p=e[0]+l,f=e[1]+c,d=(u+p)/2,m=(h+f)/2,g=p-u,y=f-h,v=g*g+y*y,x=r-n,_=u*f-p*h,b=(y<0?-1:1)*Math.sqrt(Math.max(0,x*x*v-_*_)),w=(_*y-g*b)/v,T=(-_*g-y*b)/v,A=(_*y+g*b)/v,k=(-_*g+y*b)/v,M=w-d,S=T-m,E=A-d,C=k-m;return M*M+S*S>E*E+C*C&&(w=A,T=k),[[w-l,T-c],[w*r/x,T*r/x]]}function vi(){return!0}function xi(t){var e=we,r=Te,n=vi,i=bi,a=i.key,o=.7;function s(a){var s,l=[],c=[],u=-1,h=a.length,p=ue(e),f=ue(r);function d(){l.push("M",i(t(c),o))}for(;++u1&&i.push("H",n[0]),i.join("")},"step-before":Ti,"step-after":Ai,basis:Si,"basis-open":function(t){if(t.length<4)return bi(t);for(var e,r=[],n=-1,i=t.length,a=[0],o=[0];++n<3;)e=t[n],a.push(e[0]),o.push(e[1]);for(r.push(Ei(Li,a)+","+Ei(Li,o)),--n;++n9&&(i=3*e/Math.sqrt(i),o[s]=i*r,o[s+1]=i*n);for(s=-1;++s<=l;)i=(t[Math.min(l,s+1)][0]-t[Math.max(0,s-1)][0])/(6*(1+o[s]*o[s])),a.push([i||0,o[s]*i||0]);return a}(t))}});function bi(t){return t.length>1?t.join("L"):t+"Z"}function wi(t){return t.join("L")+"Z"}function Ti(t){for(var e=0,r=t.length,n=t[0],i=[n[0],",",n[1]];++e1){s=e[1],a=t[l],l++,n+="C"+(i[0]+o[0])+","+(i[1]+o[1])+","+(a[0]-s[0])+","+(a[1]-s[1])+","+a[0]+","+a[1];for(var c=2;cTt)+",1 "+e}function l(t,e,r,n){return"Q 0,0 "+n}return a.radius=function(t){return arguments.length?(r=ue(t),a):r},a.source=function(e){return arguments.length?(t=ue(e),a):t},a.target=function(t){return arguments.length?(e=ue(t),a):e},a.startAngle=function(t){return arguments.length?(n=ue(t),a):n},a.endAngle=function(t){return arguments.length?(i=ue(t),a):i},a},t.svg.diagonal=function(){var t=Ri,e=Fi,r=ji;function n(n,i){var a=t.call(this,n,i),o=e.call(this,n,i),s=(a.y+o.y)/2,l=[a,{x:a.x,y:s},{x:o.x,y:s},o];return"M"+(l=l.map(r))[0]+"C"+l[1]+" "+l[2]+" "+l[3]}return n.source=function(e){return arguments.length?(t=ue(e),n):t},n.target=function(t){return arguments.length?(e=ue(t),n):e},n.projection=function(t){return arguments.length?(r=t,n):r},n},t.svg.diagonal.radial=function(){var e=t.svg.diagonal(),r=ji,n=e.projection;return e.projection=function(t){return arguments.length?n(function(t){return function(){var e=t.apply(this,arguments),r=e[0],n=e[1]-Mt;return[r*Math.cos(n),r*Math.sin(n)]}}(r=t)):r},e},t.svg.symbol=function(){var t=Ui,e=Ni;function r(r,n){return(qi.get(t.call(this,r,n))||Vi)(e.call(this,r,n))}return r.type=function(e){return arguments.length?(t=ue(e),r):t},r.size=function(t){return arguments.length?(e=ue(t),r):e},r};var qi=t.map({circle:Vi,cross:function(t){var e=Math.sqrt(t/5)/2;return"M"+-3*e+","+-e+"H"+-e+"V"+-3*e+"H"+e+"V"+-e+"H"+3*e+"V"+e+"H"+e+"V"+3*e+"H"+-e+"V"+e+"H"+-3*e+"Z"},diamond:function(t){var e=Math.sqrt(t/(2*Gi)),r=e*Gi;return"M0,"+-e+"L"+r+",0 0,"+e+" "+-r+",0Z"},square:function(t){var e=Math.sqrt(t)/2;return"M"+-e+","+-e+"L"+e+","+-e+" "+e+","+e+" "+-e+","+e+"Z"},"triangle-down":function(t){var e=Math.sqrt(t/Hi),r=e*Hi/2;return"M0,"+r+"L"+e+","+-r+" "+-e+","+-r+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/Hi),r=e*Hi/2;return"M0,"+-r+"L"+e+","+r+" "+-e+","+r+"Z"}});t.svg.symbolTypes=qi.keys();var Hi=Math.sqrt(3),Gi=Math.tan(30*St);G.transition=function(t){for(var e,r,n=Xi||++Ji,i=ea(t),a=[],o=$i||{time:Date.now(),ease:Er,delay:0,duration:250},s=-1,l=this.length;++s0;)c[--p].call(t,o);if(a>=1)return h.event&&h.event.end.call(t,t.__data__,e),--u.count?delete u[n]:delete t[r],1}h||(a=i.time,o=ve((function(t){var e=h.delay;if(o.t=e+a,e<=t)return p(t-e);o.c=p}),0,a),h=u[n]={tween:new _,time:a,timer:o,delay:i.delay,duration:i.duration,ease:i.ease,index:e},i=null,++u.count)}Ki.call=G.call,Ki.empty=G.empty,Ki.node=G.node,Ki.size=G.size,t.transition=function(e,r){return e&&e.transition?Xi?e.transition(r):e:t.selection().transition(e)},t.transition.prototype=Ki,Ki.select=function(t){var e,r,n,i=this.id,a=this.namespace,o=[];t=W(t);for(var s=-1,l=this.length;++srect,.s>rect").attr("width",s[1]-s[0])}function m(t){t.select(".extent").attr("y",l[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",l[1]-l[0])}function g(){var h,g,y=this,v=t.select(t.event.target),x=n.of(y,arguments),_=t.select(y),b=v.datum(),w=!/^(n|s)$/.test(b)&&i,T=!/^(e|w)$/.test(b)&&a,A=v.classed("extent"),k=vt(y),M=t.mouse(y),S=t.select(o(y)).on("keydown.brush",(function(){32==t.event.keyCode&&(A||(h=null,M[0]-=s[1],M[1]-=l[1],A=2),R())})).on("keyup.brush",(function(){32==t.event.keyCode&&2==A&&(M[0]+=s[1],M[1]+=l[1],A=0,R())}));if(t.event.changedTouches?S.on("touchmove.brush",I).on("touchend.brush",P):S.on("mousemove.brush",I).on("mouseup.brush",P),_.interrupt().selectAll("*").interrupt(),A)M[0]=s[0]-M[0],M[1]=l[0]-M[1];else if(b){var E=+/w$/.test(b),C=+/^n/.test(b);g=[s[1-E]-M[0],l[1-C]-M[1]],M[0]=s[E],M[1]=l[C]}else t.event.altKey&&(h=M.slice());function I(){var e=t.mouse(y),r=!1;g&&(e[0]+=g[0],e[1]+=g[1]),A||(t.event.altKey?(h||(h=[(s[0]+s[1])/2,(l[0]+l[1])/2]),M[0]=s[+(e[0]0))return o;do{o.push(a=new Date(+e)),i(e,n),t(e)}while(a=r)for(;t(r),!e(r);)r.setTime(r-1)}),(function(t,r){if(t>=t)if(r<0)for(;++r<=0;)for(;i(t,-1),!e(t););else for(;--r>=0;)for(;i(t,1),!e(t););}))},a&&(s.count=function(n,i){return e.setTime(+n),r.setTime(+i),t(e),t(r),Math.floor(a(e,r))},s.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?s.filter(o?function(e){return o(e)%t==0}:function(e){return s.count(0,e)%t==0}):s:null}),s}var i=n((function(){}),(function(t,e){t.setTime(+t+e)}),(function(t,e){return e-t}));i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?n((function(e){e.setTime(Math.floor(e/t)*t)}),(function(e,r){e.setTime(+e+r*t)}),(function(e,r){return(r-e)/t})):i:null};var a=i.range,o=1e3,s=6e4,l=36e5,c=864e5,u=6048e5,h=n((function(t){t.setTime(t-t.getMilliseconds())}),(function(t,e){t.setTime(+t+e*o)}),(function(t,e){return(e-t)/o}),(function(t){return t.getUTCSeconds()})),p=h.range,f=n((function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*o)}),(function(t,e){t.setTime(+t+e*s)}),(function(t,e){return(e-t)/s}),(function(t){return t.getMinutes()})),d=f.range,m=n((function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*o-t.getMinutes()*s)}),(function(t,e){t.setTime(+t+e*l)}),(function(t,e){return(e-t)/l}),(function(t){return t.getHours()})),g=m.range,y=n((function(t){t.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+e)}),(function(t,e){return(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*s)/c}),(function(t){return t.getDate()-1})),v=y.range;function x(t){return n((function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+7*e)}),(function(t,e){return(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*s)/u}))}var _=x(0),b=x(1),w=x(2),T=x(3),A=x(4),k=x(5),M=x(6),S=_.range,E=b.range,C=w.range,I=T.range,L=A.range,P=k.range,z=M.range,D=n((function(t){t.setDate(1),t.setHours(0,0,0,0)}),(function(t,e){t.setMonth(t.getMonth()+e)}),(function(t,e){return e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())}),(function(t){return t.getMonth()})),O=D.range,R=n((function(t){t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,e){t.setFullYear(t.getFullYear()+e)}),(function(t,e){return e.getFullYear()-t.getFullYear()}),(function(t){return t.getFullYear()}));R.every=function(t){return isFinite(t=Math.floor(t))&&t>0?n((function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,r){e.setFullYear(e.getFullYear()+r*t)})):null};var F=R.range,B=n((function(t){t.setUTCSeconds(0,0)}),(function(t,e){t.setTime(+t+e*s)}),(function(t,e){return(e-t)/s}),(function(t){return t.getUTCMinutes()})),j=B.range,N=n((function(t){t.setUTCMinutes(0,0,0)}),(function(t,e){t.setTime(+t+e*l)}),(function(t,e){return(e-t)/l}),(function(t){return t.getUTCHours()})),U=N.range,V=n((function(t){t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+e)}),(function(t,e){return(e-t)/c}),(function(t){return t.getUTCDate()-1})),q=V.range;function H(t){return n((function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+7*e)}),(function(t,e){return(e-t)/u}))}var G=H(0),W=H(1),Z=H(2),Y=H(3),X=H(4),$=H(5),K=H(6),J=G.range,Q=W.range,tt=Z.range,et=Y.range,rt=X.range,nt=$.range,it=K.range,at=n((function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCMonth(t.getUTCMonth()+e)}),(function(t,e){return e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())}),(function(t){return t.getUTCMonth()})),ot=at.range,st=n((function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)}),(function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()}),(function(t){return t.getUTCFullYear()}));st.every=function(t){return isFinite(t=Math.floor(t))&&t>0?n((function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,r){e.setUTCFullYear(e.getUTCFullYear()+r*t)})):null};var lt=st.range;t.timeDay=y,t.timeDays=v,t.timeFriday=k,t.timeFridays=P,t.timeHour=m,t.timeHours=g,t.timeInterval=n,t.timeMillisecond=i,t.timeMilliseconds=a,t.timeMinute=f,t.timeMinutes=d,t.timeMonday=b,t.timeMondays=E,t.timeMonth=D,t.timeMonths=O,t.timeSaturday=M,t.timeSaturdays=z,t.timeSecond=h,t.timeSeconds=p,t.timeSunday=_,t.timeSundays=S,t.timeThursday=A,t.timeThursdays=L,t.timeTuesday=w,t.timeTuesdays=C,t.timeWednesday=T,t.timeWednesdays=I,t.timeWeek=_,t.timeWeeks=S,t.timeYear=R,t.timeYears=F,t.utcDay=V,t.utcDays=q,t.utcFriday=$,t.utcFridays=nt,t.utcHour=N,t.utcHours=U,t.utcMillisecond=i,t.utcMilliseconds=a,t.utcMinute=B,t.utcMinutes=j,t.utcMonday=W,t.utcMondays=Q,t.utcMonth=at,t.utcMonths=ot,t.utcSaturday=K,t.utcSaturdays=it,t.utcSecond=h,t.utcSeconds=p,t.utcSunday=G,t.utcSundays=J,t.utcThursday=X,t.utcThursdays=rt,t.utcTuesday=Z,t.utcTuesdays=tt,t.utcWednesday=Y,t.utcWednesdays=et,t.utcWeek=G,t.utcWeeks=J,t.utcYear=st,t.utcYears=lt,Object.defineProperty(t,"__esModule",{value:!0})},n("object"==typeof t&&typeof e<"u"?t:(r=r||self).d3=r.d3||{})}}),b=f({"node_modules/d3-time-format/dist/d3-time-format.js"(t,e){var r,n;r=t,n=function(t,e){function r(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function n(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function i(t,e,r){return{y:t,m:e,d:r,H:0,M:0,S:0,L:0}}function a(t){var a=t.dateTime,o=t.date,l=t.time,c=t.periods,u=t.days,h=t.shortDays,p=t.months,vt=t.shortMonths,xt=f(c),_t=d(c),bt=f(u),wt=d(u),Tt=f(h),At=d(h),kt=f(p),Mt=d(p),St=f(vt),Et=d(vt),Ct={a:function(t){return h[t.getDay()]},A:function(t){return u[t.getDay()]},b:function(t){return vt[t.getMonth()]},B:function(t){return p[t.getMonth()]},c:null,d:O,e:O,f:N,H:R,I:F,j:B,L:j,m:U,M:V,p:function(t){return c[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:gt,s:yt,S:q,u:H,U:G,V:W,w:Z,W:Y,x:null,X:null,y:X,Y:$,Z:K,"%":mt},It={a:function(t){return h[t.getUTCDay()]},A:function(t){return u[t.getUTCDay()]},b:function(t){return vt[t.getUTCMonth()]},B:function(t){return p[t.getUTCMonth()]},c:null,d:J,e:J,f:nt,H:Q,I:tt,j:et,L:rt,m:it,M:at,p:function(t){return c[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:gt,s:yt,S:ot,u:st,U:lt,V:ct,w:ut,W:ht,x:null,X:null,y:pt,Y:ft,Z:dt,"%":mt},Lt={a:function(t,e,r){var n=Tt.exec(e.slice(r));return n?(t.w=At[n[0].toLowerCase()],r+n[0].length):-1},A:function(t,e,r){var n=bt.exec(e.slice(r));return n?(t.w=wt[n[0].toLowerCase()],r+n[0].length):-1},b:function(t,e,r){var n=St.exec(e.slice(r));return n?(t.m=Et[n[0].toLowerCase()],r+n[0].length):-1},B:function(t,e,r){var n=kt.exec(e.slice(r));return n?(t.m=Mt[n[0].toLowerCase()],r+n[0].length):-1},c:function(t,e,r){return Dt(t,a,e,r)},d:k,e:k,f:L,H:S,I:S,j:M,L:I,m:A,M:E,p:function(t,e,r){var n=xt.exec(e.slice(r));return n?(t.p=_t[n[0].toLowerCase()],r+n[0].length):-1},q:T,Q:z,s:D,S:C,u:g,U:y,V:v,w:m,W:x,x:function(t,e,r){return Dt(t,o,e,r)},X:function(t,e,r){return Dt(t,l,e,r)},y:b,Y:_,Z:w,"%":P};function Pt(t,e){return function(r){var n,i,a,o=[],l=-1,c=0,u=t.length;for(r instanceof Date||(r=new Date(+r));++l53)return null;"w"in c||(c.w=1),"Z"in c?(l=(s=n(i(c.y,0,1))).getUTCDay(),s=l>4||0===l?e.utcMonday.ceil(s):e.utcMonday(s),s=e.utcDay.offset(s,7*(c.V-1)),c.y=s.getUTCFullYear(),c.m=s.getUTCMonth(),c.d=s.getUTCDate()+(c.w+6)%7):(l=(s=r(i(c.y,0,1))).getDay(),s=l>4||0===l?e.timeMonday.ceil(s):e.timeMonday(s),s=e.timeDay.offset(s,7*(c.V-1)),c.y=s.getFullYear(),c.m=s.getMonth(),c.d=s.getDate()+(c.w+6)%7)}else("W"in c||"U"in c)&&("w"in c||(c.w="u"in c?c.u%7:"W"in c?1:0),l="Z"in c?n(i(c.y,0,1)).getUTCDay():r(i(c.y,0,1)).getDay(),c.m=0,c.d="W"in c?(c.w+6)%7+7*c.W-(l+5)%7:c.w+7*c.U-(l+6)%7);return"Z"in c?(c.H+=c.Z/100|0,c.M+=c.Z%100,n(c)):r(c)}}function Dt(t,e,r,n){for(var i,a,o=0,l=e.length,c=r.length;o=c)return-1;if(37===(i=e.charCodeAt(o++))){if(i=e.charAt(o++),!(a=Lt[i in s?e.charAt(o++):i])||(n=a(t,r,n))<0)return-1}else if(i!=r.charCodeAt(n++))return-1}return n}return Ct.x=Pt(o,Ct),Ct.X=Pt(l,Ct),Ct.c=Pt(a,Ct),It.x=Pt(o,It),It.X=Pt(l,It),It.c=Pt(a,It),{format:function(t){var e=Pt(t+="",Ct);return e.toString=function(){return t},e},parse:function(t){var e=zt(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=Pt(t+="",It);return e.toString=function(){return t},e},utcParse:function(t){var e=zt(t+="",!0);return e.toString=function(){return t},e}}}var o,s={"-":"",_:" ",0:"0"},l=/^\s*\d+/,c=/^%/,u=/[\\^$*+?|[\]().{}]/g;function h(t,e,r){var n=t<0?"-":"",i=(n?-t:t)+"",a=i.length;return n+(a68?1900:2e3),r+n[0].length):-1}function w(t,e,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(r,r+6));return n?(t.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function T(t,e,r){var n=l.exec(e.slice(r,r+1));return n?(t.q=3*n[0]-3,r+n[0].length):-1}function A(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function k(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function M(t,e,r){var n=l.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function S(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function E(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function C(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function I(t,e,r){var n=l.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function L(t,e,r){var n=l.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function P(t,e,r){var n=c.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function z(t,e,r){var n=l.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function D(t,e,r){var n=l.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function O(t,e){return h(t.getDate(),e,2)}function R(t,e){return h(t.getHours(),e,2)}function F(t,e){return h(t.getHours()%12||12,e,2)}function B(t,r){return h(1+e.timeDay.count(e.timeYear(t),t),r,3)}function j(t,e){return h(t.getMilliseconds(),e,3)}function N(t,e){return j(t,e)+"000"}function U(t,e){return h(t.getMonth()+1,e,2)}function V(t,e){return h(t.getMinutes(),e,2)}function q(t,e){return h(t.getSeconds(),e,2)}function H(t){var e=t.getDay();return 0===e?7:e}function G(t,r){return h(e.timeSunday.count(e.timeYear(t)-1,t),r,2)}function W(t,r){var n=t.getDay();return t=n>=4||0===n?e.timeThursday(t):e.timeThursday.ceil(t),h(e.timeThursday.count(e.timeYear(t),t)+(4===e.timeYear(t).getDay()),r,2)}function Z(t){return t.getDay()}function Y(t,r){return h(e.timeMonday.count(e.timeYear(t)-1,t),r,2)}function X(t,e){return h(t.getFullYear()%100,e,2)}function $(t,e){return h(t.getFullYear()%1e4,e,4)}function K(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+h(e/60|0,"0",2)+h(e%60,"0",2)}function J(t,e){return h(t.getUTCDate(),e,2)}function Q(t,e){return h(t.getUTCHours(),e,2)}function tt(t,e){return h(t.getUTCHours()%12||12,e,2)}function et(t,r){return h(1+e.utcDay.count(e.utcYear(t),t),r,3)}function rt(t,e){return h(t.getUTCMilliseconds(),e,3)}function nt(t,e){return rt(t,e)+"000"}function it(t,e){return h(t.getUTCMonth()+1,e,2)}function at(t,e){return h(t.getUTCMinutes(),e,2)}function ot(t,e){return h(t.getUTCSeconds(),e,2)}function st(t){var e=t.getUTCDay();return 0===e?7:e}function lt(t,r){return h(e.utcSunday.count(e.utcYear(t)-1,t),r,2)}function ct(t,r){var n=t.getUTCDay();return t=n>=4||0===n?e.utcThursday(t):e.utcThursday.ceil(t),h(e.utcThursday.count(e.utcYear(t),t)+(4===e.utcYear(t).getUTCDay()),r,2)}function ut(t){return t.getUTCDay()}function ht(t,r){return h(e.utcMonday.count(e.utcYear(t)-1,t),r,2)}function pt(t,e){return h(t.getUTCFullYear()%100,e,2)}function ft(t,e){return h(t.getUTCFullYear()%1e4,e,4)}function dt(){return"+0000"}function mt(){return"%"}function gt(t){return+t}function yt(t){return Math.floor(+t/1e3)}function vt(e){return o=a(e),t.timeFormat=o.format,t.timeParse=o.parse,t.utcFormat=o.utcFormat,t.utcParse=o.utcParse,o}vt({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var xt="%Y-%m-%dT%H:%M:%S.%LZ",_t=Date.prototype.toISOString?function(t){return t.toISOString()}:t.utcFormat(xt),bt=+new Date("2000-01-01T00:00:00.000Z")?function(t){var e=new Date(t);return isNaN(e)?null:e}:t.utcParse(xt);t.isoFormat=_t,t.isoParse=bt,t.timeFormatDefaultLocale=vt,t.timeFormatLocale=a,Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof t&&typeof e<"u"?n(t,_()):n((r=r||self).d3=r.d3||{},r.d3)}}),w=f({"node_modules/d3-format/dist/d3-format.js"(t,e){var r,n;r=t,n=function(t){function e(t,e){if((r=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var r,n=t.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+t.slice(r+1)]}function r(t){return(t=e(Math.abs(t)))?t[1]:NaN}var n,i=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function a(t){if(!(e=i.exec(t)))throw new Error("invalid format: "+t);var e;return new o({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 o(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 s(t,r){var n=e(t,r);if(!n)return t+"";var i=n[0],a=n[1];return a<0?"0."+new Array(-a).join("0")+i:i.length>a+1?i.slice(0,a+1)+"."+i.slice(a+1):i+new Array(a-i.length+2).join("0")}a.prototype=o.prototype,o.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};var l={"%":function(t,e){return(100*t).toFixed(e)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},g:function(t,e){return t.toPrecision(e)},o:function(t){return Math.round(t).toString(8)},p:function(t,e){return s(100*t,e)},r:s,s:function(t,r){var i=e(t,r);if(!i)return t+"";var a=i[0],o=i[1],s=o-(n=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,l=a.length;return s===l?a:s>l?a+new Array(s-l+1).join("0"):s>0?a.slice(0,s)+"."+a.slice(s):"0."+new Array(1-s).join("0")+e(t,Math.max(0,r+s-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}};function c(t){return t}var u,h=Array.prototype.map,p=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function f(t){var e=void 0===t.grouping||void 0===t.thousands?c:function(t,e){return function(r,n){for(var i=r.length,a=[],o=0,s=t[0],l=0;i>0&&s>0&&(l+s+1>n&&(s=Math.max(1,n-l)),a.push(r.substring(i-=s,i+s)),!((l+=s+1)>n));)s=t[o=(o+1)%t.length];return a.reverse().join(e)}}(h.call(t.grouping,Number),t.thousands+""),i=void 0===t.currency?"":t.currency[0]+"",o=void 0===t.currency?"":t.currency[1]+"",s=void 0===t.decimal?".":t.decimal+"",u=void 0===t.numerals?c:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(h.call(t.numerals,String)),f=void 0===t.percent?"%":t.percent+"",d=void 0===t.minus?"-":t.minus+"",m=void 0===t.nan?"NaN":t.nan+"";function g(t){var r=(t=a(t)).fill,c=t.align,h=t.sign,g=t.symbol,y=t.zero,v=t.width,x=t.comma,_=t.precision,b=t.trim,w=t.type;"n"===w?(x=!0,w="g"):l[w]||(void 0===_&&(_=12),b=!0,w="g"),(y||"0"===r&&"="===c)&&(y=!0,r="0",c="=");var T="$"===g?i:"#"===g&&/[boxX]/.test(w)?"0"+w.toLowerCase():"",A="$"===g?o:/[%p]/.test(w)?f:"",k=l[w],M=/[defgprs%]/.test(w);function S(t){var i,a,o,l=T,f=A;if("c"===w)f=k(t)+f,t="";else{var g=(t=+t)<0||1/t<0;if(t=isNaN(t)?m:k(Math.abs(t),_),b&&(t=function(t){t:for(var e,r=t.length,n=1,i=-1;n0&&(i=0)}return i>0?t.slice(0,i)+t.slice(e+1):t}(t)),g&&0==+t&&"+"!==h&&(g=!1),l=(g?"("===h?h:d:"-"===h||"("===h?"":h)+l,f=("s"===w?p[8+n/3]:"")+f+(g&&"("===h?")":""),M)for(i=-1,a=t.length;++i(o=t.charCodeAt(i))||o>57){f=(46===o?s+t.slice(i+1):t.slice(i))+f,t=t.slice(0,i);break}}x&&!y&&(t=e(t,1/0));var S=l.length+t.length+f.length,E=S>1)+l+t+f+E.slice(S);break;default:t=E+l+t+f}return u(t)}return _=void 0===_?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_)),S.toString=function(){return t+""},S}return{format:g,formatPrefix:function(t,e){var n=g(((t=a(t)).type="f",t)),i=3*Math.max(-8,Math.min(8,Math.floor(r(e)/3))),o=Math.pow(10,-i),s=p[8+i/3];return function(t){return n(o*t)+s}}}}function d(e){return u=f(e),t.format=u.format,t.formatPrefix=u.formatPrefix,u}d({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),t.FormatSpecifier=o,t.formatDefaultLocale=d,t.formatLocale=f,t.formatSpecifier=a,t.precisionFixed=function(t){return Math.max(0,-r(Math.abs(t)))},t.precisionPrefix=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(r(e)/3)))-r(Math.abs(t)))},t.precisionRound=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,r(e)-r(t))+1},Object.defineProperty(t,"__esModule",{value:!0})},n("object"==typeof t&&typeof e<"u"?t:(r=typeof globalThis<"u"?globalThis:r||self).d3=r.d3||{})}}),T=f({"node_modules/is-string-blank/index.js"(t,e){e.exports=function(t){for(var e,r=t.length,n=0;n13)&&32!==e&&133!==e&&160!==e&&5760!==e&&6158!==e&&(e<8192||e>8205)&&8232!==e&&8233!==e&&8239!==e&&8287!==e&&8288!==e&&12288!==e&&65279!==e)return!1;return!0}}}),A=f({"node_modules/fast-isnumeric/index.js"(t,e){var r=T();e.exports=function(t){var e=typeof t;if("string"===e){var n=t;if(0==(t=+t)&&r(n))return!1}else if("number"!==e)return!1;return t-t<1}}}),k=f({"src/constants/numerical.js"(t,e){e.exports={BADNUM:void 0,FP_SAFE:1e-4*Number.MAX_VALUE,ONEMAXYEAR:316224e5,ONEAVGYEAR:315576e5,ONEMINYEAR:31536e6,ONEMAXQUARTER:79488e5,ONEAVGQUARTER:78894e5,ONEMINQUARTER:76896e5,ONEMAXMONTH:26784e5,ONEAVGMONTH:26298e5,ONEMINMONTH:24192e5,ONEWEEK:6048e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,ONEMILLI:1,ONEMICROSEC:.001,EPOCHJD:2440587.5,ALMOST_EQUAL:.999999,LOG_CLIP:10,MINUS_SIGN:"−"}}}),M=f({"node_modules/base64-arraybuffer/dist/base64-arraybuffer.umd.js"(t,e){var r,n;r=t,n=function(t){for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=typeof Uint8Array>"u"?[]:new Uint8Array(256),n=0;n<64;n++)r[e.charCodeAt(n)]=n;t.decode=function(t){var e,n,i,a,o,s=.75*t.length,l=t.length,c=0;"="===t[t.length-1]&&(s--,"="===t[t.length-2]&&s--);var u=new ArrayBuffer(s),h=new Uint8Array(u);for(e=0;e>4,h[c++]=(15&i)<<4|a>>2,h[c++]=(3&a)<<6|63&o;return u},t.encode=function(t){var r,n=new Uint8Array(t),i=n.length,a="";for(r=0;r>2],a+=e[(3&n[r])<<4|n[r+1]>>4],a+=e[(15&n[r+1])<<2|n[r+2]>>6],a+=e[63&n[r+2]];return i%3==2?a=a.substring(0,a.length-1)+"=":i%3==1&&(a=a.substring(0,a.length-2)+"=="),a},Object.defineProperty(t,"__esModule",{value:!0})},n("object"==typeof t&&typeof e<"u"?t:(r=typeof globalThis<"u"?globalThis:r||self)["base64-arraybuffer"]={})}}),S=f({"src/lib/is_plain_object.js"(t,e){e.exports=function(t){return window&&window.process&&window.process.versions?"[object Object]"===Object.prototype.toString.call(t):"[object Object]"===Object.prototype.toString.call(t)&&Object.getPrototypeOf(t).hasOwnProperty("hasOwnProperty")}}}),E=f({"src/lib/array.js"(t){var e=M().decode,r=S(),n=Array.isArray,i=ArrayBuffer,a=DataView;function o(t){return i.isView(t)&&!(t instanceof a)}function s(t){return n(t)||o(t)}t.isTypedArray=o,t.isArrayOrTypedArray=s,t.isArray1D=function(t){return!s(t[0])},t.ensureArray=function(t,e){return n(t)||(t=[]),t.length=e,t};var l={u1c:typeof Uint8ClampedArray>"u"?void 0:Uint8ClampedArray,i1:typeof Int8Array>"u"?void 0:Int8Array,u1:typeof Uint8Array>"u"?void 0:Uint8Array,i2:typeof Int16Array>"u"?void 0:Int16Array,u2:typeof Uint16Array>"u"?void 0:Uint16Array,i4:typeof Int32Array>"u"?void 0:Int32Array,u4:typeof Uint32Array>"u"?void 0:Uint32Array,f4:typeof Float32Array>"u"?void 0:Float32Array,f8:typeof Float64Array>"u"?void 0:Float64Array};function c(t){return t.constructor===ArrayBuffer}function u(t,e,r){if(s(t)){if(s(t[0])){for(var n=r,i=0;i2)return c[e]=2|c[e],p.set(t,null);if(h){for(o=e;o0)return Math.log(t)/Math.LN10;var n=Math.log(Math.min(e[0],e[1]))/Math.LN10;return r(n)||(n=Math.log(Math.max(e[0],e[1]))/Math.LN10-6),n}}}),z=f({"src/lib/relink_private.js"(t,e){var r=E().isArrayOrTypedArray,n=S();e.exports=function t(e,i){for(var a in i){var o=i[a],s=e[a];if(s!==o)if("_"===a.charAt(0)||"function"==typeof o){if(a in e)continue;e[a]=o}else if(r(o)&&r(s)&&n(o[0])){if("customdata"===a||"ids"===a)continue;for(var l=Math.min(o.length,s.length),c=0;ce/2?t-Math.round(t/e)*e:t}}}}),O=f({"node_modules/tinycolor2/tinycolor.js"(t,e){!function(t){var r=/^\s+/,n=/\s+$/,i=0,a=t.round,o=t.min,s=t.max,l=t.random;function c(e,l){if(l=l||{},(e=e||"")instanceof c)return e;if(!(this instanceof c))return new c(e,l);var u=function(e){var i={r:0,g:0,b:0},a=1,l=null,c=null,u=null,h=!1,p=!1;return"string"==typeof e&&(e=function(t){t=t.replace(r,"").replace(n,"").toLowerCase();var e,i=!1;if(S[t])t=S[t],i=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};return(e=N.rgb.exec(t))?{r:e[1],g:e[2],b:e[3]}:(e=N.rgba.exec(t))?{r:e[1],g:e[2],b:e[3],a:e[4]}:(e=N.hsl.exec(t))?{h:e[1],s:e[2],l:e[3]}:(e=N.hsla.exec(t))?{h:e[1],s:e[2],l:e[3],a:e[4]}:(e=N.hsv.exec(t))?{h:e[1],s:e[2],v:e[3]}:(e=N.hsva.exec(t))?{h:e[1],s:e[2],v:e[3],a:e[4]}:(e=N.hex8.exec(t))?{r:P(e[1]),g:P(e[2]),b:P(e[3]),a:R(e[4]),format:i?"name":"hex8"}:(e=N.hex6.exec(t))?{r:P(e[1]),g:P(e[2]),b:P(e[3]),format:i?"name":"hex"}:(e=N.hex4.exec(t))?{r:P(e[1]+""+e[1]),g:P(e[2]+""+e[2]),b:P(e[3]+""+e[3]),a:R(e[4]+""+e[4]),format:i?"name":"hex8"}:!!(e=N.hex3.exec(t))&&{r:P(e[1]+""+e[1]),g:P(e[2]+""+e[2]),b:P(e[3]+""+e[3]),format:i?"name":"hex"}}(e)),"object"==typeof e&&(U(e.r)&&U(e.g)&&U(e.b)?(i=function(t,e,r){return{r:255*I(t,255),g:255*I(e,255),b:255*I(r,255)}}(e.r,e.g,e.b),h=!0,p="%"===String(e.r).substr(-1)?"prgb":"rgb"):U(e.h)&&U(e.s)&&U(e.v)?(l=D(e.s),c=D(e.v),i=function(e,r,n){e=6*I(e,360),r=I(r,100),n=I(n,100);var i=t.floor(e),a=e-i,o=n*(1-r),s=n*(1-a*r),l=n*(1-(1-a)*r),c=i%6;return{r:255*[n,s,o,o,l,n][c],g:255*[l,n,n,s,o,o][c],b:255*[o,o,l,n,n,s][c]}}(e.h,l,c),h=!0,p="hsv"):U(e.h)&&U(e.s)&&U(e.l)&&(l=D(e.s),u=D(e.l),i=function(t,e,r){var n,i,a;function o(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}if(t=I(t,360),e=I(e,100),r=I(r,100),0===e)n=i=a=r;else{var s=r<.5?r*(1+e):r+e-r*e,l=2*r-s;n=o(l,s,t+1/3),i=o(l,s,t),a=o(l,s,t-1/3)}return{r:255*n,g:255*i,b:255*a}}(e.h,l,u),h=!0,p="hsl"),e.hasOwnProperty("a")&&(a=e.a)),a=C(a),{ok:h,format:e.format||p,r:o(255,s(i.r,0)),g:o(255,s(i.g,0)),b:o(255,s(i.b,0)),a}}(e);this._originalInput=e,this._r=u.r,this._g=u.g,this._b=u.b,this._a=u.a,this._roundA=a(100*this._a)/100,this._format=l.format||u.format,this._gradientType=l.gradientType,this._r<1&&(this._r=a(this._r)),this._g<1&&(this._g=a(this._g)),this._b<1&&(this._b=a(this._b)),this._ok=u.ok,this._tc_id=i++}function u(t,e,r){t=I(t,255),e=I(e,255),r=I(r,255);var n,i,a=s(t,e,r),l=o(t,e,r),c=(a+l)/2;if(a==l)n=i=0;else{var u=a-l;switch(i=c>.5?u/(2-a-l):u/(a+l),a){case t:n=(e-r)/u+(e>1)+720)%360;--e;)n.h=(n.h+i)%360,a.push(c(n));return a}function M(t,e){e=e||6;for(var r=c(t).toHsv(),n=r.h,i=r.s,a=r.v,o=[],s=1/e;e--;)o.push(c({h:n,s:i,v:a})),a=(a+s)%1;return o}c.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var e,r,n,i=this.toRgb();return e=i.r/255,r=i.g/255,n=i.b/255,.2126*(e<=.03928?e/12.92:t.pow((e+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:t.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:t.pow((n+.055)/1.055,2.4))},setAlpha:function(t){return this._a=C(t),this._roundA=a(100*this._a)/100,this},toHsv:function(){var t=h(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=h(this._r,this._g,this._b),e=a(360*t.h),r=a(100*t.s),n=a(100*t.v);return 1==this._a?"hsv("+e+", "+r+"%, "+n+"%)":"hsva("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=u(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=u(this._r,this._g,this._b),e=a(360*t.h),r=a(100*t.s),n=a(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+n+"%)":"hsla("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return p(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,r,n,i){var o=[z(a(t).toString(16)),z(a(e).toString(16)),z(a(r).toString(16)),z(O(n))];return i&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:a(this._r),g:a(this._g),b:a(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+a(this._r)+", "+a(this._g)+", "+a(this._b)+")":"rgba("+a(this._r)+", "+a(this._g)+", "+a(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:a(100*I(this._r,255))+"%",g:a(100*I(this._g,255))+"%",b:a(100*I(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+a(100*I(this._r,255))+"%, "+a(100*I(this._g,255))+"%, "+a(100*I(this._b,255))+"%)":"rgba("+a(100*I(this._r,255))+"%, "+a(100*I(this._g,255))+"%, "+a(100*I(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(E[p(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+f(this._r,this._g,this._b,this._a),r=e,n=this._gradientType?"GradientType = 1, ":"";if(t){var i=c(t);r="#"+f(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+e+",endColorstr="+r+")"},toString:function(t){var e=!!t;t=t||this._format;var r=!1,n=this._a<1&&this._a>=0;return e||!n||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(r=this.toRgbString()),"prgb"===t&&(r=this.toPercentageRgbString()),("hex"===t||"hex6"===t)&&(r=this.toHexString()),"hex3"===t&&(r=this.toHexString(!0)),"hex4"===t&&(r=this.toHex8String(!0)),"hex8"===t&&(r=this.toHex8String()),"name"===t&&(r=this.toName()),"hsl"===t&&(r=this.toHslString()),"hsv"===t&&(r=this.toHsvString()),r||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return c(this.toString())},_applyModification:function(t,e){var r=t.apply(null,[this].concat([].slice.call(e)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(y,arguments)},brighten:function(){return this._applyModification(v,arguments)},darken:function(){return this._applyModification(x,arguments)},desaturate:function(){return this._applyModification(d,arguments)},saturate:function(){return this._applyModification(m,arguments)},greyscale:function(){return this._applyModification(g,arguments)},spin:function(){return this._applyModification(_,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(k,arguments)},complement:function(){return this._applyCombination(b,arguments)},monochromatic:function(){return this._applyCombination(M,arguments)},splitcomplement:function(){return this._applyCombination(A,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(T,arguments)}},c.fromRatio=function(t,e){if("object"==typeof t){var r={};for(var n in t)t.hasOwnProperty(n)&&(r[n]="a"===n?t[n]:D(t[n]));t=r}return c(t,e)},c.equals=function(t,e){return!(!t||!e)&&c(t).toRgbString()==c(e).toRgbString()},c.random=function(){return c.fromRatio({r:l(),g:l(),b:l()})},c.mix=function(t,e,r){r=0===r?0:r||50;var n=c(t).toRgb(),i=c(e).toRgb(),a=r/100;return c({r:(i.r-n.r)*a+n.r,g:(i.g-n.g)*a+n.g,b:(i.b-n.b)*a+n.b,a:(i.a-n.a)*a+n.a})},c.readability=function(e,r){var n=c(e),i=c(r);return(t.max(n.getLuminance(),i.getLuminance())+.05)/(t.min(n.getLuminance(),i.getLuminance())+.05)},c.isReadable=function(t,e,r){var n,i,a=c.readability(t,e);switch(i=!1,n=function(t){var e,r;return"AA"!==(e=((t=t||{level:"AA",size:"small"}).level||"AA").toUpperCase())&&"AAA"!==e&&(e="AA"),"small"!==(r=(t.size||"small").toLowerCase())&&"large"!==r&&(r="small"),{level:e,size:r}}(r),n.level+n.size){case"AAsmall":case"AAAlarge":i=a>=4.5;break;case"AAlarge":i=a>=3;break;case"AAAsmall":i=a>=7}return i},c.mostReadable=function(t,e,r){var n,i,a,o,s=null,l=0;i=(r=r||{}).includeFallbackColors,a=r.level,o=r.size;for(var u=0;ul&&(l=n,s=c(e[u]));return c.isReadable(t,s,{level:a,size:o})||!i?s:(r.includeFallbackColors=!1,c.mostReadable(t,["#fff","#000"],r))};var S=c.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},E=c.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(S);function C(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function I(e,r){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(e)&&(e="100%");var n=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(e);return e=o(r,s(0,parseFloat(e))),n&&(e=parseInt(e*r,10)/100),t.abs(e-r)<1e-6?1:e%r/parseFloat(r)}function L(t){return o(1,s(0,t))}function P(t){return parseInt(t,16)}function z(t){return 1==t.length?"0"+t:""+t}function D(t){return t<=1&&(t=100*t+"%"),t}function O(e){return t.round(255*parseFloat(e)).toString(16)}function R(t){return P(t)/255}var F,B,j,N=(B="[\\s|\\(]+("+(F="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",j="[\\s|\\(]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",{CSS_UNIT:new RegExp(F),rgb:new RegExp("rgb"+B),rgba:new RegExp("rgba"+j),hsl:new RegExp("hsl"+B),hsla:new RegExp("hsla"+j),hsv:new RegExp("hsv"+B),hsva:new RegExp("hsva"+j),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function U(t){return!!N.CSS_UNIT.exec(t)}typeof e<"u"&&e.exports?e.exports=c:window.tinycolor=c}(Math)}}),R=f({"src/lib/extend.js"(t){var e=S(),r=Array.isArray;function n(t,i,a,o){var s,l,c,u,h,p,f,d=t[0],m=t.length;if(2===m&&r(d)&&r(t[1])&&0===d.length){if(f=function(t,e){var r,n;for(r=0;r=0)))return t;if(3===o)i[o]>1&&(i[o]=1);else if(i[o]>=1)return t}var s=Math.round(255*i[0])+", "+Math.round(255*i[1])+", "+Math.round(255*i[2]);return a?"rgba("+s+", "+i[3]+")":"rgb("+s+")"}a.tinyRGB=function(t){var e=t.toRgb();return"rgb("+Math.round(e.r)+", "+Math.round(e.g)+", "+Math.round(e.b)+")"},a.rgb=function(t){return a.tinyRGB(r(t))},a.opacity=function(t){return t?r(t).getAlpha():0},a.addOpacity=function(t,e){var n=r(t).toRgb();return"rgba("+Math.round(n.r)+", "+Math.round(n.g)+", "+Math.round(n.b)+", "+e+")"},a.combine=function(t,e){var n=r(t).toRgb();if(1===n.a)return r(t).toRgbString();var i=r(e||l).toRgb(),a=1===i.a?i:{r:255*(1-i.a)+i.r*i.a,g:255*(1-i.a)+i.g*i.a,b:255*(1-i.a)+i.b*i.a},o={r:a.r*(1-n.a)+n.r*n.a,g:a.g*(1-n.a)+n.g*n.a,b:a.b*(1-n.a)+n.b*n.a};return r(o).toRgbString()},a.interpolate=function(t,e,n){var i=r(t).toRgb(),a=r(e).toRgb(),o={r:n*i.r+(1-n)*a.r,g:n*i.g+(1-n)*a.g,b:n*i.b+(1-n)*a.b};return r(o).toRgbString()},a.contrast=function(t,e,n){var i=r(t);return 1!==i.getAlpha()&&(i=r(a.combine(t,l))),(i.isDark()?e?i.lighten(e):l:n?i.darken(n):s).toString()},a.stroke=function(t,e){var n=r(e);t.style({stroke:a.tinyRGB(n),"stroke-opacity":n.getAlpha()})},a.fill=function(t,e){var n=r(e);t.style({fill:a.tinyRGB(n),"fill-opacity":n.getAlpha()})},a.clean=function(t){if(t&&"object"==typeof t){var e,r,n,o,s=Object.keys(t);for(e=0;ei.max?r.set(n):r.set(+t)}},integer:{coerceFunction:function(t,r,n,i){-1===(i.extras||[]).indexOf(t)?(p(t)&&(t=f(t)),t%1||!e(t)||void 0!==i.min&&ti.max?r.set(n):r.set(+t)):r.set(t)}},string:{coerceFunction:function(t,e,r,n){if("string"!=typeof t){var i="number"==typeof t;!0!==n.strict&&i?e.set(String(t)):e.set(r)}else n.noBlank&&!t?e.set(r):e.set(t)}},color:{coerceFunction:function(t,e,n){p(t)&&(t=f(t)),r(t).isValid()?e.set(t):e.set(n)}},colorlist:{coerceFunction:function(t,e,n){Array.isArray(t)&&t.length&&t.every((function(t){return r(t).isValid()}))?e.set(t):e.set(n)}},colorscale:{coerceFunction:function(t,e,r){e.set(a.get(t,r))}},angle:{coerceFunction:function(t,r,n){p(t)&&(t=f(t)),"auto"===t?r.set("auto"):e(t)?r.set(u(+t,360)):r.set(n)}},subplotid:{coerceFunction:function(t,e,r,n){var i=n.regex||c(r);"string"==typeof t&&i.test(t)?e.set(t):e.set(r)},validateFunction:function(t,e){var r=e.dflt;return t===r||"string"==typeof t&&!!c(r).test(t)}},flaglist:{coerceFunction:function(t,e,r,n){if(-1===(n.extras||[]).indexOf(t))if("string"==typeof t){for(var i=t.split("+"),a=0;a/g),l=0;l1){var e=["LOG:"];for(t=0;t1){var i=[];for(t=0;t"),"long")}},i.warn=function(){var t;if(r.logging>0){var e=["WARN:"];for(t=0;t0){var i=[];for(t=0;t"),"stick")}},i.error=function(){var t;if(r.logging>0){var e=["ERROR:"];for(t=0;t0){var i=[];for(t=0;t"),"stick")}}}}),K=f({"src/lib/noop.js"(t,e){e.exports=function(){}}}),J=f({"src/lib/push_unique.js"(t,e){e.exports=function(t,e){if(e instanceof RegExp){for(var r=e.toString(),n=0;n0){for(var n=[],i=0;i=e&&n<=r?n:l}if("string"!=typeof n&&"number"!=typeof n)return l;n=String(n);var _=x(i),b=n.charAt(0);_&&("G"===b||"g"===b)&&(n=n.substr(1),i="");var w=_&&"chinese"===i.substr(0,7),T=n.match(w?y:g);if(!T)return l;var A=T[1],k=T[3]||"1",M=Number(T[5]||1),S=Number(T[7]||0),E=Number(T[9]||0),C=Number(T[11]||0);if(_){if(2===A.length)return l;var I;A=Number(A);try{var L=d.getComponentMethod("calendars","getCal")(i);if(w){var P="i"===k.charAt(k.length-1);k=parseInt(k,10),I=L.newDate(A,L.toMonthIndex(A,k,P),M)}else I=L.newDate(A,Number(k),M)}catch{return l}return I?(I.toJD()-f)*c+S*u+E*h+C*p:l}A=2===A.length?(Number(A)+2e3-v)%100+v:Number(A),k-=1;var z=new Date(Date.UTC(2e3,k,M,S,E));return z.setUTCFullYear(A),z.getUTCMonth()!==k||z.getUTCDate()!==M?l:z.getTime()+C*p},e=t.MIN_MS=t.dateTime2ms("-9999"),r=t.MAX_MS=t.dateTime2ms("9999-12-31 23:59:59.9999"),t.isDateTime=function(e,r){return t.dateTime2ms(e,r)!==l};var w=90*c,T=3*u,M=5*h;function S(t,e,r,n,i){if((e||r||n||i)&&(t+=" "+_(e,2)+":"+_(r,2),(n||i)&&(t+=":"+_(n,2),i))){for(var a=4;i%10==0;)a-=1,i/=10;t+="."+_(i,a)}return t}t.ms2DateTime=function(t,n,i){if("number"!=typeof t||!(t>=e&&t<=r))return l;n||(n=0);var a,s,g,y,v,_,b=Math.floor(10*o(t+.05,1)),A=Math.round(t-b/10);if(x(i)){var k=Math.floor(A/c)+f,E=Math.floor(o(t,c));try{a=d.getComponentMethod("calendars","getCal")(i).fromJD(k).formatDate("yyyy-mm-dd")}catch{a=m("G%Y-%m-%d")(new Date(A))}if("-"===a.charAt(0))for(;a.length<11;)a="-0"+a.substr(1);else for(;a.length<10;)a="0"+a;s=n=e+c&&t<=r-c))return l;var i=Math.floor(10*o(t+.05,1)),a=new Date(Math.round(t-i/10));return S(n("%Y-%m-%d")(a),a.getHours(),a.getMinutes(),a.getSeconds(),10*a.getUTCMilliseconds()+i)},t.cleanDate=function(e,r,n){if(e===l)return r;if(t.isJSDate(e)||"number"==typeof e&&isFinite(e)){if(x(n))return a.error("JS Dates and milliseconds are incompatible with world calendars",e),r;if(!(e=t.ms2DateTimeLocal(+e))&&void 0!==r)return r}else if(!t.isDateTime(e,n))return a.error("unrecognized date",e),r;return e};var E=/%\d?f/g,C=/%h/g,I={1:"1",2:"1",3:"2",4:"2"};function L(t,e,r,n){t=t.replace(E,(function(t){var r=Math.min(+t.charAt(1)||6,6);return(e/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"}));var i=new Date(Math.floor(e+.05));if(t=t.replace(C,(function(){return I[r("%q")(i)]})),x(n))try{t=d.getComponentMethod("calendars","worldCalFmt")(t,e,n)}catch{return"Invalid"}return r(t)(i)}var P=[59,59.9,59.99,59.999,59.9999];t.formatDate=function(t,e,r,n,a,s){if(a=x(a)&&a,!e)if("y"===r)e=s.year;else if("m"===r)e=s.month;else{if("d"!==r)return function(t,e){var r=o(t+.05,c),n=_(Math.floor(r/u),2)+":"+_(o(Math.floor(r/h),60),2);if("M"!==e){i(e)||(e=0);var a=(100+Math.min(o(t/p,60),P[e])).toFixed(e).substr(1);e>0&&(a=a.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+a}return n}(t,r)+"\n"+L(s.dayMonthYear,t,n,a);e=s.dayMonth+"\n"+s.year}return L(e,t,n,a)};var z=3*c;t.incrementMonth=function(t,e,r){r=x(r)&&r;var n=o(t,c);if(t=Math.round(t-n),r)try{var i=Math.round(t/c)+f,s=d.getComponentMethod("calendars","getCal")(r),l=s.fromJD(i);return e%12?s.add(l,e,"m"):s.add(l,e/12,"y"),(l.toJD()-f)*c+n}catch{a.error("invalid ms "+t+" in calendar "+r)}var u=new Date(t+z);return u.setUTCMonth(u.getUTCMonth()+e)+n-z},t.findExactDates=function(t,e){for(var r,n,a=0,o=0,s=0,l=0,u=x(e)&&d.getComponentMethod("calendars","getCal")(e),h=0;he}function c(t,e){return t>=e}t.findBin=function(t,n,i){if(e(n.start))return i?Math.ceil((t-n.start)/n.size-a)-1:Math.floor((t-n.start)/n.size+a);var u,h,p=0,f=n.length,d=0,m=f>1?(n[f-1]-n[0])/(f-1):1;for(h=m>=0?i?o:s:i?c:l,t+=m*a*(i?-1:1)*(m>=0?1:-1);p90&&r.log("Long binary search..."),p-1},t.sorterAsc=function(t,e){return t-e},t.sorterDes=function(t,e){return e-t},t.distinctVals=function(e){var r,n=e.slice();for(n.sort(t.sorterAsc),r=n.length-1;r>-1&&n[r]===i;r--);for(var a,o=n[r]-n[0]||1,s=o/(r||1)/1e4,l=[],c=0;c<=r;c++){var u=n[c],h=u-a;void 0===a?(l.push(u),a=u):h>s&&(o=Math.min(o,h),l.push(u),a=u)}return{vals:l,minDiff:o}},t.roundUp=function(t,e,r){for(var n,i=0,a=e.length-1,o=0,s=r?0:1,l=r?1:0,c=r?Math.ceil:Math.floor;i0&&(n=1),r&&n)return t.sort(e)}return n?t:t.reverse()},t.findIndexOfMin=function(t,e){e=e||n;for(var r,i=1/0,a=0;aa.length)&&(o=a.length),e(i)||(i=!1),r(a[0])){for(l=new Array(o),s=0;st.length-1)return t[t.length-1];var n=r%1;return n*t[Math.ceil(r)]+(1-n)*t[Math.floor(r)]}}}),Xt=f({"src/lib/angles.js"(t,e){var r=D(),n=r.mod,i=r.modHalf,a=Math.PI,o=2*a;function s(t){return Math.abs(t[1]-t[0])>o-1e-14}function l(t,e){return i(e-t,o)}function c(t,e){if(s(e))return!0;var r,i;e[0](i=n(i,o))&&(i+=o);var a=n(t,o),l=a+o;return a>=r&&a<=i||l>=r&&l<=i}function u(t,e,r,n,i,l,c){i=i||0,l=l||0;var u,h,p,f,d,m=s([r,n]);function g(t,e){return[t*Math.cos(e)+i,l-t*Math.sin(e)]}m?(u=0,h=a,p=o):r=i&&t<=a);var i,a},pathArc:function(t,e,r,n,i){return u(null,t,e,r,n,i,0)},pathSector:function(t,e,r,n,i){return u(null,t,e,r,n,i,1)},pathAnnulus:function(t,e,r,n,i,a){return u(t,e,r,n,i,a,1)}}}}),$t=f({"src/lib/anchor_utils.js"(t){t.isLeftAnchor=function(t){return"left"===t.xanchor||"auto"===t.xanchor&&t.x<=1/3},t.isCenterAnchor=function(t){return"center"===t.xanchor||"auto"===t.xanchor&&t.x>1/3&&t.x<2/3},t.isRightAnchor=function(t){return"right"===t.xanchor||"auto"===t.xanchor&&t.x>=2/3},t.isTopAnchor=function(t){return"top"===t.yanchor||"auto"===t.yanchor&&t.y>=2/3},t.isMiddleAnchor=function(t){return"middle"===t.yanchor||"auto"===t.yanchor&&t.y>1/3&&t.y<2/3},t.isBottomAnchor=function(t){return"bottom"===t.yanchor||"auto"===t.yanchor&&t.y<=1/3}}}),Kt=f({"src/lib/geometry2d.js"(t){var e,r,n,i=D().mod;function a(t,e,r,n,i,a,o,s){var l=r-t,c=i-t,u=o-i,h=n-e,p=a-e,f=s-a,d=l*f-u*h;if(0===d)return null;var m=(c*f-u*p)/d,g=(c*h-l*p)/d;return g<0||g>1||m<0||m>1?null:{x:t+l*m,y:e+h*m}}function o(t,e,r,n,i){var a=n*t+i*e;if(a<0)return n*n+i*i;if(a>r){var o=n-t,s=i-e;return o*o+s*s}var l=n*e-i*t;return l*l/r}t.segmentsIntersect=a,t.segmentDistance=function(t,e,r,n,i,s,l,c){if(a(t,e,r,n,i,s,l,c))return 0;var u=r-t,h=n-e,p=l-i,f=c-s,d=u*u+h*h,m=p*p+f*f,g=Math.min(o(u,h,d,i-t,s-e),o(u,h,d,l-t,c-e),o(p,f,m,t-i,e-s),o(p,f,m,r-i,n-s));return Math.sqrt(g)},t.getTextLocation=function(t,a,o,s){if((t!==r||s!==n)&&(e={},r=t,n=s),e[o])return e[o];var l=t.getPointAtLength(i(o-s/2,a)),c=t.getPointAtLength(i(o+s/2,a)),u=Math.atan((c.y-l.y)/(c.x-l.x)),h=t.getPointAtLength(i(o,a)),p={x:(4*h.x+l.x+c.x)/6,y:(4*h.y+l.y+c.y)/6,theta:u};return e[o]=p,p},t.clearLocationCache=function(){r=null},t.getVisibleSegment=function(t,e,r){var n,i,a=e.left,o=e.right,s=e.top,l=e.bottom,c=0,u=t.getTotalLength(),h=u;function p(e){var r=t.getPointAtLength(e);0===e?n=r:e===u&&(i=r);var c=r.xo?r.x-o:0,h=r.yl?r.y-l:0;return Math.sqrt(c*c+h*h)}for(var f=p(c);f;){if((c+=f+r)>h)return;f=p(c)}for(f=p(h);f;){if(c>(h-=f+r))return;f=p(h)}return{min:c,max:h,len:h-c,total:u,isClosed:0===c&&h===u&&Math.abs(n.x-i.x)<.1&&Math.abs(n.y-i.y)<.1}},t.findPointOnPath=function(t,e,r,n){for(var i,a,o,s=(n=n||{}).pathLength||t.getTotalLength(),l=n.tolerance||.001,c=n.iterationLimit||30,u=t.getPointAtLength(0)[r]>t.getPointAtLength(s)[r]?-1:1,h=0,p=0,f=s;h0?f=i:p=i,h++}return a}}}),Jt=f({"src/lib/throttle.js"(t){var e={};function r(t){t&&null!==t.timer&&(clearTimeout(t.timer),t.timer=null)}t.throttle=function(t,n,i){var a=e[t],o=Date.now();if(!a){for(var s in e)e[s].tsa.ts+n?l():a.timer=setTimeout((function(){l(),a.timer=null}),n)},t.done=function(t){var r=e[t];return r&&r.timer?new Promise((function(t){var e=r.onDone;r.onDone=function(){e&&e(),t(),r.onDone=null}})):Promise.resolve()},t.clear=function(n){if(n)r(e[n]),delete e[n];else for(var i in e)t.clear(i)}}}),Qt=f({"src/lib/clear_responsive.js"(t,e){e.exports=function(t){t._responsiveChartHandler&&(window.removeEventListener("resize",t._responsiveChartHandler),delete t._responsiveChartHandler)}}}),te=f({"node_modules/is-mobile/index.js"(t,e){e.exports=a,e.exports.isMobile=a,e.exports.default=a;var r=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,n=/CrOS/,i=/android|ipad|playbook|silk/i;function a(t){t||(t={});let e=t.ua;if(!e&&typeof navigator<"u"&&(e=navigator.userAgent),e&&e.headers&&"string"==typeof e.headers["user-agent"]&&(e=e.headers["user-agent"]),"string"!=typeof e)return!1;let a=r.test(e)&&!n.test(e)||!!t.tablet&&i.test(e);return!a&&t.tablet&&t.featureDetect&&navigator&&navigator.maxTouchPoints>1&&-1!==e.indexOf("Macintosh")&&-1!==e.indexOf("Safari")&&(a=!0),a}}}),ee=f({"src/lib/preserve_drawing_buffer.js"(t,e){var r=A(),n=te();e.exports=function(t){var e,i;if(t&&t.hasOwnProperty("userAgent")?e=t.userAgent:(typeof navigator<"u"&&(i=navigator.userAgent),i&&i.headers&&"string"==typeof i.headers["user-agent"]&&(i=i.headers["user-agent"]),e=i),"string"!=typeof e)return!0;var a=n({ua:{headers:{"user-agent":e}},tablet:!0,featureDetect:!1});if(!a)for(var o=e.split(" "),s=1;s-1;l--){var c=o[l];if("Version/"===c.substr(0,8)){var u=c.substr(8).split(".")[0];if(r(u)&&(u=+u),u>=13)return!0}}return a}}}),re=f({"src/lib/make_trace_groups.js"(t,e){var r=x();e.exports=function(t,e,n){var i=t.selectAll("g."+n.replace(/\s/g,".")).data(e,(function(t){return t[0].trace.uid}));i.exit().remove(),i.enter().append("g").attr("class",n),i.order();var a=t.classed("rangeplot")?"nodeRangePlot3":"node3";return i.each((function(t){t[0][a]=r.select(this)})),i}}}),ne=f({"src/lib/localize.js"(t,e){var r=qt();e.exports=function(t,e){for(var n=t._context.locale,i=0;i<2;i++){for(var a=t._context.locales,o=0;o<2;o++){var s=(a[n]||{}).dictionary;if(s){var l=s[e];if(l)return l}a=r.localeRegistry}var c=n.split("-")[0];if(c===n)break;n=c}return e}}}),ie=f({"src/lib/filter_unique.js"(t,e){e.exports=function(t){for(var e={},r=[],n=0,i=0;i1?(r*t+r*e)/r:t+e,i=String(n).length;if(i>16){var a=String(e).length;if(i>=String(t).length+a){var o=parseFloat(n).toPrecision(12);-1===o.indexOf("e+")&&(n=+o)}}return n}}}),se=f({"src/lib/clean_number.js"(t,e){var r=A(),n=k().BADNUM,i=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;e.exports=function(t){return"string"==typeof t&&(t=t.replace(i,"")),r(t)?Number(t):n}}}),le=f({"src/lib/index.js"(t,e){var r=x(),n=b().utcFormat,i=w().format,a=A(),o=k(),s=o.FP_SAFE,l=-s,c=o.BADNUM,u=e.exports={};u.adjustFormat=function(t){return!t||/^\d[.]\df/.test(t)||/[.]\d%/.test(t)?t:"0.f"===t?"~f":/^\d%/.test(t)?"~%":/^\ds/.test(t)?"~s":!/^[~,.0$]/.test(t)&&/[&fps]/.test(t)?"~"+t:t};var h={};u.warnBadFormat=function(t){var e=String(t);h[e]||(h[e]=1,u.warn('encountered bad format: "'+e+'"'))},u.noFormat=function(t){return String(t)},u.numberFormat=function(t){var e;try{e=i(u.adjustFormat(t))}catch{return u.warnBadFormat(t),u.noFormat}return e},u.nestedProperty=C(),u.keyedContainer=I(),u.relativeAttr=L(),u.isPlainObject=S(),u.toLogRange=P(),u.relinkPrivateKeys=z();var p=E();u.isArrayBuffer=p.isArrayBuffer,u.isTypedArray=p.isTypedArray,u.isArrayOrTypedArray=p.isArrayOrTypedArray,u.isArray1D=p.isArray1D,u.ensureArray=p.ensureArray,u.concat=p.concat,u.maxRowLength=p.maxRowLength,u.minRowLength=p.minRowLength;var f=D();u.mod=f.mod,u.modHalf=f.modHalf;var d=Z();u.valObjectMeta=d.valObjectMeta,u.coerce=d.coerce,u.coerce2=d.coerce2,u.coerceFont=d.coerceFont,u.coercePattern=d.coercePattern,u.coerceHoverinfo=d.coerceHoverinfo,u.coerceSelectionMarkerOpacity=d.coerceSelectionMarkerOpacity,u.validate=d.validate;var m=Ht();u.dateTime2ms=m.dateTime2ms,u.isDateTime=m.isDateTime,u.ms2DateTime=m.ms2DateTime,u.ms2DateTimeLocal=m.ms2DateTimeLocal,u.cleanDate=m.cleanDate,u.isJSDate=m.isJSDate,u.formatDate=m.formatDate,u.incrementMonth=m.incrementMonth,u.dateTick0=m.dateTick0,u.dfltRange=m.dfltRange,u.findExactDates=m.findExactDates,u.MIN_MS=m.MIN_MS,u.MAX_MS=m.MAX_MS;var g=Wt();u.findBin=g.findBin,u.sorterAsc=g.sorterAsc,u.sorterDes=g.sorterDes,u.distinctVals=g.distinctVals,u.roundUp=g.roundUp,u.sort=g.sort,u.findIndexOfMin=g.findIndexOfMin,u.sortObjectKeys=Zt();var y=Yt();u.aggNums=y.aggNums,u.len=y.len,u.mean=y.mean,u.geometricMean=y.geometricMean,u.median=y.median,u.midRange=y.midRange,u.variance=y.variance,u.stdev=y.stdev,u.interp=y.interp;var v=Ct();u.init2dArray=v.init2dArray,u.transposeRagged=v.transposeRagged,u.dot=v.dot,u.translationMatrix=v.translationMatrix,u.rotationMatrix=v.rotationMatrix,u.rotationXYMatrix=v.rotationXYMatrix,u.apply3DTransform=v.apply3DTransform,u.apply2DTransform=v.apply2DTransform,u.apply2DTransform2=v.apply2DTransform2,u.convertCssMatrix=v.convertCssMatrix,u.inverseTransformMatrix=v.inverseTransformMatrix;var _=Xt();u.deg2rad=_.deg2rad,u.rad2deg=_.rad2deg,u.angleDelta=_.angleDelta,u.angleDist=_.angleDist,u.isFullCircle=_.isFullCircle,u.isAngleInsideSector=_.isAngleInsideSector,u.isPtInsideSector=_.isPtInsideSector,u.pathArc=_.pathArc,u.pathSector=_.pathSector,u.pathAnnulus=_.pathAnnulus;var T=$t();u.isLeftAnchor=T.isLeftAnchor,u.isCenterAnchor=T.isCenterAnchor,u.isRightAnchor=T.isRightAnchor,u.isTopAnchor=T.isTopAnchor,u.isMiddleAnchor=T.isMiddleAnchor,u.isBottomAnchor=T.isBottomAnchor;var M=Kt();u.segmentsIntersect=M.segmentsIntersect,u.segmentDistance=M.segmentDistance,u.getTextLocation=M.getTextLocation,u.clearLocationCache=M.clearLocationCache,u.getVisibleSegment=M.getVisibleSegment,u.findPointOnPath=M.findPointOnPath;var O=R();u.extendFlat=O.extendFlat,u.extendDeep=O.extendDeep,u.extendDeepAll=O.extendDeepAll,u.extendDeepNoArrays=O.extendDeepNoArrays;var F=$();u.log=F.log,u.warn=F.warn,u.error=F.error;var B=W();u.counterRegex=B.counter;var j=Jt();u.throttle=j.throttle,u.throttleDone=j.done,u.clearThrottle=j.clear;var N=It();function U(t){var e={};for(var r in t)for(var n=t[r],i=0;is||t=e)&&a(t)&&t>=0&&t%1==0},u.noop=K(),u.identity=Gt(),u.repeat=function(t,e){for(var r=new Array(e),n=0;nr?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},u.bBoxIntersect=function(t,e,r){return r=r||0,t.left<=e.right+r&&e.left<=t.right+r&&t.top<=e.bottom+r&&e.top<=t.bottom+r},u.simpleMap=function(t,e,r,n,i){for(var a=t.length,o=new Array(a),s=0;s=Math.pow(2,r)?i>10?(u.warn("randstr failed uniqueness"),l):t(e,r,n,(i||0)+1):l},u.OptionControl=function(t,e){t||(t={}),e||(e="opt");var r={optionList:[],_newoption:function(n){n[e]=t,r[n.name]=n,r.optionList.push(n)}};return r["_"+e]=t,r},u.smooth=function(t,e){if((e=Math.round(e)||0)<2)return t;var r,n,i,a,o=t.length,s=2*o,l=2*e-1,c=new Array(l),u=new Array(o);for(r=0;r=s&&(i-=s*Math.floor(i/s)),i<0?i=-1-i:i>=o&&(i=s-1-i),a+=t[i]*c[n];u[r]=a}return u},u.syncOrAsync=function(t,e,r){var n;function i(){return u.syncOrAsync(t,e,r)}for(;t.length;)if((n=(0,t.splice(0,1)[0])(e))&&n.then)return n.then(i);return r&&r(e)},u.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},u.noneOrAll=function(t,e,r){if(t){var n,i=!1,a=!0;for(n=0;n0?e:0}))},u.fillArray=function(t,e,r,n){if(n=n||u.identity,u.isArrayOrTypedArray(t))for(var i=0;i1?i+o[1]:"";if(a&&(o.length>1||s.length>4||r))for(;n.test(s);)s=s.replace(n,"$1"+a+"$2");return s+l},u.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var tt=/^\w*$/;u.templateString=function(t,e){var r={};return t.replace(u.TEMPLATE_STRING_REGEX,(function(t,n){var i;return tt.test(n)?i=e[n]:(r[n]=r[n]||u.nestedProperty(e,n).get,i=r[n](!0)),void 0!==i?i:""}))};var et={max:10,count:0,name:"hovertemplate"};u.hovertemplateString=function(){return ot.apply(et,arguments)};var rt={max:10,count:0,name:"texttemplate"};u.texttemplateString=function(){return ot.apply(rt,arguments)};var nt=/^(\S+)([\*\/])(-?\d+(\.\d+)?)$/,it={max:10,count:0,name:"texttemplate",parseMultDiv:!0};u.texttemplateStringForShapes=function(){return ot.apply(it,arguments)};var at=/^[:|\|]/;function ot(t,e,r){var i=this,a=arguments;return e||(e={}),t.replace(u.TEMPLATE_STRING_REGEX,(function(t,o,s){var l="_xother"===o||"_yother"===o,c="_xother_"===o||"_yother_"===o,h="xother_"===o||"yother_"===o,p="xother"===o||"yother"===o||l||h||c,f=o;(l||c)&&(f=f.substring(1)),(h||c)&&(f=f.substring(0,f.length-1));var d,m,g,y=null,v=null;if(i.parseMultDiv){var x=function(t){var e=t.match(nt);return e?{key:e[1],op:e[2],number:Number(e[3])}:{key:t,op:null,number:null}}(f);f=x.key,y=x.op,v=x.number}if(p){if(void 0===(d=e[f]))return""}else for(g=3;g=48&&o<=57,c=s>=48&&s<=57;if(l&&(n=10*n+o-48),c&&(i=10*i+s-48),!l||!c){if(n!==i)return n-i;if(o!==s)return o-s}}return i-n};var st=2e9;u.seedPseudoRandom=function(){st=2e9},u.pseudoRandom=function(){var t=st;return st=(69069*st+1)%4294967296,Math.abs(st-t)<429496729?u.pseudoRandom():st/4294967296},u.fillText=function(t,e,r){var n=Array.isArray(r)?function(t){r.push(t)}:function(t){r.text=t},i=u.extractOption(t,e,"htx","hovertext");if(u.isValidTextValue(i))return n(i);var a=u.extractOption(t,e,"tx","text");return u.isValidTextValue(a)?n(a):void 0},u.isValidTextValue=function(t){return t||0===t},u.formatPercent=function(t,e){e=e||0;for(var r=(Math.round(100*t*Math.pow(10,e))*Math.pow(.1,e)).toFixed(e)+"%",n=0;n1&&(c=1):c=0,u.strTranslate(i-c*(r+o),a-c*(n+s))+u.strScale(c)+(l?"rotate("+l+(e?"":" "+r+" "+n)+")":"")},u.setTransormAndDisplay=function(t,e){t.attr("transform",u.getTextTransform(e)),t.style("display",e.scale?null:"none")},u.ensureUniformFontSize=function(t,e){var r=u.extendFlat({},e);return r.size=Math.max(e.size,t._fullLayout.uniformtext.minsize||0),r},u.join2=function(t,e,r){var n=t.length;return n>1?t.slice(0,-1).join(e)+r+t[n-1]:t.join(e)},u.bigFont=function(t){return Math.round(1.2*t)};var lt=u.getFirefoxVersion(),ct=null!==lt&<<86;u.getPositionFromD3Event=function(){return ct?[r.event.layerX,r.event.layerY]:[r.event.offsetX,r.event.offsetY]}}}),ce=f({"build/plotcss.js"(){var t,e,r=le(),n={"X,X div":'direction:ltr;font-family:"Open Sans",verdana,arial,sans-serif;margin:0;padding:0;',"X input,X button":'font-family:"Open Sans",verdana,arial,sans-serif;',"X input:focus,X button:focus":"outline:none;","X a":"text-decoration:none;","X a:hover":"text-decoration:none;","X .crisp":"shape-rendering:crispEdges;","X .user-select-none":"-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;","X svg a":"fill:#447adb;","X svg a:hover":"fill:#3c6dc5;","X .main-svg":"position:absolute;top:0;left:0;pointer-events:none;","X .main-svg .draglayer":"pointer-events:all;","X .cursor-default":"cursor:default;","X .cursor-pointer":"cursor:pointer;","X .cursor-crosshair":"cursor:crosshair;","X .cursor-move":"cursor:move;","X .cursor-col-resize":"cursor:col-resize;","X .cursor-row-resize":"cursor:row-resize;","X .cursor-ns-resize":"cursor:ns-resize;","X .cursor-ew-resize":"cursor:ew-resize;","X .cursor-sw-resize":"cursor:sw-resize;","X .cursor-s-resize":"cursor:s-resize;","X .cursor-se-resize":"cursor:se-resize;","X .cursor-w-resize":"cursor:w-resize;","X .cursor-e-resize":"cursor:e-resize;","X .cursor-nw-resize":"cursor:nw-resize;","X .cursor-n-resize":"cursor:n-resize;","X .cursor-ne-resize":"cursor:ne-resize;","X .cursor-grab":"cursor:-webkit-grab;cursor:grab;","X .modebar":"position:absolute;top:2px;right:2px;","X .ease-bg":"-webkit-transition:background-color .3s ease 0s;-moz-transition:background-color .3s ease 0s;-ms-transition:background-color .3s ease 0s;-o-transition:background-color .3s ease 0s;transition:background-color .3s ease 0s;","X .modebar--hover>:not(.watermark)":"opacity:0;-webkit-transition:opacity .3s ease 0s;-moz-transition:opacity .3s ease 0s;-ms-transition:opacity .3s ease 0s;-o-transition:opacity .3s ease 0s;transition:opacity .3s ease 0s;","X:hover .modebar--hover .modebar-group":"opacity:1;","X .modebar-group":"float:left;display:inline-block;box-sizing:border-box;padding-left:8px;position:relative;vertical-align:middle;white-space:nowrap;","X .modebar-btn":"position:relative;font-size:16px;padding:3px 4px;height:22px;cursor:pointer;line-height:normal;box-sizing:border-box;","X .modebar-btn svg":"position:relative;top:2px;","X .modebar.vertical":"display:flex;flex-direction:column;flex-wrap:wrap;align-content:flex-end;max-height:100%;","X .modebar.vertical svg":"top:-1px;","X .modebar.vertical .modebar-group":"display:block;float:none;padding-left:0px;padding-bottom:8px;","X .modebar.vertical .modebar-group .modebar-btn":"display:block;text-align:center;","X [data-title]:before,X [data-title]:after":"position:absolute;-webkit-transform:translate3d(0, 0, 0);-moz-transform:translate3d(0, 0, 0);-ms-transform:translate3d(0, 0, 0);-o-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);display:none;opacity:0;z-index:1001;pointer-events:none;top:110%;right:50%;","X [data-title]:hover:before,X [data-title]:hover:after":"display:block;opacity:1;","X [data-title]:before":'content:"";position:absolute;background:rgba(0,0,0,0);border:6px solid rgba(0,0,0,0);z-index:1002;margin-top:-12px;border-bottom-color:#69738a;margin-right:-6px;',"X [data-title]:after":"content:attr(data-title);background:#69738a;color:#fff;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;margin-right:-18px;border-radius:2px;","X .vertical [data-title]:before,X .vertical [data-title]:after":"top:0%;right:200%;","X .vertical [data-title]:before":"border:6px solid rgba(0,0,0,0);border-left-color:#69738a;margin-top:8px;margin-right:-30px;",Y:'font-family:"Open Sans",verdana,arial,sans-serif;position:fixed;top:50px;right:20px;z-index:10000;font-size:10pt;max-width:180px;',"Y p":"margin:0;","Y .notifier-note":"min-width:180px;max-width:250px;border:1px solid #fff;z-index:3000;margin:0;background-color:#8c97af;background-color:rgba(140,151,175,.9);color:#fff;padding:10px;overflow-wrap:break-word;word-wrap:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;","Y .notifier-close":"color:#fff;opacity:.8;float:right;padding:0 5px;background:none;border:none;font-size:20px;font-weight:bold;line-height:20px;","Y .notifier-close:hover":"color:#444;text-decoration:none;cursor:pointer;"};for(e in n)t=e.replace(/^,/," ,").replace(/X/g,".js-plotly-plot .plotly").replace(/Y/g,".plotly-notifier"),r.addStyleRule(t,n[e])}}),ue=f({"node_modules/is-browser/client.js"(t,e){e.exports=!0}}),he=f({"node_modules/has-hover/index.js"(t,e){var r,n=ue();r="function"==typeof window.matchMedia?!window.matchMedia("(hover: none)").matches:n,e.exports=r}}),pe=f({"node_modules/events/events.js"(t,e){var r,n="object"==typeof Reflect?Reflect:null,i=n&&"function"==typeof n.apply?n.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};r=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var a=Number.isNaN||function(t){return t!=t};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(t,e){return new Promise((function(r,n){function i(r){t.removeListener(e,a),n(r)}function a(){"function"==typeof t.removeListener&&t.removeListener("error",i),r([].slice.call(arguments))}g(t,e,a,{once:!0}),"error"!==e&&function(t,e){"function"==typeof t.on&&g(t,"error",e,{once:!0})}(t,i)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function l(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function c(t){return void 0===t._maxListeners?o.defaultMaxListeners:t._maxListeners}function u(t,e,r,n){var i,a,o;if(l(r),void 0===(a=t._events)?(a=t._events=Object.create(null),t._eventsCount=0):(void 0!==a.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),a=t._events),o=a[e]),void 0===o)o=a[e]=r,++t._eventsCount;else if("function"==typeof o?o=a[e]=n?[r,o]:[o,r]:n?o.unshift(r):o.push(r),(i=c(t))>0&&o.length>i&&!o.warned){o.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=t,s.type=e,s.count=o.length,function(t){console&&console.warn&&console.warn(t)}(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,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=h.bind(n);return i.listener=r,n.wrapFn=i,i}function f(t,e,r){var n=t._events;if(void 0===n)return[];var i=n[e];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(t){for(var e=new Array(t.length),r=0;r0&&(o=e[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var l=a[t];if(void 0===l)return!1;if("function"==typeof l)i(l,this,e);else{var c=l.length,u=m(l,c);for(r=0;r=0;a--)if(r[a]===e||r[a].listener===e){o=r[a].listener,i=a;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1=0;n--)this.removeListener(t,e[n]);return this},o.prototype.listeners=function(t){return f(this,t,!0)},o.prototype.rawListeners=function(t){return f(this,t,!1)},o.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):d.call(t,e)},o.prototype.listenerCount=d,o.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}}}),fe=f({"src/lib/events.js"(t,e){var r=pe().EventEmitter,n={init:function(t){if(t._ev instanceof r)return t;var e=new r,n=new r;return t._ev=e,t._internalEv=n,t.on=e.on.bind(e),t.once=e.once.bind(e),t.removeListener=e.removeListener.bind(e),t.removeAllListeners=e.removeAllListeners.bind(e),t._internalOn=n.on.bind(n),t._internalOnce=n.once.bind(n),t._removeInternalListener=n.removeListener.bind(n),t._removeAllInternalListeners=n.removeAllListeners.bind(n),t.emit=function(t,r){e.emit(t,r),n.emit(t,r)},t},triggerHandler:function(t,e,r){var n=t._ev;if(n){var i=n._events[e];if(i){var a;for(i=Array.isArray(i)?i:[i],a=0;an.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--))},startSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},stopSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},undo:function(t){var e,r;if(!(void 0===t.undoQueue||isNaN(t.undoQueue.index)||t.undoQueue.index<=0)){for(t.undoQueue.index--,e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;r=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;r=a.length)return!1;if(2===t.dimensions){if(r++,e.length===r)return t;var o=e[r];if(!x(o))return!1;t=a[i][o]}else t=a[i]}else t=a}}return t}function x(t){return t===Math.round(t)&&t>=0}function _(){var t,r,n={};for(t in c(n,i),e.subplotsRegistry)if((r=e.subplotsRegistry[t]).layoutAttributes)if(Array.isArray(r.attr))for(var a=0;a=a&&(i._input||{})._templateitemname;s&&(o=a);var l,c=r+"["+o+"]";function u(){l={},s&&(l[c]={},l[c][n]=s)}function h(t,r){s?e.nestedProperty(l[c],t).set(r):l[c+"."+t]=r}function p(){var t=l;return u(),t}return u(),{modifyBase:function(t,e){l[t]=e},modifyItem:h,getUpdateObj:p,applyUpdate:function(r,n){r&&h(r,n);var i=p();for(var a in i)e.nestedProperty(t,a).set(i[a])}}}}}),ve=f({"src/plots/cartesian/constants.js"(t,e){var r=W().counter;e.exports={idRegex:{x:r("x","( domain)?"),y:r("y","( domain)?")},attrRegex:r("[xy]axis"),xAxisMatch:r("xaxis"),yAxisMatch:r("yaxis"),AX_ID_PATTERN:/^[xyz][0-9]*( domain)?$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,SUBPLOT_PATTERN:/^x([0-9]*)y([0-9]*)$/,HOUR_PATTERN:"hour",WEEKDAY_PATTERN:"day of week",MINDRAG:8,MINZOOM:20,DRAGGERSIZE:20,REDRAWDELAY:50,DFLTRANGEX:[-1,6],DFLTRANGEY:[-1,4],traceLayerClasses:["imagelayer","heatmaplayer","contourcarpetlayer","contourlayer","funnellayer","waterfalllayer","barlayer","carpetlayer","violinlayer","boxlayer","ohlclayer","scattercarpetlayer","scatterlayer"],clipOnAxisFalseQuery:[".scatterlayer",".barlayer",".funnellayer",".waterfalllayer"],layerValue2layerClass:{"above traces":"above","below traces":"below"},zindexSeparator:"z"}}}),xe=f({"src/plots/cartesian/axis_ids.js"(t){var e=qt(),r=ve();function n(t,e){if(e&&e.length)for(var r=0;rn?1:-1:+(t.substr(1)||1)-+(e.substr(1)||1)},t.ref2id=function(t){return!!/^[xyz]/.test(t)&&t.split(" ")[0]},t.isLinked=function(t,e){return n(e,t._axisMatchGroups)||n(e,t._axisConstraintGroups)}}}),_e=f({"src/components/shapes/handle_outline.js"(t,e){e.exports={clearOutlineControllers:function(t){var e=t._fullLayout._zoomlayer;e&&e.selectAll(".outline-controllers").remove()},clearOutline:function(t){var e=t._fullLayout._zoomlayer;e&&e.selectAll(".select-outline").remove(),t._fullLayout._outlining=!1}}}}),be=f({"src/traces/scatter/layout_attributes.js"(t,e){e.exports={scattermode:{valType:"enumerated",values:["group","overlay"],dflt:"overlay",editType:"calc"},scattergap:{valType:"number",min:0,max:1,editType:"calc"}}}}),we=f({"src/plots/get_data.js"(t){var e=qt();ve().SUBPLOT_PATTERN,t.getSubplotCalcData=function(t,r,n){var i=e.subplotsRegistry[r];if(!i)return[];for(var a=i.attr,o=[],s=0;s0?".":"")+a;r.isPlainObject(s)?o(s,e,l,i+1):e(l,a,s)}}))}t.manageCommandObserver=function(e,i,a,o){var s={},l=!0;i&&i._commandObserver&&(s=i._commandObserver),s.cache||(s.cache={}),s.lookupTable={};var c=t.hasSimpleAPICommandBindings(e,a,s.lookupTable);if(i&&i._commandObserver){if(c)return s;if(i._commandObserver.remove)return i._commandObserver.remove(),i._commandObserver=null,s}if(c){n(e,c,s.cache),s.check=function(){if(l){var t=n(e,c,s.cache);return t.changed&&o&&void 0!==s.lookupTable[t.value]&&(s.disable(),Promise.resolve(o({value:t.value,type:c.type,prop:c.prop,traces:c.traces,index:s.lookupTable[t.value]})).then(s.enable,s.enable)),t.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],h=0;h=e.width-20?(a["text-anchor"]="start",a.x=5):(a["text-anchor"]="end",a.x=e._paper.attr("width")-7),n.attr(a);var o=n.select(".js-link-to-tool"),s=n.select(".js-link-spacer"),l=n.select(".js-sourcelinks");t._context.showSources&&t._context.showSources(t),t._context.showLink&&function(t,e){e.text("");var r=e.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(t._context.linkText+" »");if(t._context.sendData)r.on("click",(function(){S.sendDataToCloud(t)}));else{var n=window.location.pathname.split("/"),i=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+i})}}(t,o),s.text(o.text()&&l.text()?" - ":"")}},S.sendDataToCloud=function(t){var e=(window.PLOTLYENV||{}).BASE_URL||t._context.plotlyServerURL;if(e){t.emit("plotly_beforeexport");var n=r.select(t).append("div").attr("id","hiddenform").style("display","none"),i=n.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return i.append("input").attr({type:"text",name:"data"}).node().value=S.graphJson(t,!1,"keepdata"),i.node().submit(),n.remove(),t.emit("plotly_afterexport"),!1}};var C=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],I=["year","month","dayMonth","dayMonthYear"];function L(t,e){var r=t._context.locale;r||(r="en-US");var n=!1,i={};function a(t){for(var r=!0,a=0;a1&&z.length>1){for(s.getComponentMethod("grid","sizeDefaults")(c,l),o=0;o15&&z.length>15&&0===l.shapes.length&&0===l.images.length,S.linkSubplots(p,l,h,a),S.cleanPlot(p,l,h,a);var j=!(!a._has||!a._has("cartesian")),N=!(!l._has||!l._has("cartesian"));j&&!N?a._bgLayer.remove():N&&!j&&(l._shouldCreateBgLayer=!0),a._zoomlayer&&!t._dragging&&d({_fullLayout:a}),function(t,e){var r,n=[];e.meta&&(r=e._meta={meta:e.meta,layout:{meta:e.meta}});for(var i=0;i0){var h=1-2*s;n=Math.round(h*n),i=Math.round(h*i)}}var p=S.layoutAttributes.width.min,f=S.layoutAttributes.height.min;n1,m=!e.height&&Math.abs(r.height-i)>1;(m||d)&&(d&&(r.width=n),m&&(r.height=i)),t._initialAutoSize||(t._initialAutoSize={width:n,height:i}),S.sanitizeMargins(r)},S.supplyLayoutModuleDefaults=function(t,e,r,n){var i,a,o,l=s.componentsRegistry,c=e._basePlotModules,h=s.subplotsRegistry.cartesian;for(i in l)(o=l[i]).includeBasePlot&&o.includeBasePlot(t,e);for(var p in c.length||c.push(h),e._has("cartesian")&&(s.getComponentMethod("grid","contentDefaults")(t,e),h.finalizeSubplots(t,e)),e._subplots)e._subplots[p].sort(u.subplotSort);for(a=0;a1&&(r.l/=y,r.r/=y)}if(f){var v=(r.t+r.b)/f;v>1&&(r.t/=v,r.b/=v)}var x=void 0!==r.xl?r.xl:r.x,_=void 0!==r.xr?r.xr:r.x,b=void 0!==r.yt?r.yt:r.y,w=void 0!==r.yb?r.yb:r.y;d[e]={l:{val:x,size:r.l+g},r:{val:_,size:r.r+g},b:{val:w,size:r.b+g},t:{val:b,size:r.t+g}},m[e]=1}else delete d[e],delete m[e];if(!n._replotting)return S.doAutoMargin(t)}},S.doAutoMargin=function(t){var e=t._fullLayout,r=e.width,n=e.height;e._size||(e._size={}),D(e);var i=e._size,o=e.margin,l={t:0,b:0,l:0,r:0},c=u.extendFlat({},i),h=o.l,p=o.r,d=o.t,m=o.b,g=e._pushmargin,y=e._pushmarginIds,v=e.minreducedwidth,x=e.minreducedheight;if(!1!==o.autoexpand){for(var _ in g)y[_]||delete g[_];var b=t._fullLayout._reservedMargin;for(var w in b)for(var T in b[w]){var A=b[w][T];l[T]=Math.max(l[T],A)}for(var k in g.base={l:{val:0,size:h},r:{val:1,size:p},t:{val:1,size:d},b:{val:0,size:m}},l){var M=0;for(var E in g)"base"!==E&&a(g[E][k].size)&&(M=g[E][k].size>M?g[E][k].size:M);var C=Math.max(0,o[k]-M);l[k]=Math.max(0,l[k]-C)}for(var I in g){var L=g[I].l||{},P=g[I].b||{},z=L.val,O=L.size,R=P.val,F=P.size,B=r-l.r-l.l,j=n-l.t-l.b;for(var N in g){if(a(O)&&g[N].r){var U=g[N].r.val,V=g[N].r.size;if(U>z){var q=(O*U+(V-B)*z)/(U-z),H=(V*(1-z)+(O-B)*(1-U))/(U-z);q+H>h+p&&(h=q,p=H)}}if(a(F)&&g[N].t){var G=g[N].t.val,W=g[N].t.size;if(G>R){var Z=(F*G+(W-j)*R)/(G-R),Y=(W*(1-R)+(F-j)*(1-G))/(G-R);Z+Y>m+d&&(m=Z,d=Y)}}}}}var X=u.constrain(r-o.l-o.r,2,v),$=u.constrain(n-o.t-o.b,2,x),K=Math.max(0,r-X),J=Math.max(0,n-$);if(K){var Q=(h+p)/K;Q>1&&(h/=Q,p/=Q)}if(J){var tt=(m+d)/J;tt>1&&(m/=tt,d/=tt)}if(i.l=Math.round(h)+l.l,i.r=Math.round(p)+l.r,i.t=Math.round(d)+l.t,i.b=Math.round(m)+l.b,i.p=Math.round(o.pad),i.w=Math.round(r)-i.l-i.r,i.h=Math.round(n)-i.t-i.b,!e._replotting&&(S.didMarginChange(c,i)||function(t){if("_redrawFromAutoMarginCount"in t._fullLayout)return!1;var e=f.list(t,"",!0);for(var r in e)if(e[r].autoshift||e[r].shift)return!0;return!1}(t))){"_redrawFromAutoMarginCount"in e?e._redrawFromAutoMarginCount++:e._redrawFromAutoMarginCount=1;var et=3*(1+Object.keys(y).length);if(e._redrawFromAutoMarginCount0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push((function(){n=!0})),r.redraw&&t._transitionData._interruptCallbacks.push((function(){return s.call("redraw",t)})),t._transitionData._interruptCallbacks.push((function(){t.emit("plotly_transitioninterrupted",[])}));var a=0,o=0;function l(){return a++,function(){o++,!n&&o===a&&function(e){t._transitionData&&(function(t){if(t)for(;t.length;)t.shift()}(t._transitionData._interruptCallbacks),Promise.resolve().then((function(){if(r.redraw)return s.call("redraw",t)})).then((function(){t._transitioning=!1,t._transitioningWithDuration=!1,t.emit("plotly_transitioned",[])})).then(e))}(i)}}r.runFn(l),setTimeout(l())}))}],a=u.syncOrAsync(i,t);return(!a||!a.then)&&(a=Promise.resolve()),a.then((function(){return t}))}S.didMarginChange=function(t,e){for(var r=0;r1)return!0}return!1},S.graphJson=function(t,e,r,n,i,a){(i&&e&&!t._fullData||i&&!e&&!t._fullLayout)&&S.supplyDefaults(t);var s=i?t._fullData:t.data,l=i?t._fullLayout:t.layout,c=(t._transitionData||{})._frames;function h(t,e){if("function"==typeof t)return e?"_function_":null;if(u.isPlainObject(t)){var n,i={};return Object.keys(t).sort().forEach((function(a){if(-1===["_","["].indexOf(a.charAt(0))){if("function"==typeof t[a])return void(e&&(i[a]="_function"));if("keepdata"===r){if("src"===a.substr(a.length-3))return}else if("keepstream"===r){if("string"==typeof(n=t[a+"src"])&&n.indexOf(":")>0&&!u.isPlainObject(t.stream))return}else if("keepall"!==r&&"string"==typeof(n=t[a+"src"])&&n.indexOf(":")>0)return;i[a]=h(t[a],e)}})),i}var a=Array.isArray(t),s=u.isTypedArray(t);if((a||s)&&t.dtype&&t.shape){var l=t.bdata;return h({dtype:t.dtype,shape:t.shape,bdata:u.isArrayBuffer(l)?o.encode(l):l},e)}return a?t.map((function(t){return h(t,e)})):s?u.simpleMap(t,u.identity):u.isJSDate(t)?u.ms2DateTimeLocal(+t):t}var p={data:(s||[]).map((function(t){var r=h(t);return e&&delete r.fit,r}))};if(!e&&(p.layout=h(l),i)){var f=l._size;p.layout.computed={margin:{b:f.b,l:f.l,r:f.r,t:f.t}}}return c&&(p.frames=h(c)),a&&(p.config=h(t._context,!0)),"object"===n?p:JSON.stringify(p)},S.modifyFrames=function(t,e){var r,n,i,a=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r=0;a--)if(s[a].enabled){r._indexToPoints=s[a]._indexToPoints;break}n&&n.calc&&(o=n.calc(t,r))}(!Array.isArray(o)||!o[0])&&(o=[{x:p,y:p}]),o[0].t||(o[0].t={}),o[0].trace=r,d[e]=o}}for(j(o,c,h),i=0;il||m>c)&&(o.style("overflow","hidden"),f=(p=o.node().getBoundingClientRect()).width,m=p.height);var g=+d.attr("x"),y=+d.attr("y"),v=-(i||d.node().getBoundingClientRect().height)/4;if("y"===P[0])s.attr({transform:"rotate("+[-90,g,y]+")"+n(-f/2,v-m/2)});else if("l"===P[0])y=v-m/2;else if("a"===P[0]&&0!==P.indexOf("atitle"))g=0,y=v;else{var x=d.attr("text-anchor");g-=f*("middle"===x?.5:"end"===x?1:0),y=y+v-m/2}o.attr({x:g,y}),M&&M.call(d,s),t(s)}))}))):z(),d}function z(){L.empty()||(P=d.attr("class")+"-math",L.select("svg."+P).remove()),d.text("").style("white-space","pre");var n=function(t,n){n=n.replace(m," ");var o,s=!1,l=[],c=-1;function d(){c++;var r=document.createElementNS(i.svg,"tspan");e.select(r).attr({class:"line",dy:c*a+"em"}),t.appendChild(r),o=r;var n=l;if(l=[{node:r}],n.length>1)for(var s=1;s doesnt match end tag <"+t+">. Pretending it did match.",n),o=l[l.length-1].node}else r.log("Ignoring unexpected end tag .",n)}v.test(n)?d():(o=t,l=[{node:t}]);for(var I=n.split(g),L=0;L|>|>)/g,c=[["$","$"],["\\(","\\)"]],u={sup:"font-size:70%",sub:"font-size:70%",s:"text-decoration:line-through",u:"text-decoration:underline",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},h={sub:"0.3em",sup:"-0.6em"},p={sub:"-0.21em",sup:"0.42em"},f="​",d=["http:","https:","mailto:","",void 0,":"],m=t.NEWLINES=/(\r\n?|\n)/g,g=/(<[^<>]*>)/,y=/<(\/?)([^ >]*)(\s+(.*))?>/i,v=//i;t.BR_TAG_ALL=//gi;var _=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,b=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,w=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,T=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function A(t,e){if(!t)return null;var r=t.match(e),n=r&&(r[3]||r[4]);return n&&E(n)}var k=/(^|;)\s*color:/;t.plainText=function(t,e){for(var r=void 0!==(e=e||{}).len&&-1!==e.len?e.len:1/0,n=void 0!==e.allowedTags?e.allowedTags:["br"],i=t.split(g),a=[],o="",s=0,l=0;l3?a.push(c.substr(0,f-3)+"..."):a.push(c.substr(0,f));break}o=""}}return a.join("")};var M={mu:"μ",amp:"&",lt:"<",gt:">",nbsp:" ",times:"×",plusmn:"±",deg:"°"},S=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function E(t){return t.replace(S,(function(t,e){var r;return r="#"===e.charAt(0)?function(t){if(!(t>1114111)){var e=String.fromCodePoint;if(e)return e(t);var r=String.fromCharCode;return t<=65535?r(t):r(55232+(t>>10),t%1024+56320)}}("x"===e.charAt(1)?parseInt(e.substr(2),16):parseInt(e.substr(1),10)):M[e],r||t}))}function C(t){var e=encodeURI(decodeURI(t)),r=document.createElement("a"),n=document.createElement("a");r.href=t,n.href=e;var i=r.protocol,a=n.protocol;return-1!==d.indexOf(i)&&-1!==d.indexOf(a)?e:""}function I(t,e,n){var i,a,o,s=n.horizontalAlign,l=n.verticalAlign||"top",c=t.node().getBoundingClientRect(),u=e.node().getBoundingClientRect();return a="bottom"===l?function(){return c.bottom-i.height}:"middle"===l?function(){return c.top+(c.height-i.height)/2}:function(){return c.top},o="right"===s?function(){return c.right-i.width}:"center"===s?function(){return c.left+(c.width-i.width)/2}:function(){return c.left},function(){i=this.node().getBoundingClientRect();var t=o()-u.left,e=a()-u.top,s=n.gd||{};if(n.gd){s._fullLayout._calcInverseTransform(s);var l=r.apply3DTransform(s._fullLayout._invTransform)(t,e);t=l[0],e=l[1]}return this.style({top:e+"px",left:t+"px","z-index":1e3}),this}}t.convertEntities=E,t.sanitizeHTML=function(t){t=t.replace(m," ");for(var r=document.createElement("p"),n=r,i=[],a=t.split(g),o=0;o=0;n--,i++){var a=t[n];r[i]=[1-a[0],a[1]]}return r}function f(t,e){e=e||{};for(var a=t.domain,s=t.range,l=s.length,c=new Array(l),u=0;um-f?f=m-(d-m):d-m=0?s.colorscale.sequential:s.colorscale.sequentialminus,h._sync("colorscale",o))}}}),Ze=f({"src/components/colorscale/index.js"(t,e){var r=V(),n=Ee();e.exports={moduleType:"component",name:"colorscale",attributes:Pe(),layoutAttributes:ze(),supplyLayoutDefaults:He(),handleDefaults:qe(),crossTraceDefaults:Ge(),calc:We(),scales:r.scales,defaultScale:r.defaultScale,getScale:r.get,isValidScale:r.isValid,hasColorscale:n.hasColorscale,extractOpts:n.extractOpts,extractScale:n.extractScale,flipScale:n.flipScale,makeColorScaleFunc:n.makeColorScaleFunc,makeColorScaleFuncFromTrace:n.makeColorScaleFuncFromTrace}}}),Ye=f({"src/traces/scatter/subtypes.js"(t,e){var r=le(),n=E().isTypedArraySpec;e.exports={hasLines:function(t){return t.visible&&t.mode&&-1!==t.mode.indexOf("lines")},hasMarkers:function(t){return t.visible&&(t.mode&&-1!==t.mode.indexOf("markers")||"splom"===t.type)},hasText:function(t){return t.visible&&t.mode&&-1!==t.mode.indexOf("text")},isBubble:function(t){var e=t.marker;return r.isPlainObject(e)&&(r.isArrayOrTypedArray(e.size)||n(e.size))}}}}),Xe=f({"src/traces/scatter/make_bubble_size_func.js"(t,e){var r=A();e.exports=function(t,e){e||(e=2);var n=t.marker,i=n.sizeref||1,a=n.sizemin||0,o="area"===n.sizemode?function(t){return Math.sqrt(t/i)}:function(t){return t/i};return function(t){var n=o(t/e);return r(n)&&n>0?Math.max(n,a):0}}}}),$e=f({"src/components/fx/helpers.js"(t){var e=le();t.getSubplot=function(t){return t.subplot||t.xaxis+t.yaxis||t.geo},t.isTraceInSubplots=function(e,r){if("splom"===e.type){for(var n=e.xaxes||[],i=e.yaxes||[],a=0;a=0&&r.index2&&(e.push([n].concat(a.splice(0,2))),o="l",n="m"==n?"l":"L");;){if(a.length==r[o])return a.unshift(n),e.push(a);if(a.length=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}v.symbolNumber=function(t){if(a(t))t=+t;else if("string"==typeof t){var e=0;t.indexOf("-open")>0&&(e=100,t=t.replace("-open","")),t.indexOf("-dot")>0&&(e+=200,t=t.replace("-dot","")),(t=v.symbolNames.indexOf(t))>=0&&(t+=e)}return t%100>=k||t>=400?0:Math.floor(Math.max(t,0))};var S=i("~f"),E={radial:{type:"radial"},radialreversed:{type:"radial",reversed:!0},horizontal:{type:"linear",start:{x:1,y:0},stop:{x:0,y:0}},horizontalreversed:{type:"linear",start:{x:1,y:0},stop:{x:0,y:0},reversed:!0},vertical:{type:"linear",start:{x:0,y:1},stop:{x:0,y:0}},verticalreversed:{type:"linear",start:{x:0,y:1},stop:{x:0,y:0},reversed:!0}};function C(t,e,i,a,s,c,u,h,p,f){var d,m=s.length;"linear"===a?d={node:"linearGradient",attrs:{x1:u.x,y1:u.y,x2:h.x,y2:h.y,gradientUnits:p?"userSpaceOnUse":"objectBoundingBox"},reversed:f}:"radial"===a&&(d={node:"radialGradient",reversed:f});for(var g=new Array(m),y=0;y=0&&void 0===t.i&&(t.i=o.i),e.style("opacity",i.selectedOpacityFn?i.selectedOpacityFn(t):void 0===t.mo?s.opacity:t.mo),i.ms2mrc){var u;u="various"===t.ms||"various"===s.size?3:i.ms2mrc(t.ms),t.mrc=u,i.selectedSizeFn&&(u=t.mrc=i.selectedSizeFn(t));var h=v.symbolNumber(t.mx||s.symbol)||0;t.om=h%200>=100;var p=st(t,r),f=$(t,r);e.attr("d",M(h,u,p,f))}var d,m,g,y=!1;if(t.so)g=c.outlierwidth,m=c.outliercolor,d=s.outliercolor;else{var x=(c||{}).width;g=(t.mlw+1||x+1||(t.trace?(t.trace.marker.line||{}).width:0)+1)-1||0,m="mlc"in t?t.mlcc=i.lineScale(t.mlc):n.isArrayOrTypedArray(c.color)?l.defaultLine:c.color,n.isArrayOrTypedArray(s.color)&&(d=l.defaultLine,y=!0),d="mc"in t?t.mcc=i.markerScale(t.mc):s.color||s.colors||"rgba(0,0,0,0)",i.selectedColorFn&&(d=i.selectedColorFn(t))}if(t.om)e.call(l.stroke,d).style({"stroke-width":(g||1)+"px",fill:"none"});else{e.style("stroke-width",(t.isBlank?0:g)+"px");var _=s.gradient,b=t.mgt;b?y=!0:b=_&&_.type,n.isArrayOrTypedArray(b)&&(b=b[0],E[b]||(b=0));var w=s.pattern,T=w&&v.getPatternAttr(w.shape,t.i,"");if(b&&"none"!==b){var A=t.mgc;A?y=!0:A=_.color;var k=r.uid;y&&(k+="-"+t.i),v.gradient(e,a,k,b,[[0,A],[1,d]],"fill")}else if(T){var S=!1,C=w.fgcolor;!C&&o&&o.color&&(C=o.color,S=!0);var I=v.getPatternAttr(C,t.i,o&&o.color||null),L=v.getPatternAttr(w.bgcolor,t.i,null),P=w.fgopacity,z=v.getPatternAttr(w.size,t.i,8),D=v.getPatternAttr(w.solidity,t.i,.3);S=S||t.mcc||n.isArrayOrTypedArray(w.shape)||n.isArrayOrTypedArray(w.bgcolor)||n.isArrayOrTypedArray(w.fgcolor)||n.isArrayOrTypedArray(w.size)||n.isArrayOrTypedArray(w.solidity);var O=r.uid;S&&(O+="-"+t.i),v.pattern(e,"point",a,O,T,z,D,t.mcc,w.fillmode,L,I,P)}else n.isArrayOrTypedArray(d)?l.fill(e,d[t.i]):l.fill(e,d);g&&l.stroke(e,m)}},v.makePointStyleFns=function(t){var e={},r=t.marker;return e.markerScale=v.tryColorscale(r,""),e.lineScale=v.tryColorscale(r,"line"),s.traceIs(t,"symbols")&&(e.ms2mrc=m.isBubble(t)?g(t):function(){return(r.size||6)/2}),t.selectedpoints&&n.extendFlat(e,v.makeSelectedPointStyleFns(t)),e},v.makeSelectedPointStyleFns=function(t){var e={},r=t.selected||{},i=t.unselected||{},a=t.marker||{},o=r.marker||{},l=i.marker||{},c=a.opacity,u=o.opacity,h=l.opacity,p=void 0!==u,f=void 0!==h;(n.isArrayOrTypedArray(c)||p||f)&&(e.selectedOpacityFn=function(t){var e=void 0===t.mo?a.opacity:t.mo;return t.selected?p?u:e:f?h:d*e});var m=a.color,g=o.color,y=l.color;(g||y)&&(e.selectedColorFn=function(t){var e=t.mcc||m;return t.selected?g||e:y||e});var v=a.size,x=o.size,_=l.size,b=void 0!==x,w=void 0!==_;return s.traceIs(t,"symbols")&&(b||w)&&(e.selectedSizeFn=function(t){var e=t.mrc||v/2;return t.selected?b?x/2:e:w?_/2:e}),e},v.makeSelectedTextStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},i=t.textfont||{},a=r.textfont||{},o=n.textfont||{},s=i.color,c=a.color,u=o.color;return e.selectedTextColorFn=function(t){var e=t.tc||s;return t.selected?c||e:u||(c?e:l.addOpacity(e,d))},e},v.selectedPointStyle=function(t,e){if(t.size()&&e.selectedpoints){var n=v.makeSelectedPointStyleFns(e),i=e.marker||{},a=[];n.selectedOpacityFn&&a.push((function(t,e){t.style("opacity",n.selectedOpacityFn(e))})),n.selectedColorFn&&a.push((function(t,e){l.fill(t,n.selectedColorFn(e))})),n.selectedSizeFn&&a.push((function(t,r){var a=r.mx||i.symbol||0,o=n.selectedSizeFn(r);t.attr("d",M(v.symbolNumber(a),o,st(r,e),$(r,e))),r.mrc2=o})),a.length&&t.each((function(t){for(var e=r.select(this),n=0;n0?r:0}function R(t,e,r){return r&&(t=V(t)),e?B(t[1]):F(t[0])}function F(t){var e=r.round(t,2);return I=e,e}function B(t){var e=r.round(t,2);return L=e,e}function j(t,e,r,n){var i=t[0]-e[0],a=t[1]-e[1],o=r[0]-e[0],s=r[1]-e[1],l=Math.pow(i*i+a*a,.25),c=Math.pow(o*o+s*s,.25),u=(c*c*i-l*l*o)*n,h=(c*c*a-l*l*s)*n,p=3*c*(l+c),f=3*l*(l+c);return[[F(e[0]+(p&&u/p)),B(e[1]+(p&&h/p))],[F(e[0]-(f&&u/f)),B(e[1]-(f&&h/f))]]}v.textPointStyle=function(t,e,i){if(t.size()){var a;if(e.selectedpoints){var o=v.makeSelectedTextStyleFns(e);a=o.selectedTextColorFn}var s=e.texttemplate,l=i._fullLayout;t.each((function(t){var o=r.select(this),c=s?n.extractOption(t,e,"txt","texttemplate"):n.extractOption(t,e,"tx","text");if(c||0===c){if(s){var u=e._module.formatLabels,p=u?u(t,e,l):{},f={};y(f,e,t.i);var d=e._meta||{};c=n.texttemplateString(c,p,l._d3locale,f,t,d)}var m=t.tp||e.textposition,g=D(t,e),x=a?a(t):t.tc||e.textfont.color;o.call(v.font,{family:t.tf||e.textfont.family,weight:t.tw||e.textfont.weight,style:t.ty||e.textfont.style,variant:t.tv||e.textfont.variant,textcase:t.tC||e.textfont.textcase,lineposition:t.tE||e.textfont.lineposition,shadow:t.tS||e.textfont.shadow,size:g,color:x}).text(c).call(h.convertToTspans,i).call(z,m,g,t.mrc)}else o.remove()}))}},v.selectedTextStyle=function(t,e){if(t.size()&&e.selectedpoints){var n=v.makeSelectedTextStyleFns(e);t.each((function(t){var i=r.select(this),a=n.selectedTextColorFn(t),o=t.tp||e.textposition,c=D(t,e);l.fill(i,a);var u=s.traceIs(e,"bar-like");z(i,o,c,t.mrc2||t.mrc,u)}))}},v.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var r,n="M"+t[0],i=[];for(r=1;r=c||w>=h&&w<=c)&&(T<=p&&T>=u||T>=p&&T<=u)&&(t=[w,T])}return t}v.steps=function(t){var e=N[t]||U;return function(t){for(var r="M"+F(t[0][0])+","+B(t[0][1]),n=t.length,i=1;i=1e4&&(v.savedBBoxes={},q=0),i&&(v.savedBBoxes[i]=g),q++,n.extendFlat({},g)},v.setClipUrl=function(t,e,r){t.attr("clip-path",Z(e,r))},v.getTranslate=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,(function(t,e,r){return[e,r].join(" ")})).split(" ");return{x:+e[0]||0,y:+e[1]||0}},v.setTranslate=function(t,e,r){var n=t.attr?"attr":"getAttribute",i=t.attr?"attr":"setAttribute",a=t[n]("transform")||"";return e=e||0,r=r||0,a=a.replace(/(\btranslate\(.*?\);?)/,"").trim(),a=(a+=u(e,r)).trim(),t[i]("transform",a),a},v.getScale=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,(function(t,e,r){return[e,r].join(" ")})).split(" ");return{x:+e[0]||1,y:+e[1]||1}},v.setScale=function(t,e,r){var n=t.attr?"attr":"getAttribute",i=t.attr?"attr":"setAttribute",a=t[n]("transform")||"";return e=e||1,r=r||1,a=a.replace(/(\bscale\(.*?\);?)/,"").trim(),a=(a+="scale("+e+","+r+")").trim(),t[i]("transform",a),a};var Y=/\s*sc.*/;v.setPointGroupScale=function(t,e,r){if(e=e||1,r=r||1,t){var n=1===e&&1===r?"":"scale("+e+","+r+")";t.each((function(){var t=(this.getAttribute("transform")||"").replace(Y,"");t=(t+=n).trim(),this.setAttribute("transform",t)}))}};var X=/translate\([^)]*\)\s*$/;function $(t,e){var r;return t&&(r=t.mf),void 0===r&&(r=e.marker&&e.marker.standoff||0),e._geo||e._xA?r:-r}v.setTextPointsScale=function(t,e,n){t&&t.each((function(){var t,i=r.select(this),a=i.select("text");if(a.node()){var o=parseFloat(a.attr("x")||0),s=parseFloat(a.attr("y")||0),l=(i.attr("transform")||"").match(X);t=1===e&&1===n?[]:[u(o,s),"scale("+e+","+n+")",u(-o,-s)],l&&t.push(l),i.attr("transform",t.join(""))}}))},v.getMarkerStandoff=$;var K,J,Q,tt,et,rt,nt=Math.atan2,it=Math.cos,at=Math.sin;function ot(t,e){var r=e[0],n=e[1];return[r*it(t)-n*at(t),r*at(t)+n*it(t)]}function st(t,e){var r=t.ma;void 0===r&&(!(r=e.marker.angle)||n.isArrayOrTypedArray(r))&&(r=0);var i,o,s=e.marker.angleref;if("previous"===s||"north"===s){if(e._geo){var l=e._geo.project(t.lonlat);i=l[0],o=l[1]}else{var c=e._xA,u=e._yA;if(!c||!u)return 90;i=c.c2p(t.x),o=u.c2p(t.y)}if(e._geo){var h,p=t.lonlat[0],f=t.lonlat[1],d=e._geo.project([p,f+1e-5]),m=e._geo.project([p+1e-5,f]),g=nt(m[1]-o,m[0]-i),y=nt(d[1]-o,d[0]-i);if("north"===s)h=r/180*Math.PI;else if("previous"===s){var v=p/180*Math.PI,x=f/180*Math.PI,_=K/180*Math.PI,b=J/180*Math.PI,w=_-v,T=it(b)*at(w),A=at(b)*it(x)-it(b)*at(x)*it(w);h=-nt(T,A)-Math.PI,K=p,J=f}var k=ot(g,[it(h),0]),M=ot(y,[at(h),0]);r=nt(k[1]+M[1],k[0]+M[0])/Math.PI*180,"previous"===s&&(rt!==e.uid||t.i!==et+1)&&(r=null)}if("previous"===s&&!e._geo)if(rt===e.uid&&t.i===et+1&&a(i)&&a(o)){var S=i-Q,E=o-tt,C=e.line&&e.line.shape||"",I=C.slice(C.length-1);"h"===I&&(E=0),"v"===I&&(S=0),r+=nt(E,S)/Math.PI*180+90}else r=null}return Q=i,tt=o,et=t.i,rt=e.uid,r}v.getMarkerAngle=st}}),tr=f({"src/components/titles/index.js"(t,e){var r=x(),n=A(),i=Ae(),a=qt(),o=le(),s=o.strTranslate,l=Qe(),c=H(),u=Se(),h=G(),p=Me().OPPOSITE_SIDE,f=/ [XY][0-9]* /;e.exports={draw:function(t,e,d){var m,g=t._fullLayout,y=d.propContainer,v=d.propName,x=d.placeholder,_=d.traceIndex,b=d.avoid||{},w=d.attributes,T=d.transform,A=d.containerGroup,k=1,M=y.title,S=(M&&M.text?M.text:"").trim(),E=!1,C=M&&M.font?M.font:{},I=C.family,L=C.size,P=C.color,z=C.weight,D=C.style,O=C.variant,R=C.textcase,F=C.lineposition,B=C.shadow,j=!!d.subtitlePropName,N=d.subtitlePlaceholder,U=(y.title||{}).subtitle||{text:"",font:{}},V=U.text.trim(),q=!1,H=1,G=U.font,W=G.family,Z=G.size,Y=G.color,X=G.weight,$=G.style,K=G.variant,J=G.textcase,Q=G.lineposition,tt=G.shadow;"title.text"===v?m="titleText":-1!==v.indexOf("axis")?m="axisTitleText":v.indexOf(!0)&&(m="colorbarTitleText");var et=t._context.edits[m];function rt(t,e){return void 0!==t&&void 0!==e&&t.replace(f," % ")===e.replace(f," % ")}""===S?k=0:rt(S,x)&&(et||(S=""),k=.2,E=!0),j&&(""===V?H=0:rt(V,N)&&(et||(V=""),H=.2,q=!0)),d._meta?S=o.templateString(S,d._meta):g._meta&&(S=o.templateString(S,g._meta));var nt,it=S||V||et;A||(A=o.ensureSingle(g._infolayer,"g","g-"+e),nt=g._hColorbarMoveTitle);var at=A.selectAll("text."+e).data(it?[0]:[]);at.enter().append("text"),at.text(S).attr("class",e),at.exit().remove();var ot=null,st=e+"-subtitle",lt=V||et;if(j&<&&((ot=A.selectAll("text."+st).data(lt?[0]:[])).enter().append("text"),ot.text(V).attr("class",st),ot.exit().remove()),!it)return A;function ct(t,e){o.syncOrAsync([ut,ht],{title:t,subtitle:e})}function ut(n){var a,h=n.title,p=n.subtitle;if(!T&&nt&&(T={}),T?(a="",T.rotate&&(a+="rotate("+[T.rotate,w.x,w.y]+")"),(T.offset||nt)&&(a+=s(0,(T.offset||0)-(nt||0)))):a=null,h.attr("transform",a),h.style("opacity",k*c.opacity(P)).call(l.font,{color:c.rgb(P),size:r.round(L,2),family:I,weight:z,style:D,variant:O,textcase:R,shadow:B,lineposition:F}).attr(w).call(u.convertToTspans,t,(function(t){if(t){var e=r.select(t.node().parentNode).select("."+st);if(!e.empty()){var n=t.node().getBBox();if(n.height){var i=n.y+n.height+1.6*Z;e.attr("y",i)}}}})),p){var f=A.select("."+e+"-math-group"),d=h.node().getBBox(),m=f.node()?f.node().getBBox():void 0,g=m?m.y+m.height+1.6*Z:d.y+d.height+1.6*Z,y=o.extendFlat({},w,{y:g});p.attr("transform",a),p.style("opacity",H*c.opacity(Y)).call(l.font,{color:c.rgb(Y),size:r.round(Z,2),family:W,weight:X,style:$,variant:K,textcase:J,shadow:tt,lineposition:Q}).attr(y).call(u.convertToTspans,t)}return i.previousPromises(t)}function ht(e){var i=e.title,a=r.select(i.node().parentNode);if(b&&b.selection&&b.side&&S){a.attr("transform",null);var c=p[b.side],u="left"===b.side||"top"===b.side?-1:1,h=n(b.pad)?b.pad:2,f=l.bBox(a.node()),d={t:0,b:0,l:0,r:0},m=t._fullLayout._reservedMargin;for(var v in m)for(var x in m[v]){var _=m[v][x];d[x]=Math.max(d[x],_)}var w={left:d.l,top:d.t,right:g.width-d.r,bottom:g.height-d.b},T=b.maxShift||u*(w[b.side]-f[b.side]),A=0;if(T<0)A=T;else{var k=b.offsetLeft||0,M=b.offsetTop||0;f.left-=k,f.right-=k,f.top-=M,f.bottom-=M,b.selection.each((function(){var t=l.bBox(this);o.bBoxIntersect(f,t,h)&&(A=Math.max(A,u*(t[b.side]-f[c])+h))})),A=Math.min(T,A),y._titleScoot=Math.abs(A)}if(A>0||T<0){var E={left:[-A,0],right:[A,0],top:[0,-A],bottom:[0,A]}[b.side];a.attr("transform",s(E[0],E[1]))}}}function pt(t,e){t.text(e).on("mouseover.opacity",(function(){r.select(this).transition().duration(h.SHOW_PLACEHOLDER).style("opacity",1)})).on("mouseout.opacity",(function(){r.select(this).transition().duration(h.HIDE_PLACEHOLDER).style("opacity",0)}))}if(at.call(ct,ot),et&&(S?at.on(".opacity",null):(pt(at,x),E=!0),at.call(u.makeEditable,{gd:t}).on("edit",(function(e){void 0!==_?a.call("_guiRestyle",t,v,e,_):a.call("_guiRelayout",t,v,e)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(ct)})).on("input",(function(t){this.text(t||" ").call(u.positionText,w.x,w.y)})),j)){if(j&&!S){var ft=at.node().getBBox(),dt=ft.y+ft.height+1.6*Z;ot.attr("y",dt)}V?ot.on(".opacity",null):(pt(ot,N),q=!0),ot.call(u.makeEditable,{gd:t}).on("edit",(function(e){a.call("_guiRelayout",t,"title.subtitle.text",e)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(ct)})).on("input",(function(t){this.text(t||" ").call(u.positionText,ot.attr("x"),ot.attr("y"))}))}return at.classed("js-placeholder",E),ot&&ot.classed("js-placeholder",q),A},SUBTITLE_PADDING_EM:1.6,SUBTITLE_PADDING_MATHJAX_EM:1.6}}}),er=f({"src/plots/cartesian/set_convert.js"(t,e){var r=x(),n=b().utcFormat,i=le(),a=i.numberFormat,o=A(),s=i.cleanNumber,l=i.ms2DateTime,c=i.dateTime2ms,u=i.ensureNumber,h=i.isArrayOrTypedArray,p=k(),f=p.FP_SAFE,d=p.BADNUM,m=p.LOG_CLIP,g=p.ONEWEEK,y=p.ONEDAY,v=p.ONEHOUR,_=p.ONEMIN,w=p.ONESEC,T=xe(),M=ve(),S=M.HOUR_PATTERN,E=M.WEEKDAY_PATTERN;function C(t){return Math.pow(10,t)}function I(t){return null!=t}e.exports=function(t,e){e=e||{};var p=t._id||"x",x=p.charAt(0);function b(e,r){if(e>0)return Math.log(e)/Math.LN10;if(e<=0&&r&&t.range&&2===t.range.length){var n=t.range[0],i=t.range[1];return.5*(n+i-2*m*Math.abs(n-i))}return d}function A(e,r,n,a){if((a||{}).msUTC&&o(e))return+e;var s=c(e,n||t.calendar);if(s===d){if(!o(e))return d;e=+e;var l=Math.floor(10*i.mod(e+.05,1)),u=Math.round(e-l/10);s=c(new Date(u))+l/10}return s}function k(e,r,n){return l(e,r,n||t.calendar)}function L(e){return t._categories[Math.round(e)]}function P(e){if(I(e)){if(void 0===t._categoriesMap&&(t._categoriesMap={}),void 0!==t._categoriesMap[e])return t._categoriesMap[e];t._categories.push("number"==typeof e?String(e):e);var r=t._categories.length-1;return t._categoriesMap[e]=r,r}return d}function z(e){if(t._categoriesMap)return t._categoriesMap[e]}function D(t){var e=z(t);return void 0!==e?e:o(t)?+t:void 0}function O(t){return o(t)?+t:z(t)}function R(t,e,n){return r.round(n+e*t,2)}function F(t,e,r){return(t-r)/e}var B=function(e){return o(e)?R(e,t._m,t._b):d},j=function(e){return F(e,t._m,t._b)};if(t.rangebreaks){var N="y"===x;B=function(e){if(!o(e))return d;var r=t._rangebreaks.length;if(!r)return R(e,t._m,t._b);var n=N;t.range[0]>t.range[1]&&(n=!n);for(var i=n?-1:1,a=i*e,s=0,l=0;lu)){s=a<(c+u)/2?l:l+1;break}s=l+1}var h=t._B[s]||0;return isFinite(h)?R(e,t._m2,h):0},j=function(e){var r=t._rangebreaks.length;if(!r)return F(e,t._m,t._b);for(var n=0,i=0;it._rangebreaks[i].pmax&&(n=i+1);return F(e,t._m2,t._B[n])}}t.c2l="log"===t.type?b:u,t.l2c="log"===t.type?C:u,t.l2p=B,t.p2l=j,t.c2p="log"===t.type?function(t,e){return B(b(t,e))}:B,t.p2c="log"===t.type?function(t){return C(j(t))}:j,-1!==["linear","-"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=s,t.c2d=t.c2r=t.l2d=t.l2r=u,t.d2p=t.r2p=function(e){return t.l2p(s(e))},t.p2d=t.p2r=j,t.cleanPos=u):"log"===t.type?(t.d2r=t.d2l=function(t,e){return b(s(t),e)},t.r2d=t.r2c=function(t){return C(s(t))},t.d2c=t.r2l=s,t.c2d=t.l2r=u,t.c2r=b,t.l2d=C,t.d2p=function(e,r){return t.l2p(t.d2r(e,r))},t.p2d=function(t){return C(j(t))},t.r2p=function(e){return t.l2p(s(e))},t.p2r=j,t.cleanPos=u):"date"===t.type?(t.d2r=t.r2d=i.identity,t.d2c=t.r2c=t.d2l=t.r2l=A,t.c2d=t.c2r=t.l2d=t.l2r=k,t.d2p=t.r2p=function(e,r,n){return t.l2p(A(e,0,n))},t.p2d=t.p2r=function(t,e,r){return k(j(t),e,r)},t.cleanPos=function(e){return i.cleanDate(e,d,t.calendar)}):"category"===t.type?(t.d2c=t.d2l=P,t.r2d=t.c2d=t.l2d=L,t.d2r=t.d2l_noadd=D,t.r2c=function(e){var r=O(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=u,t.r2l=O,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return L(j(t))},t.r2p=t.d2p,t.p2r=j,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:u(t)}):"multicategory"===t.type&&(t.r2d=t.c2d=t.l2d=L,t.d2r=t.d2l_noadd=D,t.r2c=function(e){var r=D(e);return void 0!==r?r:t.fraction2r(.5)},t.r2c_just_indices=z,t.l2r=t.c2r=u,t.r2l=D,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return L(j(t))},t.r2p=t.d2p,t.p2r=j,t.cleanPos=function(t){return Array.isArray(t)||"string"==typeof t&&""!==t?t:u(t)},t.setupMultiCategory=function(r){var n,a,o=t._traceIndices,s=t._matchGroup;if(s&&0===t._categories.length)for(var l in s)if(l!==p){var c=e[T.id2name(l)];o=o.concat(c._traceIndices)}var u=[[0,{}],[0,{}]],f=[];for(n=0;nl[1]&&(a[s?0:1]=n),a[0]===a[1]){var c=t.l2r(r),u=t.l2r(n);if(void 0!==r){var h=c+1;void 0!==n&&(h=Math.min(h,u)),a[s?1:0]=h}if(void 0!==n){var p=u+1;void 0!==r&&(p=Math.max(p,c)),a[s?0:1]=p}}}},t.cleanRange=function(e,r){t._cleanRange(e,r),t.limitRange(e)},t._cleanRange=function(e,r){r||(r={}),e||(e="range");var n,a,s=i.nestedProperty(t,e).get();if(a=(a="date"===t.type?i.dfltRange(t.calendar):"y"===x?M.DFLTRANGEY:"realaxis"===t._name?[0,1]:r.dfltRange||M.DFLTRANGEX).slice(),("tozero"===t.rangemode||"nonnegative"===t.rangemode)&&(a[0]=0),s&&2===s.length){var l=null===s[0],c=null===s[1];for("date"===t.type&&!t.autorange&&(s[0]=i.cleanDate(s[0],d,t.calendar),s[1]=i.cleanDate(s[1],d,t.calendar)),n=0;n<2;n++)if("date"===t.type){if(!i.isDateTime(s[n],t.calendar)){t[e]=a;break}if(t.r2l(s[0])===t.r2l(s[1])){var u=i.constrain(t.r2l(s[0]),i.MIN_MS+1e3,i.MAX_MS-1e3);s[0]=t.l2r(u-1e3),s[1]=t.l2r(u+1e3);break}}else{if(!o(s[n])){if(l||c||!o(s[1-n])){t[e]=a;break}s[n]=s[1-n]*(n?10:.1)}if(s[n]<-f?s[n]=-f:s[n]>f&&(s[n]=f),s[0]===s[1]){var h=Math.max(1,Math.abs(1e-6*s[0]));s[0]-=h,s[1]+=h}}}else i.nestedProperty(t,e).set(a)},t.setScale=function(r){var n=e._size;if(t.overlaying){var i=T.getFromId({_fullLayout:e},t.overlaying);t.domain=i.domain}var a=r&&t._r?"_r":"range",o=t.calendar;t.cleanRange(a);var s,l,c=t.r2l(t[a][0],o),u=t.r2l(t[a][1],o),h="y"===x;if(h?(t._offset=n.t+(1-t.domain[1])*n.h,t._length=n.h*(t.domain[1]-t.domain[0]),t._m=t._length/(c-u),t._b=-t._m*u):(t._offset=n.l+t.domain[0]*n.w,t._length=n.w*(t.domain[1]-t.domain[0]),t._m=t._length/(u-c),t._b=-t._m*c),t._rangebreaks=[],t._lBreaks=0,t._m2=0,t._B=[],t.rangebreaks&&(t._rangebreaks=t.locateBreaks(Math.min(c,u),Math.max(c,u)),t._rangebreaks.length)){for(s=0;su&&(p=!p),p&&t._rangebreaks.reverse();var f=p?-1:1;for(t._m2=f*t._length/(Math.abs(u-c)-t._lBreaks),t._B.push(-t._m2*(h?u:c)),s=0;sa&&(a+=7,oa&&(a+=24,o=n&&o=n&&e=s.min&&(ts.max&&(s.max=n),a=!1)}a&&c.push({min:t,max:n})}};for(n=0;n2*s}(p,e))return"date";var y="strict"!==n.autotypenumbers;return function(t,e){for(var r=t.length,n=u(r),a=0,o=0,c={},h=0;h2*a}(p,y)?"category":function(t,e){for(var r=t.length,n=0;n0&&((k=I-s(_)-l(b))>L?M/k>P&&(w=_,A=b,P=M/k):M/I>P&&(w={val:_.val,nopad:1},A={val:b.val,nopad:1},P=M/I));if(m===g){var z=m-1,D=m+1;if(E)if(0===m)a=[0,1];else{var O=(m>0?h:u).reduce((function(t,e){return Math.max(t,l(e))}),0),R=m/(1-Math.min(.5,O/I));a=m>0?[0,R]:[R,0]}else a=C?[Math.max(0,z),Math.max(1,D)]:[z,D]}else E?(w.val>=0&&(w={val:0,nopad:1}),A.val<=0&&(A={val:0,nopad:1})):C&&(w.val-P*s(w)<0&&(w={val:0,nopad:1}),A.val<=0&&(A={val:1,nopad:1})),P=(A.val-w.val-p(e,_.val,b.val))/(I-s(w)-l(A)),a=[w.val-P*s(w),A.val+P*l(A)];return a=T(a,e),e.limitRange&&e.limitRange(),v&&a.reverse(),i.simpleMap(a,e.l2r||Number)}function p(t,e,r){var n=0;if(t.rangebreaks)for(var i=t.locateBreaks(e,r),a=0;a=r&&(c.extrapad||!o)){s=!1;break}i(e,c.val)&&c.pad<=r&&(o||!c.extrapad)&&(t.splice(l,1),l--)}if(s){var u=a&&0===e;t.push({val:e,pad:u?0:r,extrapad:!u&&o})}}function v(t){return n(t)&&Math.abs(t)=e}function w(t,e,r){return void 0===e||void 0===r||(e=t.d2l(e))=c&&(o=c,r=c),s<=c&&(s=c,n=c)}}return r=function(t,e){var r=e.autorangeoptions;return r&&void 0!==r.minallowed&&w(e,r.minallowed,r.maxallowed)?r.minallowed:r&&void 0!==r.clipmin&&w(e,r.clipmin,r.clipmax)?Math.max(t,e.d2l(r.clipmin)):t}(r,e),n=function(t,e){var r=e.autorangeoptions;return r&&void 0!==r.maxallowed&&w(e,r.minallowed,r.maxallowed)?r.maxallowed:r&&void 0!==r.clipmax&&w(e,r.clipmin,r.clipmax)?Math.min(t,e.d2l(r.clipmax)):t}(n,e),[r,n]}e.exports={applyAutorangeOptions:T,getAutoRange:h,makePadFn:f,doAutoRange:function(t,e,r){if(e.setScale(),e.autorange){e.range=r?r.slice():h(t,e),e._r=e.range.slice(),e._rl=i.simpleMap(e._r,e.r2l);var n=e._input,a={};a[e._attr+".range"]=e.range,a[e._attr+".autorange"]=e.autorange,o.call("_storeDirectGUIEdit",t.layout,t._fullLayout._preGUI,a),n.range=e.range.slice(),n.autorange=e.autorange}var s=e._anchorAxis;if(s&&s.rangeslider){var l=s.rangeslider[e._name];l&&"auto"===l.rangemode&&(l.range=h(t,e)),s._input.rangeslider[e._name]=i.extendFlat({},l)}},findExtremes:function(t,e,r){r||(r={}),t._m||t.setScale();var i,o,s,l,c,u,h,p,f,d=[],y=[],x=e.length,_=r.padded||!1,b=r.tozero&&("linear"===t.type||"-"===t.type),w="log"===t.type,T=!1,A=r.vpadLinearized||!1;function k(t){if(Array.isArray(t))return T=!0,function(e){return Math.max(Number(t[e]||0),0)};var e=Math.max(Number(t||0),0);return function(){return e}}var M=k((t._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),S=k((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),E=k(r.vpadplus||r.vpad),C=k(r.vpadminus||r.vpad);if(!T){if(p=1/0,f=-1/0,w)for(i=0;i0&&(p=o),o>f&&o-a&&(p=o),o>f&&o=P;i--)L(i);return{min:d,max:y,opts:r}},concatExtremes:d}}}),ir=f({"src/plots/cartesian/axes.js"(t,e){var r=x(),n=A(),i=Ae(),a=qt(),o=le(),s=o.strTranslate,l=Se(),c=tr(),u=H(),h=Qe(),p=Ie(),f=Oe(),d=k(),m=d.ONEMAXYEAR,g=d.ONEAVGYEAR,y=d.ONEMINYEAR,v=d.ONEMAXQUARTER,_=d.ONEAVGQUARTER,b=d.ONEMINQUARTER,w=d.ONEMAXMONTH,T=d.ONEAVGMONTH,M=d.ONEMINMONTH,S=d.ONEWEEK,E=d.ONEDAY,C=E/2,I=d.ONEHOUR,L=d.ONEMIN,P=d.ONESEC,z=d.ONEMILLI,D=d.ONEMICROSEC,O=d.MINUS_SIGN,R=d.BADNUM,F={K:"zeroline"},B={K:"gridline",L:"path"},j={K:"minor-gridline",L:"path"},N={K:"tick",L:"path"},U={K:"tick",L:"text"},V={width:["x","r","l","xl","xr"],height:["y","t","b","yt","yb"],right:["r","xr"],left:["l","xl"],top:["t","yt"],bottom:["b","yb"]},q=Me(),G=q.MID_SHIFT,W=q.CAP_SHIFT,Z=q.LINE_SPACING,Y=q.OPPOSITE_SIDE,X=e.exports={};X.setConvert=er();var $=rr(),K=xe(),J=K.idSort,Q=K.isLinked;X.id2name=K.id2name,X.name2id=K.name2id,X.cleanId=K.cleanId,X.list=K.list,X.listIds=K.listIds,X.getFromId=K.getFromId,X.getFromTrace=K.getFromTrace;var tt=nr();function et(t){var e=1e-4*(t[1]-t[0]);return[t[0]-e,t[1]+e]}X.getAutoRange=tt.getAutoRange,X.findExtremes=tt.findExtremes,X.coerceRef=function(t,e,r,n,i,a){var s=n.charAt(n.length-1),l=r._fullLayout._subplots[s+"axis"],c=n+"ref",u={};return i||(i=l[0]||("string"==typeof a?a:a[0])),a||(a=i),l=l.concat(l.map((function(t){return t+" domain"}))),u[c]={valType:"enumerated",values:l.concat(a?"string"==typeof a?[a]:a:[]),dflt:i},o.coerce(t,e,u,c)},X.getRefType=function(t){return void 0===t?t:"paper"===t?"paper":"pixel"===t?"pixel":/( domain)$/.test(t)?"domain":"range"},X.coercePosition=function(t,e,r,n,i,a){var s,l;if("range"!==X.getRefType(n))s=o.ensureNumber,l=r(i,a);else{var c=X.getFromId(e,n);l=r(i,a=c.fraction2r(a)),s=c.cleanPos}t[i]=s(l)},X.cleanPosition=function(t,e,r){return("paper"===r||"pixel"===r?o.ensureNumber:X.getFromId(e,r).cleanPos)(t)},X.redrawComponents=function(t,e){e=e||X.listIds(t);var r=t._fullLayout;function n(n,i,o,s){for(var l=a.getComponentMethod(n,i),c={},u=0;un&&p2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},X.saveRangeInitial=function(t,e){for(var r=X.list(t,"",!0),n=!1,i=0;i.3*p||u(i)||u(a))){var f=r.dtick/2;t+=t+f.8){var s=Number(r.substr(1));a.exactYears>.8&&s%12==0?t=X.tickIncrement(t,"M6","reverse")+1.5*E:a.exactMonths>.8?t=X.tickIncrement(t,"M1","reverse")+15.5*E:t-=C;var l=X.tickIncrement(t,r);if(l<=n)return l}return t}(v,t,y,c,a)),g=v;g<=u;)g=X.tickIncrement(g,y,!1,a);return{start:e.c2r(v,0,a),end:e.c2r(g,0,a),size:y,_dataSpan:u-c}},X.prepMinorTicks=function(t,e,r){if(!e.minor.dtick){delete t.dtick;var i,a=e.dtick&&n(e._tmin);if(a){var s=X.tickIncrement(e._tmin,e.dtick,!0);i=[e._tmin,.99*s+.01*e._tmin]}else{var l=o.simpleMap(e.range,e.r2l);i=[l[0],.8*l[0]+.2*l[1]]}if(t.range=o.simpleMap(i,e.l2r),t._isMinor=!0,X.prepTicks(t,r),a){var c=n(e.dtick),u=n(t.dtick),h=c?e.dtick:+e.dtick.substring(1),p=u?t.dtick:+t.dtick.substring(1);c&&u?at(h,p)?h===2*S&&p===2*E&&(t.dtick=S):h===2*S&&p===3*E?t.dtick=S:h!==S||(e._input.minor||{}).nticks?ot(h/p,2.5)?t.dtick=h/2:t.dtick=h:t.dtick=E:"M"===String(e.dtick).charAt(0)?u?t.dtick="M1":at(h,p)?h>=12&&2===p&&(t.dtick="M3"):t.dtick=e.dtick:"L"===String(t.dtick).charAt(0)?"L"===String(e.dtick).charAt(0)?at(h,p)||(t.dtick=ot(h/p,2.5)?e.dtick/2:e.dtick):t.dtick="D1":"D2"===t.dtick&&+e.dtick>1&&(t.dtick=1)}t.range=e.range}void 0===e.minor._tick0Init&&(t.tick0=e.tick0)},X.prepTicks=function(t,e){var r=o.simpleMap(t.range,t.r2l,void 0,void 0,e);if("auto"===t.tickmode||!t.dtick){var i,a=t.nticks;a||("category"===t.type||"multicategory"===t.type?(i=t.tickfont?o.bigFont(t.tickfont.size||12):15,a=t._length/i):(i="y"===t._id.charAt(0)?40:80,a=o.constrain(t._length/i,4,9)+1),"radialaxis"===t._name&&(a*=2)),t.minor&&"array"!==t.minor.tickmode||"array"===t.tickmode&&(a*=100),t._roughDTick=Math.abs(r[1]-r[0])/a,X.autoTicks(t,t._roughDTick),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t.l2r(t._forceTick0))}"period"===t.ticklabelmode&&function(t){var e;function r(){return!(n(t.dtick)||"M"!==t.dtick.charAt(0))}var i=r(),a=X.getTickFormat(t);if(a){var o=t._dtickInit!==t.dtick;/%[fLQsSMX]/.test(a)||(/%[HI]/.test(a)?(e=I,o&&!i&&t.dtickt.range[1],c=!t.ticklabelindex||o.isArrayOrTypedArray(t.ticklabelindex)?t.ticklabelindex:[t.ticklabelindex],u=o.simpleMap(t.range,t.r2l,void 0,void 0,e),h=u[1]=(B?0:1);j--){var N=!j;j?(t._dtickInit=t.dtick,t._tick0Init=t.tick0):(t.minor._dtickInit=t.minor.dtick,t.minor._tick0Init=t.minor.tick0);var U=j?t:o.extendFlat({},t,t.minor);if(N?X.prepMinorTicks(U,t,e):X.prepTicks(U,e),"array"!==U.tickmode)if("sync"!==U.tickmode){var V=et(u),q=V[0],H=V[1],G=n(U.dtick),W="log"===r&&!(G||"L"===U.dtick.charAt(0)),Z=X.tickFirst(U,e);if(j){if(t._tmin=Z,Z=H:J<=H;J=X.tickIncrement(J,Q,h,i)){if(j&&Y++,U.rangebreaks&&!h){if(J=f)break}if(k.length>d||J===K)break;K=J;var tt={value:J};j?(W&&J!==(0|J)&&(tt.simpleLabel=!0),a>1&&Y%a&&(tt.skipLabel=!0),k.push(tt)):(tt.minor=!0,O.push(tt))}}else k=[],x=ct(t);else j?(k=[],x=ut(t,!N)):(O=[],A=ut(t,!N))}var rt;if(!O||O.length<2?c=!1:function(t,e){return/%f/.test(e)?t>=D:/%L/.test(e)?t>=z:/%[SX]/.test(e)?t>=P:/%M/.test(e)?t>=L:/%[HI]/.test(e)?t>=I:/%p/.test(e)?t>=C:/%[Aadejuwx]/.test(e)?t>=E:/%[UVW]/.test(e)?t>=S:/%[Bbm]/.test(e)?t>=M:/%[q]/.test(e)?t>=b:!/%[Yy]/.test(e)||t>=y}((O[1].value-O[0].value)*(l?-1:1),t.tickformat)||(c=!1),c){var nt=k.concat(O);s&&k.length&&(nt=nt.slice(1)),(nt=nt.sort((function(t,e){return t.value-e.value})).filter((function(t,e,r){return 0===e||t.value!==r[e-1].value}))).map((function(t,e){return void 0!==t.minor||t.skipLabel?null:e})).filter((function(t){return null!==t})).forEach((function(t){c.map((function(e){var r=t+e;r>=0&&r0?(a=n-1,o=n):(a=n,o=n);var s,l=t[a].value,c=t[o].value,u=Math.abs(c-l),h=r||u,p=0;h>=y?p=u>=y&&u<=m?u:g:r===_&&h>=b?p=u>=b&&u<=v?u:_:h>=M?p=u>=M&&u<=w?u:T:r===S&&h>=S?p=S:h>=E?p=E:r===C&&h>=C?p=C:r===I&&h>=I&&(p=I),p>=u&&(p=u,s=!0);var f=i+p;if(e.rangebreaks&&p>0){for(var d=0,x=0;x<84;x++){var A=(x+.5)/84;e.maskBreaks(i*(1-A)+A*f)!==R&&d++}(p*=d/84)||(t[n].drop=!0),s&&u>S&&(p=u)}(p>0||0===n)&&(t[n].periodX=i+p/2)}}(F,t,t._definedDelta),t.rangebreaks){var ft="y"===t._id.charAt(0),dt=1;"auto"===t.tickmode&&(dt=t.tickfont?t.tickfont.size:12);var mt=NaN;for(rt=k.length-1;rt>-1;rt--)if(k[rt].drop)k.splice(rt,1);else{k[rt].value=jt(k[rt].value,t);var gt=t.c2p(k[rt].value);(ft?mt>gt-dt:mtf||nf&&(r.periodX=f),n10||"01-01"!==i.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12==0?"y":"m";else if(e>=E&&a<=10||e>=15*E)t._tickround="d";else if(e>=L&&a<=16||e>=I)t._tickround="M";else if(e>=P&&a<=19||e>=L)t._tickround="S";else{var o=t.l2r(r+e).replace(/^-/,"").length;t._tickround=Math.max(a,o)-20,t._tickround<0&&(t._tickround=4)}}else if(n(e)||"L"===e.charAt(0)){var s=t.range.map(t.r2d||Number);n(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var l=Math.max(Math.abs(s[0]),Math.abs(s[1])),c=Math.floor(Math.log(l)/Math.LN10+.01),u=void 0===t.minexponent?3:t.minexponent;Math.abs(c)>u&&(wt(t.exponentformat)&&!Tt(c)?t._tickexponent=3*Math.round((c-1)/3):t._tickexponent=c)}else t._tickround=null}function _t(t,e,r){var n=t.tickfont||{};return{x:e,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontWeight:n.weight,fontStyle:n.style,fontVariant:n.variant,fontTextcase:n.textcase,fontLineposition:n.lineposition,fontShadow:n.shadow,fontColor:n.color}}X.autoTicks=function(t,e,r){var i;function a(t){return Math.pow(t,Math.floor(Math.log(e)/Math.LN10))}if("date"===t.type){t.tick0=o.dateTick0(t.calendar,0);var s=2*e;if(s>g)e/=g,i=a(10),t.dtick="M"+12*vt(e,i,ht);else if(s>T)e/=T,t.dtick="M"+vt(e,1,pt);else if(s>E){if(t.dtick=vt(e,E,t._hasDayOfWeekBreaks?[1,2,7,14]:dt),!r){var l=X.getTickFormat(t),c="period"===t.ticklabelmode;c&&(t._rawTick0=t.tick0),/%[uVW]/.test(l)?t.tick0=o.dateTick0(t.calendar,2):t.tick0=o.dateTick0(t.calendar,1),c&&(t._dowTick0=t.tick0)}}else s>I?t.dtick=vt(e,I,pt):s>L?t.dtick=vt(e,L,ft):s>P?t.dtick=vt(e,P,ft):(i=a(10),t.dtick=vt(e,i,ht))}else if("log"===t.type){t.tick0=0;var u=o.simpleMap(t.range,t.r2l);if(t._isMinor&&(e*=1.5),e>.7)t.dtick=Math.ceil(e);else if(Math.abs(u[1]-u[0])<1){var h=1.5*Math.abs((u[1]-u[0])/e);e=Math.abs(Math.pow(10,u[1])-Math.pow(10,u[0]))/h,i=a(10),t.dtick="L"+vt(e,i,ht)}else t.dtick=e>.3?"D2":"D1"}else"category"===t.type||"multicategory"===t.type?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):Bt(t)?(t.tick0=0,i=1,t.dtick=vt(e,i,yt)):(t.tick0=0,i=a(10),t.dtick=vt(e,i,ht));if(0===t.dtick&&(t.dtick=1),!n(t.dtick)&&"string"!=typeof t.dtick){var p=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(p)}},X.tickIncrement=function(t,e,i,a){var s=i?-1:1;if(n(e))return o.increment(t,s*e);var l=e.charAt(0),c=s*Number(e.substr(1));if("M"===l)return o.incrementMonth(t,c,a);if("L"===l)return Math.log(Math.pow(10,t)+c)/Math.LN10;if("D"===l){var u="D2"===e?gt:mt,h=t+.01*s,p=o.roundUp(o.mod(h,1),u,i);return Math.floor(h)+Math.log(r.round(Math.pow(10,p),1))/Math.LN10}throw"unrecognized dtick "+String(e)},X.tickFirst=function(t,e){var i=t.r2l||Number,a=o.simpleMap(t.range,i,void 0,void 0,e),s=a[1]=0&&r<=t._length?e:null};if(l&&o.isArrayOrTypedArray(t.ticktext)){var f=o.simpleMap(t.range,t.r2l),d=(Math.abs(f[1]-f[0])-(t._lBreaks||0))/1e4;for(a=0;a ")}else t._prevDateHead=l,c+="
"+l;e.text=c}(t,s,r,c):"log"===u?function(t,e,r,i,a){var s=t.dtick,l=e.x,c=t.tickformat,u="string"==typeof s&&s.charAt(0);if("never"===a&&(a=""),i&&"L"!==u&&(s="L3",u="L"),c||"L"===u)e.text=At(Math.pow(10,l),t,a,i);else if(n(s)||"D"===u&&o.mod(l+.01,1)<.1){var h=Math.round(l),p=Math.abs(h),f=t.exponentformat;"power"===f||wt(f)&&Tt(h)?(e.text=0===h?1:1===h?"10":"10"+(h>1?"":O)+p+"",e.fontSize*=1.25):("e"===f||"E"===f)&&p>2?e.text="1"+f+(h>0?"+":O)+p:(e.text=At(Math.pow(10,l),t,"","fakehover"),"D1"===s&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6))}else{if("D"!==u)throw"unrecognized dtick "+String(s);e.text=String(Math.round(Math.pow(10,o.mod(l,1)))),e.fontSize*=.75}if("D1"===t.dtick){var d=String(e.text).charAt(0);("0"===d||"1"===d)&&("y"===t._id.charAt(0)?e.dx-=e.fontSize/4:(e.dy+=e.fontSize/2,e.dx+=(t.range[1]>t.range[0]?1:-1)*e.fontSize*(l<0?.5:.25)))}}(t,s,0,c,g):"category"===u?function(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r=""),e.text=String(r)}(t,s):"multicategory"===u?function(t,e,r){var n=Math.round(e.x),i=t._categories[n]||[],a=void 0===i[1]?"":String(i[1]),o=void 0===i[0]?"":String(i[0]);r?e.text=o+" - "+a:(e.text=a,e.text2=o)}(t,s,r):Bt(t)?function(t,e,r,n,i){if("radians"!==t.thetaunit||r)e.text=At(e.x,t,i,n);else{var a=e.x/180;if(0===a)e.text="0";else{var s=function(t){function e(t,e){return Math.abs(t-e)<=1e-6}var r=function(t){for(var r=1;!e(Math.round(t*r)/r,t);)r*=10;return r}(t),n=t*r,i=Math.abs(function t(r,n){return e(n,0)?r:t(n,r%n)}(n,r));return[Math.round(n/i),Math.round(r/i)]}(a);if(s[1]>=100)e.text=At(o.deg2rad(e.x),t,i,n);else{var l=e.x<0;1===s[1]?1===s[0]?e.text="π":e.text=s[0]+"π":e.text=["",s[0],"","⁄","",s[1],"","π"].join(""),l&&(e.text=O+e.text)}}}}(t,s,r,c,g):function(t,e,r,n,i){"never"===i?i="":"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(i="hide"),e.text=At(e.x,t,i,n)}(t,s,0,c,g),i||(t.tickprefix&&!m(t.showtickprefix)&&(s.text=t.tickprefix+s.text),t.ticksuffix&&!m(t.showticksuffix)&&(s.text+=t.ticksuffix)),t.labelalias&&t.labelalias.hasOwnProperty(s.text)){var y=t.labelalias[s.text];"string"==typeof y&&(s.text=y)}return("boundaries"===t.tickson||t.showdividers)&&(s.xbnd=[p(s.x-.5),p(s.x+t.dtick-.5)]),s},X.hoverLabelText=function(t,e,r){r&&(t=o.extendFlat({},t,{hoverformat:r}));var n=o.isArrayOrTypedArray(e)?e[0]:e,i=o.isArrayOrTypedArray(e)?e[1]:void 0;if(void 0!==i&&i!==n)return X.hoverLabelText(t,n,r)+" - "+X.hoverLabelText(t,i,r);var a="log"===t.type&&n<=0,s=X.tickText(t,t.c2l(a?-n:n),"hover").text;return a?0===n?"0":O+s:s};var bt=["f","p","n","μ","m","","k","M","G","T"];function wt(t){return"SI"===t||"B"===t}function Tt(t){return t>14||t<-15}function At(t,e,r,i){var a=t<0,s=e._tickround,l=r||e.exponentformat||"B",c=e._tickexponent,u=X.getTickFormat(e),h=e.separatethousands;if(i){var p={exponentformat:l,minexponent:e.minexponent,dtick:"none"===e.showexponent?e.dtick:n(t)&&Math.abs(t)||1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};xt(p),s=(Number(p._tickround)||0)+4,c=p._tickexponent,e.hoverformat&&(u=e.hoverformat)}if(u)return e._numFormat(u)(t).replace(/-/g,O);var f,d=Math.pow(10,-s)/2;if("none"===l&&(c=0),(t=Math.abs(t))"+f+"":"B"===l&&9===c?t+="B":wt(l)&&(t+=bt[c/3+5])),a?O+t:t}function kt(t,e){if(t){var r=Object.keys(V).reduce((function(t,r){return-1!==e.indexOf(r)&&V[r].forEach((function(e){t[e]=1})),t}),{});Object.keys(t).forEach((function(e){r[e]||(1===e.length?t[e]=0:delete t[e])}))}}function Mt(t,e){for(var r=[],n={},i=0;i1&&r=i.min&&t=0,a=u(t,e[1])<=0;return(r||i)&&(n||a)}if(t.tickformatstops&&t.tickformatstops.length>0)switch(t.type){case"date":case"linear":for(e=0;e=o(i)))){r=n;break}break;case"log":for(e=0;e=0&&i.unshift(i.splice(n,1).shift())}}));var s={false:{left:0,right:0}};return o.syncOrAsync(i.map((function(e){return function(){if(e){var n=X.getFromId(t,e);r||(r={}),r.axShifts=s,r.overlayingShiftedAx=a;var i=X.drawOne(t,n,r);return n._shiftPusher&&Vt(n,n._fullDepth||0,s,!0),n._r=n.range.slice(),n._rl=o.simpleMap(n._r,n.r2l),i}}})))},X.drawOne=function(t,e,r){var n,s,p,f=(r=r||{}).axShifts||{},d=r.overlayingShiftedAx||[];e.setScale();var m=t._fullLayout,g=e._id,y=g.charAt(0),v=X.counterLetter(g),x=m._plots[e._mainSubplot];if(x){if(e._shiftPusher=e.autoshift||-1!==d.indexOf(e._id)||-1!==d.indexOf(e.overlaying),e._shiftPusher&"free"===e.anchor){var _=e.linewidth/2||0;"inside"===e.ticks&&(_+=e.ticklen),Vt(e,_,f,!0),Vt(e,e.shift||0,f,!1)}(!0!==r.skipTitle||void 0===e._shift)&&(e._shift=function(t,e){return t.autoshift?e[t.overlaying][t.side]:t.shift||0}(e,f));var b=x[y+"axislayer"],w=e._mainLinePosition,T=w+=e._shift,A=e._mainMirrorPosition,k=e._vals=X.calcTicks(e),M=[e.mirror,T,A].join("_");for(n=0;n0?r.bottom-u:0,h))));var p=0,f=0;if(e._shiftPusher&&(p=Math.max(h,r.height>0?"l"===l?u-r.left:r.right-u:0),e.title.text!==m._dfltTitle[y]&&(f=(e._titleStandoff||0)+(e._titleScoot||0),"l"===l&&(f+=Ct(e))),e._fullDepth=Math.max(p,f)),e.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var d=[0,1],g="number"==typeof e._shift?e._shift:0;if("x"===y){if("b"===l?n[l]=e._depth:(n[l]=e._depth=Math.max(r.width>0?u-r.top:0,h),d.reverse()),r.width>0){var x=r.right-(e._offset+e._length);x>0&&(n.xr=1,n.r=x);var _=e._offset-r.left;_>0&&(n.xl=0,n.l=_)}}else if("l"===l?(e._depth=Math.max(r.height>0?u-r.left:0,h),n[l]=e._depth-g):(e._depth=Math.max(r.height>0?r.right-u:0,h),n[l]=e._depth+g,d.reverse()),r.height>0){var b=r.bottom-(e._offset+e._length);b>0&&(n.yb=0,n.b=b);var w=e._offset-r.top;w>0&&(n.yt=1,n.t=w)}n[v]="free"===e.anchor?e.position:e._anchorAxis.domain[d[0]],e.title.text!==m._dfltTitle[y]&&(n[l]+=Ct(e)+(e.title.standoff||0)),e.mirror&&"free"!==e.anchor&&((o={x:0,y:0,r:0,l:0,t:0,b:0})[c]=e.linewidth,e.mirror&&!0!==e.mirror&&(o[c]+=h),!0===e.mirror||"ticks"===e.mirror?o[v]=e._anchorAxis.domain[d[1]]:("all"===e.mirror||"allticks"===e.mirror)&&(o[v]=[e._counterDomainMin,e._counterDomainMax][d[1]]))}ht&&(s=a.getComponentMethod("rangeslider","autoMarginOpts")(t,e)),"string"==typeof e.automargin&&(kt(n,e.automargin),kt(o,e.automargin)),i.autoMargin(t,Pt(e),n),i.autoMargin(t,zt(e),o),i.autoMargin(t,Dt(e),s)})),o.syncOrAsync(ct)}}function pt(t){var r=g+(t||"tick");return S[r]||(S[r]=function(t,e,r){var n,i,a,o;if(t._selections[e].size())n=1/0,i=-1/0,a=1/0,o=-1/0,t._selections[e].each((function(){var t=Lt(this),e=h.bBox(t.node().parentNode);n=Math.min(n,e.top),i=Math.max(i,e.bottom),a=Math.min(a,e.left),o=Math.max(o,e.right)}));else{var s=X.makeLabelFns(t,r);n=i=s.yFn({dx:0,dy:0,fontSize:0}),a=o=s.xFn({dx:0,dy:0,fontSize:0})}return{top:n,bottom:i,left:a,right:o,height:i-n,width:o-a}}(e,r,T)),S[r]}},X.getTickSigns=function(t,e){var r=t._id.charAt(0),n={x:"top",y:"right"}[r],i=t.side===n?1:-1,a=[-1,1,i,-i];return"inside"!==(e?(t.minor||{}).ticks:t.ticks)==("x"===r)&&(a=a.map((function(t){return-t}))),t.side&&a.push({l:-1,t:-1,r:1,b:1}[t.side.charAt(0)]),a},X.makeTransTickFn=function(t){return"x"===t._id.charAt(0)?function(e){return s(t._offset+t.l2p(e.x),0)}:function(e){return s(0,t._offset+t.l2p(e.x))}},X.makeTransTickLabelFn=function(t){var e=function(t){var e=t.ticklabelposition||"",r=function(t){return-1!==e.indexOf(t)},n=r("top"),i=r("left"),a=r("right"),o=r("bottom"),s=r("inside"),l=o||i||n||a;if(!l&&!s)return[0,0];var c=t.side,u=l?(t.tickwidth||0)/2:0,h=3,p=t.tickfont?t.tickfont.size:12;return(o||n)&&(u+=p*W,h+=(t.linewidth||0)/2),(i||a)&&(u+=(t.linewidth||0)/2,h+=3),s&&"top"===c&&(h-=p*(1-W)),(i||n)&&(u=-u),("bottom"===c||"right"===c)&&(h=-h),[l?u:0,s?h:0]}(t),r=t.ticklabelshift||0,n=t.ticklabelstandoff||0,i=e[0],a=e[1],o=t.range[0]>t.range[1],l=t.ticklabelposition&&-1!==t.ticklabelposition.indexOf("inside"),c=!l;if(r&&(r*=o?-1:1),n){var u=t.side;n*=l&&("top"===u||"left"===u)||c&&("bottom"===u||"right"===u)?1:-1}return"x"===t._id.charAt(0)?function(e){return s(i+t._offset+t.l2p(St(e))+r,a+n)}:function(e){return s(a+n,i+t._offset+t.l2p(St(e))+r)}},X.makeTickPath=function(t,e,r,n){n||(n={});var i=n.minor;if(i&&!t.minor)return"";var a=void 0!==n.len?n.len:i?t.minor.ticklen:t.ticklen,o=t._id.charAt(0),s=(t.linewidth||1)/2;return"x"===o?"M0,"+(e+s*r)+"v"+a*r:"M"+(e+s*r)+",0h"+a*r},X.makeLabelFns=function(t,e,r){var i=t.ticklabelposition||"",a=function(t){return-1!==i.indexOf(t)},s=a("top"),l=a("left"),c=a("right"),u=a("bottom")||l||s||c,h=a("inside"),p="inside"===i&&"inside"===t.ticks||!h&&"outside"===t.ticks&&"boundaries"!==t.tickson,f=0,d=0,m=p?t.ticklen:0;if(h?m*=-1:u&&(m=0),p&&(f+=m,r)){var g=o.deg2rad(r);f=m*Math.cos(g)+1,d=m*Math.sin(g)}t.showticklabels&&(p||t.showline)&&(f+=.2*t.tickfont.size);var y,v,x,_,b,w={labelStandoff:f+=(t.linewidth||1)/2*(h?-1:1),labelShift:d},T=0,A=t.side,k=t._id.charAt(0),M=t.tickangle;if("x"===k)_=(b=!h&&"bottom"===A||h&&"top"===A)?1:-1,h&&(_*=-1),y=d*_,v=e+f*_,x=b?1:-.2,90===Math.abs(M)&&(h?x+=G:x=-90===M&&"bottom"===A?W:90===M&&"top"===A?G:.5,T=G/2*(M/90)),w.xFn=function(t){return t.dx+y+T*t.fontSize},w.yFn=function(t){return t.dy+v+t.fontSize*x},w.anchorFn=function(t,e){if(u){if(l)return"end";if(c)return"start"}return n(e)&&0!==e&&180!==e?e*_<0!==h?"end":"start":"middle"},w.heightFn=function(e,r,n){return r<-60||r>60?-.5*n:"top"===t.side!==h?-n:0};else if("y"===k){if(_=(b=!h&&"left"===A||h&&"right"===A)?1:-1,h&&(_*=-1),y=f,v=d*_,x=0,!h&&90===Math.abs(M)&&(x=-90===M&&"left"===A||90===M&&"right"===A?W:.5),h){var S=n(M)?+M:0;if(0!==S){var E=o.deg2rad(S);T=Math.abs(Math.sin(E))*W*_,x=0}}w.xFn=function(t){return t.dx+e-(y+t.fontSize*x)*_+T*t.fontSize},w.yFn=function(t){return t.dy+v+t.fontSize*G},w.anchorFn=function(t,e){return n(e)&&90===Math.abs(e)?"middle":b?"end":"start"},w.heightFn=function(e,r,n){return"right"===t.side&&(r*=-1),r<-30?-n:r<30?-.5*n:0}}return w},X.drawTicks=function(t,e,n){n=n||{};var i=e._id+"tick",a=[].concat(e.minor&&e.minor.ticks?n.vals.filter((function(t){return t.minor&&!t.noTick})):[]).concat(e.ticks?n.vals.filter((function(t){return!t.minor&&!t.noTick})):[]),o=n.layer.selectAll("path."+i).data(a,Et);o.exit().remove(),o.enter().append("path").classed(i,1).classed("ticks",1).classed("crisp",!1!==n.crisp).each((function(t){return u.stroke(r.select(this),t.minor?e.minor.tickcolor:e.tickcolor)})).style("stroke-width",(function(r){return h.crispRound(t,r.minor?e.minor.tickwidth:e.tickwidth,1)+"px"})).attr("d",n.path).style("display",null),Ut(e,[N]),o.attr("transform",n.transFn)},X.drawGrid=function(t,e,n){if(n=n||{},"sync"!==e.tickmode){var i=e._id+"grid",a=e.minor&&e.minor.showgrid,o=a?n.vals.filter((function(t){return t.minor})):[],s=e.showgrid?n.vals.filter((function(t){return!t.minor})):[],l=n.counterAxis;if(l&&X.shouldShowZeroLine(t,e,l))for(var c="array"===e.tickmode,p=0;p=0;y--){var v=y?m:g;if(v){var x=v.selectAll("path."+i).data(y?s:o,Et);x.exit().remove(),x.enter().append("path").classed(i,1).classed("crisp",!1!==n.crisp),x.attr("transform",n.transFn).attr("d",n.path).each((function(t){return u.stroke(r.select(this),t.minor?e.minor.gridcolor:e.gridcolor||"#ddd")})).style("stroke-dasharray",(function(t){return h.dashStyle(t.minor?e.minor.griddash:e.griddash,t.minor?e.minor.gridwidth:e.gridwidth)})).style("stroke-width",(function(t){return(t.minor?d:e._gw)+"px"})).style("display",null),"function"==typeof n.path&&x.attr("d",n.path)}}Ut(e,[B,j])}},X.drawZeroLine=function(t,e,r){r=r||r;var n=e._id+"zl",i=X.shouldShowZeroLine(t,e,r.counterAxis),a=r.layer.selectAll("path."+n).data(i?[{x:0,id:e._id}]:[]);a.exit().remove(),a.enter().append("path").classed(n,1).classed("zl",1).classed("crisp",!1!==r.crisp).each((function(){r.layer.selectAll("path").sort((function(t,e){return J(t.id,e.id)}))})),a.attr("transform",r.transFn).attr("d",r.path).call(u.stroke,e.zerolinecolor||u.defaultLine).style("stroke-width",h.crispRound(t,e.zerolinewidth,e._gw||1)+"px").style("display",null),Ut(e,[F])},X.drawLabels=function(t,e,i){i=i||{};var a=t._fullLayout,c=e._id,u=i.cls||c+"tick",p=i.vals.filter((function(t){return t.text})),f=i.labelFns,d=i.secondary?0:e.tickangle,m=(e._prevTickAngles||{})[u],g=i.layer.selectAll("g."+u).data(e.showticklabels?p:[],Et),y=[];function v(t,a){t.each((function(t){var o=r.select(this),c=o.select(".text-math-group"),u=f.anchorFn(t,a),p=i.transFn.call(o.node(),t)+(n(a)&&0!=+a?" rotate("+a+","+f.xFn(t)+","+(f.yFn(t)-t.fontSize/2)+")":""),d=l.lineCount(o),m=Z*t.fontSize,g=f.heightFn(t,n(a)?+a:0,(d-1)*m);if(g&&(p+=s(0,g)),c.empty()){var y=o.select("text");y.attr({transform:p,"text-anchor":u}),y.style("opacity",1),e._adjustTickLabelsOverflow&&e._adjustTickLabelsOverflow()}else{var v=h.bBox(c.node()).width*{end:-.5,start:.5}[u];c.attr("transform",p+s(v,0))}}))}g.enter().append("g").classed(u,1).append("text").attr("text-anchor","middle").each((function(e){var n=r.select(this),i=t._promises.length;n.call(l.positionText,f.xFn(e),f.yFn(e)).call(h.font,{family:e.font,size:e.fontSize,color:e.fontColor,weight:e.fontWeight,style:e.fontStyle,variant:e.fontVariant,textcase:e.fontTextcase,lineposition:e.fontLineposition,shadow:e.fontShadow}).text(e.text).call(l.convertToTspans,t),t._promises[i]?y.push(t._promises.pop().then((function(){v(n,d)}))):v(n,d)})),Ut(e,[U]),g.exit().remove(),i.repositionOnUpdate&&g.each((function(t){r.select(this).select("text").call(l.positionText,f.xFn(t),f.yFn(t))})),e._adjustTickLabelsOverflow=function(){var n=e.ticklabeloverflow;if(n&&"allow"!==n){var i=-1!==n.indexOf("hide"),s="x"===e._id.charAt(0),l=0,c=s?t._fullLayout.width:t._fullLayout.height;if(-1!==n.indexOf("domain")){var u=o.simpleMap(e.range,e.r2l);l=e.l2p(u[0])+e._offset,c=e.l2p(u[1])+e._offset}var p=Math.min(l,c),f=Math.max(l,c),d=e.side,m=1/0,y=-1/0;for(var v in g.each((function(t){var n=r.select(this);if(n.select(".text-math-group").empty()){var a=h.bBox(n.node()),o=0;s?(a.right>f||a.leftf||a.top+(e.tickangle?0:t.fontSize/4)e["_visibleLabelMin_"+n._id]?l.style("display","none"):"tick"===t.K&&!i&&l.style("display",null)}))}))}))}))},v(g,m+1?m:d);var x=null;e._selections&&(e._selections[u]=g);var _=[function(){return y.length&&Promise.all(y)}];e.automargin&&a._redrawFromAutoMarginCount&&90===m?(x=m,_.push((function(){v(g,m)}))):_.push((function(){if(v(g,d),p.length&&e.autotickangles&&("log"!==e.type||"D"!==String(e.dtick).charAt(0))){x=e.autotickangles[0];var t,r=0,n=[],a=1;g.each((function(t){r=Math.max(r,t.fontSize);var i=e.l2p(t.x),o=Lt(this),s=h.bBox(o.node());a=Math.max(a,l.lineCount(o)),n.push({top:0,bottom:10,height:10,left:i-s.width/2,right:i+s.width/2+2,width:s.width+2})}));var s=("boundaries"===e.tickson||e.showdividers)&&!i.secondary,c=p.length,u=Math.abs((p[c-1].x-p[0].x)*e._m)/(c-1),f=s?u/2:u,m=s?e.ticklen:1.25*r*a,y=f/Math.sqrt(Math.pow(f,2)+Math.pow(m,2)),_=e.autotickangles.map((function(t){return t*Math.PI/180})),b=_.find((function(t){return Math.abs(Math.cos(t))<=y}));void 0===b&&(b=_.reduce((function(t,e){return Math.abs(Math.cos(t))O*D&&(L=D,E[S]=C[S]=P[S])}var R=Math.abs(L-I);R-A>0?A*=1+A/(R-=A):A=0,"y"!==e._id.charAt(0)&&(A=-A),E[M]=w.p2r(w.r2p(C[M])+k*A),"min"===w.autorange||"max reversed"===w.autorange?(E[0]=null,w._rangeInitial0=void 0,w._rangeInitial1=void 0):("max"===w.autorange||"min reversed"===w.autorange)&&(E[1]=null,w._rangeInitial0=void 0,w._rangeInitial1=void 0),a._insideTickLabelsUpdaterange[w._name+".range"]=E}var V=o.syncOrAsync(_);return V&&V.then&&t._promises.push(V),V},X.getPxPosition=function(t,e){var r,n=t._fullLayout._size,i=e._id.charAt(0),a=e.side;return"free"!==e.anchor?r=e._anchorAxis:"x"===i?r={_offset:n.t+(1-(e.position||0))*n.h,_length:0}:"y"===i&&(r={_offset:n.l+(e.position||0)*n.w+e._shift,_length:0}),"top"===a||"left"===a?r._offset:"bottom"===a||"right"===a?r._offset+r._length:void 0},X.shouldShowZeroLine=function(t,e,r){var n=o.simpleMap(e.range,e.r2l);return n[0]*n[1]<=0&&e.zeroline&&("linear"===e.type||"-"===e.type)&&!(e.rangebreaks&&e.maskBreaks(0)===R)&&(It(e,0)||!function(t,e,r,n){var i=r._mainAxis;if(i){var a=t._fullLayout,o=e._id.charAt(0),s=X.counterLetter(e._id),l=e._offset+(Math.abs(n[0])1)for(n=1;n4/3-s?o:s}}}),ur=f({"src/components/dragelement/cursor.js"(t,e){var r=le(),n=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];e.exports=function(t,e,i,a){return t="left"===i?0:"center"===i?1:"right"===i?2:r.constrain(Math.floor(3*t),0,2),e="bottom"===a?0:"middle"===a?1:"top"===a?2:r.constrain(Math.floor(3*e),0,2),n[e][t]}}}),hr=f({"src/components/dragelement/unhover.js"(t,e){var r=fe(),n=Jt(),i=It().getGraphDiv,a=B(),o=e.exports={};o.wrapped=function(t,e,r){(t=i(t))._fullLayout&&n.clear(t._fullLayout._uid+a.HOVERID),o.raw(t,e,r)},o.raw=function(t,e){var n=t._fullLayout,i=t._hoverdata;e||(e={}),(!e.target||t._dragged||!1!==r.triggerHandler(t,"plotly_beforehover",e))&&(n._hoverlayer.selectAll("g").remove(),n._hoverlayer.selectAll("line").remove(),n._hoverlayer.selectAll("circle").remove(),t._hoverdata=void 0,e.target&&i&&t.emit("plotly_unhover",{event:e,points:i}))}}}),pr=f({"src/components/dragelement/index.js"(t,e){var r=sr(),n=he(),i=lr(),a=le().removeElement,o=ve(),s=e.exports={};s.align=cr(),s.getCursor=ur();var l=hr();function c(){var t=document.createElement("div");t.className="dragcover";var e=t.style;return e.position="fixed",e.left=0,e.right=0,e.top=0,e.bottom=0,e.zIndex=999999999,e.background="none",document.body.appendChild(t),t}function u(t){return r(t.changedTouches?t.changedTouches[0]:t,document.body)}s.unhover=l.wrapped,s.unhoverRaw=l.raw,s.init=function(t){var e,r,l,h,p,f,d,m,g=t.gd,y=1,v=g._context.doubleClickDelay,x=t.element;g._mouseDownTime||(g._mouseDownTime=0),x.style.pointerEvents="all",x.onmousedown=b,i?(x._ontouchstart&&x.removeEventListener("touchstart",x._ontouchstart),x._ontouchstart=b,x.addEventListener("touchstart",b,{passive:!1})):x.ontouchstart=b;var _=t.clampFn||function(t,e,r){return Math.abs(t)"u"&&typeof i.clientY>"u"&&(i.clientX=e,i.clientY=r),(l=(new Date).getTime())-g._mouseDownTimev&&(y=Math.max(y-1,1)),g._dragged?t.doneFn&&t.doneFn():(f.target===d?r=f:(r={target:d,srcElement:d,toElement:d},Object.keys(f).concat(Object.keys(f.__proto__)).forEach((t=>{var e=f[t];!r[t]&&"function"!=typeof e&&(r[t]=e)}))),t.clickFn&&t.clickFn(y,r),m||d.dispatchEvent(new MouseEvent("click",e))),g._dragging=!1,g._dragged=!1):g._dragged=!1}},s.coverSlip=c}}),fr=f({"src/lib/setcursor.js"(t,e){e.exports=function(t,e){(t.attr("class")||"").split(" ").forEach((function(e){0===e.indexOf("cursor-")&&t.classed(e,!1)})),e&&t.classed("cursor-"+e,!0)}}}),dr=f({"src/lib/override_cursor.js"(t,e){var r=fr(),n="data-savedcursor";e.exports=function(t,e){var i=t.attr(n);if(e){if(!i){for(var a=(t.attr("class")||"").split(" "),o=0;o("legend"===t?1:0));if(!1===M&&(c[t]=void 0),(!1!==M||h.uirevision)&&(f("uirevision",c.uirevision),!1!==M)){f("borderwidth");var S,E,C,I="h"===f("orientation"),L="paper"===f("yref"),P="paper"===f("xref"),z="left";if(I?(S=0,r.getComponentMethod("rangeslider","isVisible")(e.xaxis)?L?(E=1.1,C="bottom"):(E=1,C="top"):L?(E=-.1,C="top"):(E=0,C="bottom")):(E=1,C="auto",P?S=1.02:(S=1,z="right")),n.coerce(h,p,{x:{valType:"number",editType:"legend",min:P?-2:0,max:P?3:1,dflt:S}},"x"),n.coerce(h,p,{y:{valType:"number",editType:"legend",min:L?-2:0,max:L?3:1,dflt:E}},"y"),f("traceorder",b),l.isGrouped(c[t])&&f("tracegroupgap"),f("entrywidth"),f("entrywidthmode"),f("indentation"),f("itemsizing"),f("itemwidth"),f("itemclick"),f("itemdoubleclick"),f("groupclick"),f("xanchor",z),f("yanchor",C),f("valign"),n.noneOrAll(h,p,["x","y"]),f("title.text")){f("title.side",I?"left":"top");var D=n.extendFlat({},d,{size:n.bigFont(d.size)});n.coerceFont(f,"title.font",D)}}}}e.exports=function(t,e,r){var i,a=r.slice(),o=e.shapes;if(o)for(i=0;iS&&(M=S)}A[a][0]._groupMinRank=M,A[a][0]._preGroupSort=a}var E=function(t,e){return t.trace.legendrank-e.trace.legendrank||t._preSort-e._preSort};for(A.forEach((function(t,e){t[0]._preGroupSort=e})),A.sort((function(t,e){return t[0]._groupMinRank-e[0]._groupMinRank||t[0]._preGroupSort-e[0]._preGroupSort})),a=0;ar?r:t}e.exports=function(t,e,g){var y=e._fullLayout;g||(g=y.legend);var v="constant"===g.itemsizing,x=g.itemwidth,_=(x+2*p.itemGap)/2,b=a(_,0),w=function(t,e,r,n){var i;if(t+1)i=t;else{if(!(e&&e.width>0))return 0;i=e.width}return v?n:Math.min(i,r)};function T(t,i,a){var c=t[0].trace,u=c.marker||{},h=u.line||{},p=u.cornerradius?"M6,3a3,3,0,0,1-3,3H-3a3,3,0,0,1-3-3V-3a3,3,0,0,1,3-3H3a3,3,0,0,1,3,3Z":"M6,6H-6V-6H6Z",f=a?c.visible&&c.type===a:n.traceIs(c,"bar"),d=r.select(i).select("g.legendpoints").selectAll("path.legend"+a).data(f?[t]:[]);d.enter().append("path").classed("legend"+a,!0).attr("d",p).attr("transform",b),d.exit().remove(),d.each((function(t){var n=r.select(this),i=t[0],a=w(i.mlw,u.line,5,2);n.style("stroke-width",a+"px");var p=i.mcc;if(!g._inHover&&"mc"in i){var f=l(u),d=f.mid;void 0===d&&(d=(f.max+f.min)/2),p=o.tryColorscale(u,"")(d)}var y=p||i.mc||u.color,v=u.pattern,x=v&&o.getPatternAttr(v.shape,0,"");if(x){var _=o.getPatternAttr(v.bgcolor,0,null),b=o.getPatternAttr(v.fgcolor,0,null),T=v.fgopacity,A=m(v.size,8,10),k=m(v.solidity,.5,1),M="legend-"+c.uid;n.call(o.pattern,"legend",e,M,x,A,k,p,v.fillmode,_,b,T)}else n.call(s.fill,y);a&&s.stroke(n,i.mlc||h.color)}))}function A(t,a,o){var s=t[0],l=s.trace,c=o?l.visible&&l.type===o:n.traceIs(l,o),p=r.select(a).select("g.legendpoints").selectAll("path.legend"+o).data(c?[t]:[]);if(p.enter().append("path").classed("legend"+o,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",b),p.exit().remove(),p.size()){var f=l.marker||{},d=w(h(f.line.width,s.pts),f.line,5,2),m="pieLike",g=i.minExtend(l,{marker:{line:{width:d}}},m),y=i.minExtend(s,{trace:g},m);u(p,y,g,e)}}t.each((function(t){var e=r.select(this),n=i.ensureSingle(e,"g","layers");n.style("opacity",t[0].trace.opacity);var o=g.indentation,s=g.valign,l=t[0].lineHeight,c=t[0].height;if("middle"===s&&0===o||!l||!c)n.attr("transform",null);else{var u={top:1,bottom:-1}[s]*(.5*(l-c+3))||0,h=g.indentation;n.attr("transform",a(h,u))}n.selectAll("g.legendfill").data([t]).enter().append("g").classed("legendfill",!0),n.selectAll("g.legendlines").data([t]).enter().append("g").classed("legendlines",!0);var p=n.selectAll("g.legendsymbols").data([t]);p.enter().append("g").classed("legendsymbols",!0),p.selectAll("g.legendpoints").data([t]).enter().append("g").classed("legendpoints",!0)})).each((function(t){var n,a=t[0].trace,c=[];if(a.visible)switch(a.type){case"histogram2d":case"heatmap":c=[["M-15,-2V4H15V-2Z"]],n=!0;break;case"choropleth":case"choroplethmapbox":case"choroplethmap":c=[["M-6,-6V6H6V-6Z"]],n=!0;break;case"densitymapbox":case"densitymap":c=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],n="radial";break;case"cone":c=[["M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z"],["M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z"],["M-6,-2 A2,2 0 0,0 -6,2 L6,0Z"]],n=!1;break;case"streamtube":c=[["M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z"],["M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z"],["M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z"]],n=!1;break;case"surface":c=[["M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z"],["M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z"]],n=!0;break;case"mesh3d":c=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],n=!1;break;case"volume":c=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],n=!0;break;case"isosurface":c=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],n=!1}var u=r.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(c);u.enter().append("path").classed("legend3dandfriends",!0).attr("transform",b).style("stroke-miterlimit",1),u.exit().remove(),u.each((function(t,c){var u,h=r.select(this),p=l(a),d=p.colorscale,m=p.reversescale;if(d){if(!n){var g=d.length;u=0===c?d[m?g-1:0][1]:1===c?d[m?0:g-1][1]:d[Math.floor((g-1)/2)][1]}}else{var y=a.vertexcolor||a.facecolor||a.color;u=i.isArrayOrTypedArray(y)?y[c]||y[0]:y}h.attr("d",t[0]),u?h.call(s.fill,u):h.call((function(t){if(t.size()){var r="legendfill-"+a.uid;o.gradient(t,e,r,f(m,"radial"===n),d,"fill")}}))}))})).each((function(t){var e=t[0].trace,n="waterfall"===e.type;if(t[0]._distinct&&n){var i=t[0].trace[t[0].dir].marker;return t[0].mc=i.color,t[0].mlw=i.line.width,t[0].mlc=i.line.color,T(t,this,"waterfall")}var a=[];e.visible&&n&&(a=t[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var o=r.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(a);o.enter().append("path").classed("legendwaterfall",!0).attr("transform",b).style("stroke-miterlimit",1),o.exit().remove(),o.each((function(t){var n=r.select(this),i=e[t[0]].marker,a=w(void 0,i.line,5,2);n.attr("d",t[1]).style("stroke-width",a+"px").call(s.fill,i.color),a&&n.call(s.stroke,i.line.color)}))})).each((function(t){T(t,this,"funnel")})).each((function(t){T(t,this)})).each((function(t){var a=t[0].trace,l=r.select(this).select("g.legendpoints").selectAll("path.legendbox").data(a.visible&&n.traceIs(a,"box-violin")?[t]:[]);l.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",b),l.exit().remove(),l.each((function(){var t=r.select(this);if("all"!==a.boxpoints&&"all"!==a.points||0!==s.opacity(a.fillcolor)||0!==s.opacity((a.line||{}).color)){var n=w(void 0,a.line,5,2);t.style("stroke-width",n+"px").call(s.fill,a.fillcolor),n&&s.stroke(t,a.line.color)}else{var c=i.minExtend(a,{marker:{size:v?12:i.constrain(a.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});l.call(o.pointStyle,c,e)}}))})).each((function(t){A(t,this,"funnelarea")})).each((function(t){A(t,this,"pie")})).each((function(t){var n,a,s=d(t),u=s.showFill,h=s.showLine,p=s.showGradientLine,m=s.showGradientFill,g=s.anyFill,y=s.anyLine,v=t[0],_=v.trace,b=l(_),T=b.colorscale,A=b.reversescale,k=c.hasMarkers(_)||!g?"M5,0":y?"M5,-2":"M5,-3",M=r.select(this),S=M.select(".legendfill").selectAll("path").data(u||m?[t]:[]);if(S.enter().append("path").classed("js-fill",!0),S.exit().remove(),S.attr("d",k+"h"+x+"v6h-"+x+"z").call((function(t){if(t.size())if(u)o.fillGroupStyle(t,e,!0);else{var r="legendfill-"+_.uid;o.gradient(t,e,r,f(A),T,"fill")}})),h||p){var E=w(void 0,_.line,10,5);a=i.minExtend(_,{line:{width:E}}),n=[i.minExtend(v,{trace:a})]}var C=M.select(".legendlines").selectAll("path").data(h||p?[n]:[]);C.enter().append("path").classed("js-line",!0),C.exit().remove(),C.attr("d",k+(p?"l"+x+",0.0001":"h"+x)).call(h?o.lineGroupStyle:function(t){if(t.size()){var r="legendline-"+_.uid;o.lineGroupStyle(t),o.gradient(t,e,r,f(A),T,"stroke")}})})).each((function(t){var n,a,s=d(t),l=s.anyFill,u=s.anyLine,h=s.showLine,p=s.showMarker,f=t[0],m=f.trace,g=!p&&!u&&!l&&c.hasText(m);function y(t,e,r,n){var a=i.nestedProperty(m,t).get(),o=i.isArrayOrTypedArray(a)&&e?e(a):a;if(v&&o&&void 0!==n&&(o=n),r){if(or[1])return r[1]}return o}function x(t){return f._distinct&&f.index&&t[f.index]?t[f.index]:t[0]}if(p||g||h){var _={},w={};if(p){_.mc=y("marker.color",x),_.mx=y("marker.symbol",x),_.mo=y("marker.opacity",i.mean,[.2,1]),_.mlc=y("marker.line.color",x),_.mlw=y("marker.line.width",i.mean,[0,5],2),w.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var T=y("marker.size",i.mean,[2,16],12);_.ms=T,w.marker.size=T}h&&(w.line={width:y("line.width",x,[0,10],5)}),g&&(_.tx="Aa",_.tp=y("textposition",x),_.ts=10,_.tc=y("textfont.color",x),_.tf=y("textfont.family",x),_.tw=y("textfont.weight",x),_.ty=y("textfont.style",x),_.tv=y("textfont.variant",x),_.tC=y("textfont.textcase",x),_.tE=y("textfont.lineposition",x),_.tS=y("textfont.shadow",x)),n=[i.minExtend(f,_)],(a=i.minExtend(m,w)).selectedpoints=null,a.texttemplate=null}var A=r.select(this).select("g.legendpoints"),k=A.selectAll("path.scatterpts").data(p?n:[]);k.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",b),k.exit().remove(),k.call(o.pointStyle,a,e),p&&(n[0].mrc=3);var M=A.selectAll("g.pointtext").data(g?n:[]);M.enter().append("g").classed("pointtext",!0).append("text").attr("transform",b),M.exit().remove(),M.selectAll("text").call(o.textPointStyle,a,e)})).each((function(t){var e=t[0].trace,n=r.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(e.visible&&"candlestick"===e.type?[t,t]:[]);n.enter().append("path").classed("legendcandle",!0).attr("d",(function(t,e){return e?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"})).attr("transform",b).style("stroke-miterlimit",1),n.exit().remove(),n.each((function(t,n){var i=r.select(this),a=e[n?"increasing":"decreasing"],o=w(void 0,a.line,5,2);i.style("stroke-width",o+"px").call(s.fill,a.fillcolor),o&&s.stroke(i,a.line.color)}))})).each((function(t){var e=t[0].trace,n=r.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(e.visible&&"ohlc"===e.type?[t,t]:[]);n.enter().append("path").classed("legendohlc",!0).attr("d",(function(t,e){return e?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"})).attr("transform",b).style("stroke-miterlimit",1),n.exit().remove(),n.each((function(t,n){var i=r.select(this),a=e[n?"increasing":"decreasing"],l=w(void 0,a.line,5,2);i.style("fill","none").call(o.dashLine,a.line.dash,l),l&&s.stroke(i,a.line.color)}))}))}}}),kr=f({"src/components/legend/draw.js"(t,e){var r=x(),n=le(),i=Ae(),a=qt(),o=fe(),s=pr(),l=Qe(),c=H(),u=Se(),h=vr(),p=xr(),f=Me(),d=f.LINE_SPACING,m=f.FROM_TL,g=f.FROM_BR,y=_r(),v=Ar(),_=gr(),b=/^legend[0-9]*$/;function w(t,e){var o,h,f=e||{},x=t._fullLayout,b=L(f),w=f._inHover;if(w?(h=f.layer,o="hover"):(h=x._infolayer,o=b),h){var M;if(o+=x._uid,t._legendMouseDownTime||(t._legendMouseDownTime=0),w){if(!f.entries)return;M=y(f.entries,f)}else{for(var P=(t.calcdata||[]).slice(),z=x.shapes,D=0;D1)}var F=x.hiddenlabels||[];if(!(w||x.showlegend&&M.length))return h.selectAll("."+b).remove(),x._topdefs.select("#"+o).remove(),i.autoMargin(t,b);var B=n.ensureSingle(h,"g",b,(function(t){w||t.attr("pointer-events","all")})),j=n.ensureSingleById(x._topdefs,"clipPath",o,(function(t){t.append("rect")})),N=n.ensureSingle(B,"rect","bg",(function(t){t.attr("shape-rendering","crispEdges")}));N.call(c.stroke,f.bordercolor).call(c.fill,f.bgcolor).style("stroke-width",f.borderwidth+"px");var U,V=n.ensureSingle(B,"g","scrollbox"),q=f.title;f._titleWidth=0,f._titleHeight=0,q.text?((U=n.ensureSingle(V,"text",b+"titletext")).attr("text-anchor","start").call(l.font,q.font).text(q.text),E(U,V,t,f,1)):V.selectAll("."+b+"titletext").remove();var H=n.ensureSingle(B,"rect","scrollbar",(function(t){t.attr(p.scrollBarEnterAttrs).call(c.fill,p.scrollBarColor)})),G=V.selectAll("g.groups").data(M);G.enter().append("g").attr("class","groups"),G.exit().remove();var W=G.selectAll("g.traces").data(n.identity);W.enter().append("g").attr("class","traces"),W.exit().remove(),W.style("opacity",(function(t){var e=t[0].trace;return a.traceIs(e,"pie-like")?-1!==F.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1})).each((function(){r.select(this).call(k,t,f)})).call(v,t,f).each((function(){w||r.select(this).call(S,t,b)})),n.syncOrAsync([i.previousPromises,function(){return function(t,e,n,i){var a=t._fullLayout,o=L(i);i||(i=a[o]);var s=a._size,c=_.isVertical(i),u=_.isGrouped(i),h="fraction"===i.entrywidthmode,f=i.borderwidth,d=2*f,m=p.itemGap,g=i.indentation+i.itemwidth+2*m,y=2*(f+m),v=I(i),x=i.y<0||0===i.y&&"top"===v,b=i.y>1||1===i.y&&"bottom"===v,w=i.tracegroupgap,A={};i._maxHeight=Math.max(x||b?a.height/2:s.h,30);var k=0;i._width=0,i._height=0;var M=function(t){var e=0,r=0,n=t.title.side;return n&&(-1!==n.indexOf("left")&&(e=t._titleWidth),-1!==n.indexOf("top")&&(r=t._titleHeight)),[e,r]}(i);if(c)n.each((function(t){var e=t[0].height;l.setTranslate(this,f+M[0],f+M[1]+i._height+e/2+m),i._height+=e,i._width=Math.max(i._width,t[0].width)})),k=g+i._width,i._width+=m+g+d,i._height+=y,u&&(e.each((function(t,e){l.setTranslate(this,0,e*i.tracegroupgap)})),i._height+=(i._lgroupsLength-1)*i.tracegroupgap);else{var S=C(i),E=i.x<0||0===i.x&&"right"===S,P=i.x>1||1===i.x&&"left"===S,z=b||x,D=a.width/2;i._maxWidth=Math.max(E?z&&"left"===S?s.l+s.w:D:P?z&&"right"===S?s.r+s.w:D:s.w,2*g);var O=0,R=0;n.each((function(t){var e=T(t,i,g);O=Math.max(O,e),R+=e})),k=null;var F=0;if(u){var B=0,j=0,N=0;e.each((function(){var t=0,e=0;r.select(this).selectAll("g.traces").each((function(r){var n=T(r,i,g),a=r[0].height;l.setTranslate(this,M[0],M[1]+f+m+a/2+e),e+=a,t=Math.max(t,n),A[r[0].trace.legendgroup]=t}));var n=t+m;j>0&&n+f+j>i._maxWidth?(F=Math.max(F,j),j=0,N+=B+w,B=e):B=Math.max(B,e),l.setTranslate(this,j,N),j+=n})),i._width=Math.max(F,j)+f,i._height=N+B+y}else{var U=n.size(),V=R+d+(U-1)*m=i._maxWidth&&(F=Math.max(F,W),H=0,G+=q,i._height+=q,q=0),l.setTranslate(this,M[0]+f+H,M[1]+f+G+e/2+m),W=H+r+m,H+=n,q=Math.max(q,e)})),V?(i._width=H+d,i._height=q+y):(i._width=Math.max(F,W)+d,i._height+=q+y)}}i._width=Math.ceil(Math.max(i._width+M[0],i._titleWidth+2*(f+p.titlePad))),i._height=Math.ceil(Math.max(i._height+M[1],i._titleHeight+2*(f+p.itemGap))),i._effHeight=Math.min(i._height,i._maxHeight);var Z=t._context.edits,Y=Z.legendText||Z.legendPosition;n.each((function(t){var e=r.select(this).select("."+o+"toggle"),n=t[0].height,a=t[0].trace.legendgroup,s=T(t,i,g);u&&""!==a&&(s=A[a]);var p=Y?g:k||s;!c&&!h&&(p+=m/2),l.setRect(e,0,-n/2,p,n)}))}(t,G,W,f)},function(){var e,c,y,v,_=x._size,T=f.borderwidth,k="paper"===f.xref,M="paper"===f.yref;if(q.text&&function(t,e,r){if("top center"===e.title.side||"top right"===e.title.side){var n=e.title.font.size*d,i=0,a=t.node(),o=l.bBox(a).width;"top center"===e.title.side?i=.5*(e._width-2*r-2*p.titlePad-o):"top right"===e.title.side&&(i=e._width-2*r-2*p.titlePad-o),u.positionText(t,r+p.titlePad+i,r+n)}}(U,f,T),!w){var S,E;S=k?_.l+_.w*f.x-m[C(f)]*f._width:x.width*f.x-m[C(f)]*f._width,E=M?_.t+_.h*(1-f.y)-m[I(f)]*f._effHeight:x.height*(1-f.y)-m[I(f)]*f._effHeight;var L=function(t,e,r,n){var a=t._fullLayout,o=a[e],s=C(o),l=I(o),c="paper"===o.xref,u="paper"===o.yref;t._fullLayout._reservedMargin[e]={};var h=o.y<.5?"b":"t",p=o.x<.5?"l":"r",f={r:a.width-r,l:r+o._width,b:a.height-n,t:n+o._effHeight};if(c&&u)return i.autoMargin(t,e,{x:o.x,y:o.y,l:o._width*m[s],r:o._width*g[s],b:o._effHeight*g[l],t:o._effHeight*m[l]});c?t._fullLayout._reservedMargin[e][h]=f[h]:u||"v"===o.orientation?t._fullLayout._reservedMargin[e][p]=f[p]:t._fullLayout._reservedMargin[e][h]=f[h]}(t,b,S,E);if(L)return;if(x.margin.autoexpand){var P=S,z=E;S=k?n.constrain(S,0,x.width-f._width):P,E=M?n.constrain(E,0,x.height-f._effHeight):z,S!==P&&n.log("Constrain "+b+".x to make legend fit inside graph"),E!==z&&n.log("Constrain "+b+".y to make legend fit inside graph")}l.setTranslate(B,S,E)}if(H.on(".drag",null),B.on("wheel",null),w||f._height<=f._maxHeight||t._context.staticPlot){var D=f._effHeight;w&&(D=f._height),N.attr({width:f._width-T,height:D-T,x:T/2,y:T/2}),l.setTranslate(V,0,0),j.select("rect").attr({width:f._width-2*T,height:D-2*T,x:T,y:T}),l.setClipUrl(V,o,t),l.setRect(H,0,0,0,0),delete f._scrollY}else{var O=Math.max(p.scrollBarMinHeight,f._effHeight*f._effHeight/f._height),R=f._effHeight-O-2*p.scrollBarMargin,F=f._height-f._effHeight,G=R/F,W=Math.min(f._scrollY||0,F);N.attr({width:f._width-2*T+p.scrollBarWidth+p.scrollBarMargin,height:f._effHeight-T,x:T/2,y:T/2}),j.select("rect").attr({width:f._width-2*T+p.scrollBarWidth+p.scrollBarMargin,height:f._effHeight-2*T,x:T,y:T+W}),l.setClipUrl(V,o,t),J(W,O,G),B.on("wheel",(function(){J(W=n.constrain(f._scrollY+r.event.deltaY/R*F,0,F),O,G),0!==W&&W!==F&&r.event.preventDefault()}));var Z,Y,X,$=r.behavior.drag().on("dragstart",(function(){var t=r.event.sourceEvent;Z="touchstart"===t.type?t.changedTouches[0].clientY:t.clientY,X=W})).on("drag",(function(){var t=r.event.sourceEvent;2===t.buttons||t.ctrlKey||(Y="touchmove"===t.type?t.changedTouches[0].clientY:t.clientY,W=function(t,e,r){var i=(r-e)/G+t;return n.constrain(i,0,F)}(X,Z,Y),J(W,O,G))}));H.call($);var K=r.behavior.drag().on("dragstart",(function(){var t=r.event.sourceEvent;"touchstart"===t.type&&(Z=t.changedTouches[0].clientY,X=W)})).on("drag",(function(){var t=r.event.sourceEvent;"touchmove"===t.type&&(Y=t.changedTouches[0].clientY,W=function(t,e,r){var i=(e-r)/G+t;return n.constrain(i,0,F)}(X,Z,Y),J(W,O,G))}));V.call(K)}function J(e,r,n){f._scrollY=t._fullLayout[b]._scrollY=e,l.setTranslate(V,0,-e),l.setRect(H,f._width,p.scrollBarMargin+e*n,p.scrollBarWidth,r),j.select("rect").attr("y",T+e)}t._context.edits.legendPosition&&(B.classed("cursor-move",!0),s.init({element:B.node(),gd:t,prepFn:function(t){if(t.target!==H.node()){var e=l.getTranslate(B);y=e.x,v=e.y}},moveFn:function(t,r){if(void 0!==y&&void 0!==v){var n=y+t,i=v+r;l.setTranslate(B,n,i),e=s.align(n,f._width,_.l,_.l+_.w,f.xanchor),c=s.align(i+f._height,-f._height,_.t+_.h,_.t,f.yanchor)}},doneFn:function(){if(void 0!==e&&void 0!==c){var r={};r[b+".x"]=e,r[b+".y"]=c,a.call("_guiRelayout",t,r)}},clickFn:function(e,r){var n=h.selectAll("g.traces").filter((function(){var t=this.getBoundingClientRect();return r.clientX>=t.left&&r.clientX<=t.right&&r.clientY>=t.top&&r.clientY<=t.bottom}));n.size()>0&&A(t,B,n,e,r)}}))}],t)}}function T(t,e,r){var n=t[0],i=n.width,a=e.entrywidthmode,o=n.trace.legendwidth||e.entrywidth;return"fraction"===a?e._maxWidth*o:r+(o||i)}function A(t,e,r,n,i){var s=r.data()[0][0].trace,l={event:i,node:r.node(),curveNumber:s.index,expandedIndex:s.index,data:t.data,layout:t.layout,frames:t._transitionData._frames,config:t._context,fullData:t._fullData,fullLayout:t._fullLayout};s._group&&(l.group=s._group),a.traceIs(s,"pie-like")&&(l.label=r.datum()[0].label);var c=o.triggerHandler(t,"plotly_legendclick",l);if(1===n){if(!1===c)return;e._clickTimeout=setTimeout((function(){t._fullLayout&&h(r,t,n)}),t._context.doubleClickDelay)}else 2===n&&(e._clickTimeout&&clearTimeout(e._clickTimeout),t._legendMouseDownTime=0,!1!==o.triggerHandler(t,"plotly_legenddoubleclick",l)&&!1!==c&&h(r,t,n))}function k(t,e,r){var i,o,s=L(r),c=t.data()[0][0],h=c.trace,f=a.traceIs(h,"pie-like"),d=!r._inHover&&e._context.edits.legendText&&!f,m=r._maxNameLength;c.groupTitle?(i=c.groupTitle.text,o=c.groupTitle.font):(o=r.font,r.entries?i=c.text:(i=f?c.label:h.name,h._meta&&(i=n.templateString(i,h._meta))));var g=n.ensureSingle(t,"text",s+"text");g.attr("text-anchor","start").call(l.font,o).text(d?M(i,m):i);var y=r.indentation+r.itemwidth+2*p.itemGap;u.positionText(g,y,0),d?g.call(u.makeEditable,{gd:e,text:i}).call(E,t,e,r).on("edit",(function(n){this.text(M(n,m)).call(E,t,e,r);var i=c.trace._fullInput||{},o={};return o.name=n,i._isShape?a.call("_guiRelayout",e,"shapes["+h.index+"].name",o.name):a.call("_guiRestyle",e,o,h.index)})):E(g,t,e,r)}function M(t,e){var r=Math.max(4,e);if(t&&t.trim().length>=r/2)return t;for(var n=r-(t=t||"").length;n>0;n--)t+=" ";return t}function S(t,e,i){var a,o=e._context.doubleClickDelay,s=1,l=n.ensureSingle(t,"rect",i+"toggle",(function(t){e._context.staticPlot||t.style("cursor","pointer").attr("pointer-events","all"),t.call(c.fill,"rgba(0,0,0,0)")}));e._context.staticPlot||(l.on("mousedown",(function(){(a=(new Date).getTime())-e._legendMouseDownTimeo&&(s=Math.max(s-1,1)),A(e,n,t,s,r.event)}})))}function E(t,e,r,n,i){n._inHover&&t.attr("data-notex",!0),u.convertToTspans(t,r,(function(){!function(t,e,r,n){var i=t.data()[0][0];if(r._inHover||!i||i.trace.showlegend){var a=t.select("g[class*=math-group]"),o=a.node(),s=L(r);r||(r=e._fullLayout[s]);var c,h,f=r.borderwidth,m=(1===n?r.title.font:i.groupTitle?i.groupTitle.font:r.font).size*d;if(o){var g=l.bBox(o);c=g.height,h=g.width,1===n?l.setTranslate(a,f,f+.75*c):l.setTranslate(a,0,.25*c)}else{var y="."+s+(1===n?"title":"")+"text",v=t.select(y),x=u.lineCount(v),_=v.node();if(c=m*x,h=_?l.bBox(_).width:0,1===n)"left"===r.title.side&&(h+=2*p.itemGap),u.positionText(v,f+p.titlePad,f+m);else{var b=2*p.itemGap+r.indentation+r.itemwidth;i.groupTitle&&(b=p.itemGap,h-=r.indentation+r.itemwidth),u.positionText(v,b,-m*((x-1)/2-.3))}}1===n?(r._titleWidth=h,r._titleHeight=c):(i.lineHeight=m,i.height=Math.max(c,16)+3,i.width=h)}else t.remove()}(e,r,n,i)}))}function C(t){return n.isRightAnchor(t)?"right":n.isCenterAnchor(t)?"center":"left"}function I(t){return n.isBottomAnchor(t)?"bottom":n.isMiddleAnchor(t)?"middle":"top"}function L(t){return t._id||"legend"}e.exports=function(t,e){if(e)w(t,e);else{var n=t._fullLayout,i=n._legends;n._infolayer.selectAll('[class^="legend"]').each((function(){var t=r.select(this),e=t.attr("class").split(" ")[0];e.match(b)&&-1===i.indexOf(e)&&t.remove()}));for(var a=0;a$[0]._length||bt<0||bt>K[0]._length)return f.unhoverRaw(t,n)}else _t="xpx"in n?n.xpx:$[0]._length/2,bt="ypx"in n?n.ypx:K[0]._length/2;if(n.pointerX=_t+$[0]._offset,n.pointerY=bt+K[0]._offset,nt="xval"in n?y.flat(_,n.xval):y.p2c($,_t),it="yval"in n?y.flat(_,n.yval):y.p2c(K,bt),!r(nt[0])||!r(it[0]))return i.warn("Fx.hover failed",n,t),f.unhoverRaw(t,n)}var kt=1/0;function Mt(e,a){for(ot=0;otmt&&(gt.splice(0,mt),kt=gt[0].distance),M&&0!==rt&&0===gt.length){dt.distance=rt,dt.index=!1;var u=lt._module.hoverPoints(dt,pt,ft,"closest",{hoverLayer:b._hoverlayer});if(u&&(u=u.filter((function(t){return t.spikeDistance<=rt}))),u&&u.length){var h,f=u.filter((function(t){return t.xa.showspikes&&"hovered data"!==t.xa.spikesnap}));if(f.length){var d=f[0];r(d.x0)&&r(d.y0)&&(h=Et(d),(!vt.vLinePoint||vt.vLinePoint.spikeDistance>h.spikeDistance)&&(vt.vLinePoint=h))}var m=u.filter((function(t){return t.ya.showspikes&&"hovered data"!==t.ya.spikesnap}));if(m.length){var g=m[0];r(g.x0)&&r(g.y0)&&(h=Et(g),(!vt.hLinePoint||vt.hLinePoint.spikeDistance>h.spikeDistance)&&(vt.hLinePoint=h))}}}}}function St(t,e,r){for(var n,i=null,a=1/0,o=0;o0&&Math.abs(t.distance)jt-1;Nt--)Ht(gt[Nt]);gt=Ut,Pt()}var Gt=t._hoverdata,Wt=[],Zt=Z(t),Yt=Y(t);for(at=0;at1||gt.length>1)||"closest"===S&&xt&>.length>1,se=p.combine(b.plot_bgcolor||p.background,b.paper_bgcolor),le=R(gt,{gd:t,hovermode:S,rotateLabels:oe,bgColor:se,container:b._hoverlayer,outerContainer:b._paper.node(),commonLabelOpts:b.hoverlabel,hoverdistance:b.hoverdistance}),ce=le.hoverLabels;if(y.isUnifiedHover(S)||(function(t,e,r,n){var i,a,o,s,l,c,u,h=e?"xa":"ya",p=e?"ya":"xa",f=0,d=1,m=t.size(),g=new Array(m),y=0,v=n.minX,x=n.maxX,_=n.minY,b=n.maxY,w=function(t){return t*r._invScaleX},T=function(t){return t*r._invScaleY};function A(t){var e=t[0],r=t[t.length-1];if(a=e.pmin-e.pos-e.dp+e.size,o=r.pos+r.dp+r.size-e.pmax,a>.01){for(l=t.length-1;l>=0;l--)t[l].dp+=a;i=!1}if(!(o<.01)){if(a<-.01){for(l=t.length-1;l>=0;l--)t[l].dp-=o;i=!1}if(i){var n=0;for(s=0;se.pmax&&n++;for(s=t.length-1;s>=0&&!(n<=0);s--)(c=t[s]).pos>e.pmax-1&&(c.del=!0,n--);for(s=0;s=0;l--)t[l].dp-=o;for(s=t.length-1;s>=0&&!(n<=0);s--)(c=t[s]).pos+c.dp+c.size>e.pmax&&(c.del=!0,n--)}}}for(t.each((function(t){var n=t[h],i=t[p],a="x"===n._id.charAt(0),o=n.range;0===y&&o&&o[0]>o[1]!==a&&(d=-1);var s=0,l=a?r.width:r.height;if("x"===r.hovermode||"y"===r.hovermode){var c,u,f=j(t,e),m=t.anchor,A="end"===m?-1:1;if("middle"===m)u=(c=t.crossPos+(a?T(f.y-t.by/2):w(t.bx/2+t.tx2width/2)))+(a?T(t.by):w(t.bx));else if(a)u=(c=t.crossPos+T(E+f.y)-T(t.by/2-E))+T(t.by);else{var M=w(A*E+f.x),S=M+w(A*t.bx);c=t.crossPos+Math.min(M,S),u=t.crossPos+Math.max(M,S)}a?void 0!==_&&void 0!==b&&Math.min(u,b)-Math.max(c,_)>1&&("left"===i.side?(s=i._mainLinePosition,l=r.width):l=i._mainLinePosition):void 0!==v&&void 0!==x&&Math.min(u,x)-Math.max(c,v)>1&&("top"===i.side?(s=i._mainLinePosition,l=r.height):l=i._mainLinePosition)}g[y++]=[{datum:t,traceIndex:t.trace.index,dp:0,pos:t.pos,posref:t.posref,size:t.by*(a?k:1)/2,pmin:s,pmax:l}]})),g.sort((function(t,e){return t[0].posref-e[0].posref||d*(e[0].traceIndex-t[0].traceIndex)}));!i&&f<=m;){for(f++,i=!0,s=0;s.01){for(l=S.length-1;l>=0;l--)S[l].dp+=a;for(M.push.apply(M,S),g.splice(s+1,1),u=0,l=M.length-1;l>=0;l--)u+=M[l].dp;for(o=u/M.length,l=M.length-1;l>=0;l--)M[l].dp-=o;i=!1}else s++}g.forEach(A)}for(s=g.length-1;s>=0;s--){var L=g[s];for(l=L.length-1;l>=0;l--){var P=L[l],z=P.datum;z.offset=P.dp,z.del=P.del}}}(ce,oe,b,le.commonLabelBoundingBox),N(ce,oe,b._invScaleX,b._invScaleY)),c&&c.tagName){var ue=g.getComponentMethod("annotations","hasClickToShow")(t,Wt);u(e.select(c),ue?"pointer":"")}!c||s||!function(t,e,r){if(!r||r.length!==t._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var i=r[n],a=t._hoverdata[n];if(i.curveNumber!==a.curveNumber||String(i.pointNumber)!==String(a.pointNumber)||String(i.pointNumbers)!==String(a.pointNumbers))return!0}return!1}(t,0,Gt)||(Gt&&t.emit("plotly_unhover",{event:n,points:Gt}),t.emit("plotly_hover",{event:n,points:t._hoverdata,xaxes:$,yaxes:K,xvals:nt,yvals:it}))}(t,n,o,s,c)}))},t.loneHover=function(t,r){var n=!0;Array.isArray(t)||(n=!1,t=[t]);var i=r.gd,a=Z(i),o=Y(i),s=!1,l=R(t.map((function(t){var e=t._x0||t.x0||t.x||0,n=t._x1||t.x1||t.x||0,s=t._y0||t.y0||t.y||0,l=t._y1||t.y1||t.y||0,c=t.eventData;if(c){var u=Math.min(e,n),h=Math.max(e,n),f=Math.min(s,l),d=Math.max(s,l),m=t.trace;if(g.traceIs(m,"gl3d")){var y=i._fullLayout[m.scene]._scene.container,v=y.offsetLeft,x=y.offsetTop;u+=v,h+=v,f+=x,d+=x}c.bbox={x0:u+o,x1:h+o,y0:f+a,y1:d+a},r.inOut_bbox&&r.inOut_bbox.push(c.bbox)}else c=!1;return{color:t.color||p.defaultLine,x0:t.x0||t.x||0,x1:t.x1||t.x||0,y0:t.y0||t.y||0,y1:t.y1||t.y||0,xLabel:t.xLabel,yLabel:t.yLabel,zLabel:t.zLabel,text:t.text,name:t.name,idealAlign:t.idealAlign,borderColor:t.borderColor,fontFamily:t.fontFamily,fontSize:t.fontSize,fontColor:t.fontColor,fontWeight:t.fontWeight,fontStyle:t.fontStyle,fontVariant:t.fontVariant,nameLength:t.nameLength,textAlign:t.textAlign,trace:t.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:t.hovertemplate||!1,hovertemplateLabels:t.hovertemplateLabels||!1,eventData:c}})),{gd:i,hovermode:"closest",rotateLabels:s,bgColor:r.bgColor||p.background,container:e.select(r.container),outerContainer:r.outerContainer||r.container}).hoverLabels,c=0,u=0;return l.sort((function(t,e){return t.y0-e.y0})).each((function(t,e){var n=t.y0-t.by/2;t.offset=n-5([\s\S]*)<\/extra>/;function R(t,r){var n=r.gd,a=n._fullLayout,l=r.hovermode,u=r.rotateLabels,f=r.bgColor,d=r.container,m=r.outerContainer,x=r.commonLabelOpts||{};if(0===t.length)return[[]];var T=r.fontFamily||v.HOVERFONT,A=r.fontSize||v.HOVERFONTSIZE,k=r.fontWeight||a.font.weight,M=r.fontStyle||a.font.style,S=r.fontVariant||a.font.variant,I=r.fontTextcase||a.font.textcase,L=r.fontLineposition||a.font.lineposition,P=r.fontShadow||a.font.shadow,D=t[0],O=D.xa,R=D.ya,B=l.charAt(0),j=B+"Label",N=D[j];if(void 0===N&&"multicategory"===O.type)for(var U=0;Ua.width-w&&(z=a.width-w),r.attr("d","M"+(y-z)+",0L"+(y-z+E)+","+b+E+"H"+w+"v"+b+(2*C+_.height)+"H"+-w+"V"+b+E+"H"+(y-z-E)+"Z"),y=z,Q.minX=y-w,Q.maxX=y+w,"top"===O.side?(Q.minY=v-(2*C+_.height),Q.maxY=v-C):(Q.minY=v+C,Q.maxY=v+(2*C+_.height))}else{var F,B,j;"right"===R.side?(F="start",B=1,j="",y=O._offset+O._length):(F="end",B=-1,j="-",y=O._offset),v=R._offset+(D.y0+D.y1)/2,s.attr("text-anchor",F),r.attr("d","M0,0L"+j+E+","+E+"V"+(C+_.height/2)+"h"+j+(2*C+_.width)+"V-"+(C+_.height/2)+"H"+j+E+"V-"+E+"Z"),Q.minY=v-(C+_.height/2),Q.maxY=v+(C+_.height/2),"right"===R.side?(Q.minX=y+E,Q.maxX=y+E+(2*C+_.width)):(Q.minX=y-E-(2*C+_.width),Q.maxX=y-E);var U,V=_.height/2,H=q-_.top-V,G="clip"+a._uid+"commonlabel"+R._id;if(y<_.width+2*C+E){U="M-"+(E+C)+"-"+V+"h-"+(_.width-C)+"V"+V+"h"+(_.width-C)+"Z";var W=_.width-y+C;c.positionText(s,W,H),"end"===F&&s.selectAll("tspan").each((function(){var t=e.select(this),r=h.tester.append("text").text(t.text()).call(h.font,g),i=X(n,r.node());Math.round(i.width)=0?dt:mt+vt=0?mt:Mt+vt=0?pt:ft+xt=0?ft:St+xt=0,"top"!==t.idealAlign&&K||!J?K?(j+=V/2,t.anchor="start"):t.anchor="middle":(j-=V/2,t.anchor="end"),t.crossPos=j;else{if(t.pos=j,K=B+U/2+Q<=H,J=B-U/2-Q>=0,"left"!==t.idealAlign&&K||!J)if(K)B+=U/2,t.anchor="start";else{t.anchor="middle";var tt=Q/2,et=B+tt-H,rt=B-tt;et>0&&(B-=et),rt<0&&(B+=-rt)}else B-=U/2,t.anchor="end";t.crossPos=B}b.attr("text-anchor",t.anchor),D&&z.attr("text-anchor",t.anchor),r.attr("transform",o(B,j)+(u?s(w):""))})),{hoverLabels:Et,commonLabelBoundingBox:Q}}function F(t,e,r,n,a,o){var s="",l="";void 0!==t.nameOverride&&(t.name=t.nameOverride),t.name&&(t.trace._meta&&(t.name=i.templateString(t.name,t.trace._meta)),s=G(t.name,t.nameLength));var c=r.charAt(0),u="x"===c?"y":"x";void 0!==t.zLabel?(void 0!==t.xLabel&&(l+="x: "+t.xLabel+"
"),void 0!==t.yLabel&&(l+="y: "+t.yLabel+"
"),"choropleth"!==t.trace.type&&"choroplethmapbox"!==t.trace.type&&"choroplethmap"!==t.trace.type&&(l+=(l?"z: ":"")+t.zLabel)):e&&t[c+"Label"]===a?l=t[u+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&"scattercarpet"!==t.trace.type&&(l=t.yLabel):l=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",(t.text||0===t.text)&&!Array.isArray(t.text)&&(l+=(l?"
":"")+t.text),void 0!==t.extraText&&(l+=(l?"
":"")+t.extraText),o&&""===l&&!t.hovertemplate&&(""===s&&o.remove(),l=s);var h=t.hovertemplate||!1;if(h){var p=t.hovertemplateLabels||t;t[c+"Label"]!==a&&(p[c+"other"]=p[c+"Val"],p[c+"otherLabel"]=p[c+"Label"]),l=(l=i.hovertemplateString(h,p,n._d3locale,t.eventData[0]||{},t.trace._meta)).replace(D,(function(e,r){return s=G(r,t.nameLength),""}))}return[l,s]}function j(t,e){var r=0,n=t.offset;return e&&(n*=-S,r=t.offset*M),{x:r,y:n}}function N(t,r,n,i){var a=function(t){return t*n},o=function(t){return t*i};t.each((function(t){var n=e.select(this);if(t.del)return n.remove();var i=n.select("text.nums"),s=t.anchor,l="end"===s?-1:1,u=function(t){var e={start:1,end:-1,middle:0}[t.anchor],r=e*(E+C),n=r+e*(t.txwidth+C);return"middle"===t.anchor&&(r-=t.tx2width/2,n+=t.txwidth/2+C),{alignShift:e,textShiftX:r,text2ShiftX:n}}(t),p=j(t,r),f=p.x,d=p.y,m="middle"===s;n.select("path").attr("d",m?"M-"+a(t.bx/2+t.tx2width/2)+","+o(d-t.by/2)+"h"+a(t.bx)+"v"+o(t.by)+"h-"+a(t.bx)+"Z":"M0,0L"+a(l*E+f)+","+o(E+d)+"v"+o(t.by/2-E)+"h"+a(l*t.bx)+"v-"+o(t.by)+"H"+a(l*E+f)+"V"+o(d-E)+"Z");var g=f+u.textShiftX,y=d+t.ty0-t.by/2+C,v=t.textAlign||"auto";"auto"!==v&&("left"===v&&"start"!==s?(i.attr("text-anchor","start"),g=m?-t.bx/2-t.tx2width/2+C:-t.bx-C):"right"===v&&"end"!==s&&(i.attr("text-anchor","end"),g=m?t.bx/2-t.tx2width/2-C:t.bx+C)),i.call(c.positionText,a(g),o(y)),t.tx2width&&(n.select("text.name").call(c.positionText,a(u.text2ShiftX+u.alignShift*C+f),o(d+t.ty0-t.by/2+C)),n.select("rect").call(h.setRect,a(u.text2ShiftX+(u.alignShift-1)*t.tx2width/2+f),o(d-t.by/2-1),a(t.tx2width),o(t.by+2)))}))}function U(t,e){var n=t.index,a=t.trace||{},o=t.cd[0],s=t.cd[n]||{};function l(t){return t||r(t)&&0===t}var c=Array.isArray(n)?function(t,e){var r=i.castOption(o,n,t);return l(r)?r:i.extractOption({},a,"",e)}:function(t,e){return i.extractOption(s,a,t,e)};function u(e,r,n){var i=c(r,n);l(i)&&(t[e]=i)}if(u("hoverinfo","hi","hoverinfo"),u("bgcolor","hbg","hoverlabel.bgcolor"),u("borderColor","hbc","hoverlabel.bordercolor"),u("fontFamily","htf","hoverlabel.font.family"),u("fontSize","hts","hoverlabel.font.size"),u("fontColor","htc","hoverlabel.font.color"),u("fontWeight","htw","hoverlabel.font.weight"),u("fontStyle","hty","hoverlabel.font.style"),u("fontVariant","htv","hoverlabel.font.variant"),u("nameLength","hnl","hoverlabel.namelength"),u("textAlign","hta","hoverlabel.align"),t.posref="y"===e||"closest"===e&&"h"===a.orientation?t.xa._offset+(t.x0+t.x1)/2:t.ya._offset+(t.y0+t.y1)/2,t.x0=i.constrain(t.x0,0,t.xa._length),t.x1=i.constrain(t.x1,0,t.xa._length),t.y0=i.constrain(t.y0,0,t.ya._length),t.y1=i.constrain(t.y1,0,t.ya._length),void 0!==t.xLabelVal&&(t.xLabel="xLabel"in t?t.xLabel:d.hoverLabelText(t.xa,t.xLabelVal,a.xhoverformat),t.xVal=t.xa.c2d(t.xLabelVal)),void 0!==t.yLabelVal&&(t.yLabel="yLabel"in t?t.yLabel:d.hoverLabelText(t.ya,t.yLabelVal,a.yhoverformat),t.yVal=t.ya.c2d(t.yLabelVal)),void 0!==t.zLabelVal&&void 0===t.zLabel&&(t.zLabel=String(t.zLabelVal)),!(isNaN(t.xerr)||"log"===t.xa.type&&t.xerr<=0)){var h=d.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;void 0!==t.xerrneg?t.xLabel+=" +"+h+" / -"+d.tickText(t.xa,t.xa.c2l(t.xerrneg),"hover").text:t.xLabel+=" ± "+h,"x"===e&&(t.distance+=1)}if(!(isNaN(t.yerr)||"log"===t.ya.type&&t.yerr<=0)){var p=d.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;void 0!==t.yerrneg?t.yLabel+=" +"+p+" / -"+d.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" ± "+p,"y"===e&&(t.distance+=1)}var f=t.hoverinfo||t.trace.hoverinfo;return f&&"all"!==f&&(-1===(f=Array.isArray(f)?f:f.split("+")).indexOf("x")&&(t.xLabel=void 0),-1===f.indexOf("y")&&(t.yLabel=void 0),-1===f.indexOf("z")&&(t.zLabel=void 0),-1===f.indexOf("text")&&(t.text=void 0),-1===f.indexOf("name")&&(t.name=void 0)),t}function V(t,e,r){var i,a,o=r.container,s=r.fullLayout,l=s._size,c=r.event,u=!!e.hLinePoint,f=!!e.vLinePoint;if(o.selectAll(".spikeline").remove(),f||u){var m=p.combine(s.plot_bgcolor,s.paper_bgcolor);if(u){var g,y,v=e.hLinePoint;i=v&&v.xa,"cursor"===(a=v&&v.ya).spikesnap?(g=c.pointerX,y=c.pointerY):(g=i._offset+v.x,y=a._offset+v.y);var x,_,b=n.readability(v.color,m)<1.5?p.contrast(m):v.color,w=a.spikemode,T=a.spikethickness,A=a.spikecolor||b,k=d.getPxPosition(t,a);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(x=k,_=g),-1!==w.indexOf("across")){var M=a._counterDomainMin,S=a._counterDomainMax;"free"===a.anchor&&(M=Math.min(M,a.position),S=Math.max(S,a.position)),x=l.l+M*l.w,_=l.l+S*l.w}o.insert("line",":first-child").attr({x1:x,x2:_,y1:y,y2:y,"stroke-width":T,stroke:A,"stroke-dasharray":h.dashStyle(a.spikedash,T)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:x,x2:_,y1:y,y2:y,"stroke-width":T+2,stroke:m}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:k+("right"!==a.side?T:-T),cy:y,r:T,fill:A}).classed("spikeline",!0)}if(f){var E,C,I=e.vLinePoint;i=I&&I.xa,a=I&&I.ya,"cursor"===i.spikesnap?(E=c.pointerX,C=c.pointerY):(E=i._offset+I.x,C=a._offset+I.y);var L,P,z=n.readability(I.color,m)<1.5?p.contrast(m):I.color,D=i.spikemode,O=i.spikethickness,R=i.spikecolor||z,F=d.getPxPosition(t,i);if(-1!==D.indexOf("toaxis")||-1!==D.indexOf("across")){if(-1!==D.indexOf("toaxis")&&(L=F,P=C),-1!==D.indexOf("across")){var B=i._counterDomainMin,j=i._counterDomainMax;"free"===i.anchor&&(B=Math.min(B,i.position),j=Math.max(j,i.position)),L=l.t+(1-j)*l.h,P=l.t+(1-B)*l.h}o.insert("line",":first-child").attr({x1:E,x2:E,y1:L,y2:P,"stroke-width":O,stroke:R,"stroke-dasharray":h.dashStyle(i.spikedash,O)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:E,x2:E,y1:L,y2:P,"stroke-width":O+2,stroke:m}).classed("spikeline",!0).classed("crisp",!0)}-1!==D.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:E,cy:F-("top"!==i.side?O:-O),r:O,fill:R}).classed("spikeline",!0)}}}function q(t,e){return!e||e.vLinePoint!==t._spikepoints.vLinePoint||e.hLinePoint!==t._spikepoints.hLinePoint}function G(t,e){return c.plainText(t||"",{len:e,allowedTags:["br","sub","sup","b","i","em","s","u"]})}function W(t,e,r){var n=e[t+"a"],i=e[t+"Val"],a=e.cd[0];if("category"===n.type||"multicategory"===n.type)i=n._categoriesMap[i];else if("date"===n.type){var o=e.trace[t+"periodalignment"];if(o){var s=e.cd[e.index],l=s[t+"Start"];void 0===l&&(l=s[t]);var c=s[t+"End"];void 0===c&&(c=s[t]);var u=c-l;"end"===o?i+=u:"middle"===o&&(i+=u/2)}i=n.d2c(i)}return a&&a.t&&a.t.posLetter===n._id&&("group"===r.boxmode||"group"===r.violinmode)&&(i+=a.t.dPos),i}function Z(t){return t.offsetTop+t.clientTop}function Y(t){return t.offsetLeft+t.clientLeft}function X(t,e){var r=t._fullLayout,n=e.getBoundingClientRect(),a=n.left,o=n.top,s=a+n.width,l=o+n.height,c=i.apply3DTransform(r._invTransform)(a,o),u=i.apply3DTransform(r._invTransform)(s,l),h=c[0],p=c[1],f=u[0],d=u[1];return{x:h,y:p,width:f-h,height:d-p,top:Math.min(p,d),left:Math.min(h,f),right:Math.max(h,f),bottom:Math.max(p,d)}}}}),Sr=f({"src/components/fx/hoverlabel_defaults.js"(t,e){var r=le(),n=H(),i=$e().isUnifiedHover;e.exports=function(t,e,a,o){o=o||{};var s=e.legend;function l(t){o.font[t]||(o.font[t]=s?e.legend.font[t]:e.font[t])}e&&i(e.hovermode)&&(o.font||(o.font={}),l("size"),l("family"),l("color"),l("weight"),l("style"),l("variant"),s?(o.bgcolor||(o.bgcolor=n.combine(e.legend.bgcolor,e.paper_bgcolor)),o.bordercolor||(o.bordercolor=e.legend.bordercolor)):o.bgcolor||(o.bgcolor=e.paper_bgcolor)),a("hoverlabel.bgcolor",o.bgcolor),a("hoverlabel.bordercolor",o.bordercolor),a("hoverlabel.namelength",o.namelength),r.coerceFont(a,"hoverlabel.font",o.font),a("hoverlabel.align",o.align)}}}),Er=f({"src/components/fx/layout_global_defaults.js"(t,e){var r=le(),n=Sr(),i=j();e.exports=function(t,e){n(t,e,(function(n,a){return r.coerce(t,e,i,n,a)}))}}}),Cr=f({"src/components/fx/defaults.js"(t,e){var r=le(),n=N(),i=Sr();e.exports=function(t,e,a,o){var s=r.extendFlat({},o.hoverlabel);e.hovertemplate&&(s.namelength=-1),i(t,e,(function(i,a){return r.coerce(t,e,n,i,a)}),s)}}}),Ir=f({"src/components/fx/hovermode_defaults.js"(t,e){var r=le(),n=j();e.exports=function(t,e){function i(i,a){return void 0!==e[i]?e[i]:r.coerce(t,e,n,i,a)}return i("clickmode"),i("hoversubplots"),i("hovermode")}}}),Lr=f({"src/components/fx/layout_defaults.js"(t,e){var r=le(),n=j(),i=Ir(),a=Sr();e.exports=function(t,e){function o(i,a){return r.coerce(t,e,n,i,a)}i(t,e)&&(o("hoverdistance"),o("spikedistance")),"select"===o("dragmode")&&o("selectdirection");var s=e._has("mapbox"),l=e._has("map"),c=e._has("geo"),u=e._basePlotModules.length;"zoom"===e.dragmode&&((s||l||c)&&1===u||(s||l)&&c&&2===u)&&(e.dragmode="pan"),a(t,e,o),r.coerceFont(o,"hoverlabel.grouptitlefont",e.hoverlabel.font)}}}),Pr=f({"src/components/fx/calc.js"(t,e){var r=le(),n=qt();function i(t,e,n,i){i=i||r.identity,Array.isArray(t)&&(e[0][n]=i(t))}e.exports=function(t){var e=t.calcdata,a=t._fullLayout;function o(t){return function(e){return r.coerceHoverinfo({hoverinfo:e},{_module:t._module},a)}}for(var s=0;s"," plotly-logomark"," "," "," "," "," "," "," "," "," "," "," "," "," ",""].join("")}}}}),Br=f({"src/components/shapes/draw_newshape/constants.js"(t,e){e.exports={CIRCLE_SIDES:32,i000:0,i090:8,i180:16,i270:24,cos45:Math.cos(Math.PI/4),sin45:Math.sin(Math.PI/4),SQRT2:Math.sqrt(2)}}}),jr=f({"src/components/selections/helpers.js"(t,e){var r=le().strTranslate;function n(t,e){switch(t.type){case"log":return t.p2d(e);case"date":return t.p2r(e,0,t.calendar);default:return t.p2r(e)}}e.exports={p2r:n,r2p:function(t,e){switch(t.type){case"log":return t.d2p(e);case"date":return t.r2p(e,0,t.calendar);default:return t.r2p(e)}},axValue:function(t){var e="y"===t._id.charAt(0)?1:0;return function(r){return n(t,r[e])}},getTransform:function(t){return r(t.xaxis._offset,t.yaxis._offset)}}}}),Nr=f({"src/components/shapes/draw_newshape/helpers.js"(t){var e=Ke(),r=Br(),n=r.CIRCLE_SIDES,i=r.SQRT2,a=jr(),o=a.p2r,s=a.r2p,l=[0,3,4,5,6,1,2],c=[0,3,4,1,2];function u(t,e){return Math.abs(t-e)<=1e-6}function h(t,e){var r=e[1]-t[1],n=e[2]-t[2];return Math.sqrt(r*r+n*n)}t.writePaths=function(t){var e=t.length;if(!e)return"M0,0Z";for(var r="",n=0;n0&&uf&&(t="X"),t}));return a>f&&(d=d.replace(/[\s,]*X.*/,""),r.log("Ignoring extra params in segment "+t)),u+d}))}(o,l,u);if("pixel"===o.xsizemode){var k=l(o.xanchor);h=k+o.x0+b,p=k+o.x1+w}else h=l(o.x0)+b,p=l(o.x1)+w;if("pixel"===o.ysizemode){var M=u(o.yanchor);f=M-o.y0+T,d=M-o.y1+A}else f=u(o.y0)+T,d=u(o.y1)+A;if("line"===m)return"M"+h+","+f+"L"+p+","+d;if("rect"===m)return"M"+h+","+f+"H"+p+"V"+d+"H"+h+"Z";var S=(h+p)/2,E=(f+d)/2,C=Math.abs(S-h),I=Math.abs(E-f),L="A"+C+","+I,P=S+C+","+E;return"M"+P+L+" 0 1,1 "+S+","+(E-I)+L+" 0 0,1 "+P+"Z"}}}),Gr=f({"src/components/shapes/display_labels.js"(t,e){var r=le(),n=ir(),i=Se(),a=Qe(),o=Nr().readPaths,s=Hr(),l=s.getPathString,c=Rt(),u=Me().FROM_TL;e.exports=function(t,e,h,p){if(p.selectAll(".shape-label").remove(),h.label.text||h.label.texttemplate){var f;if(h.label.texttemplate){var d={};if("path"!==h.type){var m=n.getFromId(t,h.xref),g=n.getFromId(t,h.yref);for(var y in c){var v=c[y](h,m,g);void 0!==v&&(d[y]=v)}}f=r.texttemplateStringForShapes(h.label.texttemplate,{},t._fullLayout._d3locale,d)}else f=h.label.text;var x,_,b,w,T={"data-index":e},A=h.label.font,k=p.append("g").attr(T).classed("shape-label",!0).append("text").attr({"data-notex":1}).classed("shape-label-text",!0).text(f);if(h.path){var M=l(t,h),S=o(M,t);x=1/0,b=1/0,_=-1/0,w=-1/0;for(var E=0;E=t?e-n:n-e,-180/Math.PI*Math.atan2(i,a)}(x,b,_,w):0),k.call((function(e){return e.call(a.font,A).attr({}),i.convertToTspans(e,t),e}));var G=function(t,e,r,n,i,a,o){var s,l,c,h,p=i.label.textposition,f=i.label.textangle,d=i.label.padding,m=i.type,g=Math.PI/180*a,y=Math.sin(g),v=Math.cos(g),x=i.label.xanchor,_=i.label.yanchor;if("line"===m){"start"===p?(s=t,l=e):"end"===p?(s=r,l=n):(s=(t+r)/2,l=(e+n)/2),"auto"===x&&(x="start"===p?"auto"===f?r>t?"left":rt?"right":rt?"right":rt?"left":r1&&(2!==t.length||"Z"!==t[1][0])&&(0===I&&(t[0][0]="M"),e[C]=t,k(),M())}}()}}function V(t,r){(function(t,r){if(e.length)for(var n=0;nb?(M=v,I="y0",S=b,L="y1"):(M=b,I="y1",S=v,L="y0"),rt(r),at(c,o),function(t,e,r){var n=e.xref,i=e.yref,o=a.getFromId(r,n),s=a.getFromId(r,i),l="";"paper"!==n&&!o.autorange&&(l+=n),"paper"!==i&&!s.autorange&&(l+=i),h.setClipUrl(t,l?"clip"+r._fullLayout._uid+l:null,r)}(e,o,t),et.moveFn="move"===O?nt:it,et.altKey=r.altKey)},doneFn:function(){_(t)||(d(e),ot(c),T(e,t,o),n.call("_guiRelayout",t,u.getUpdateObj()))},clickFn:function(){_(t)||ot(c)}};function rt(r){if(_(t))O=null;else if(B)O="path"===r.target.tagName?"move":"start-point"===r.target.attributes["data-line-point"].value?"resize-over-start-point":"resize-over-end-point";else{var n=et.element.getBoundingClientRect(),i=n.right-n.left,a=n.bottom-n.top,o=r.clientX-n.left,s=r.clientY-n.top,l=!j&&i>10&&a>10&&!r.shiftKey?f.getCursor(o/i,1-s/a):"move";d(e,l),O=l.split("-")[0]}}function nt(r,n){if("path"===o.type){var i=function(t){return t},a=i,u=i;R?N("xanchor",o.xanchor=J(w+r)):(a=function(t){return J($(t)+r)},V&&"date"===V.type&&(a=g.encodeDate(a))),F?N("yanchor",o.yanchor=Q(k+n)):(u=function(t){return Q(K(t)+n)},H&&"date"===H.type&&(u=g.encodeDate(u))),N("path",o.path=A(D,a,u))}else R?N("xanchor",o.xanchor=J(w+r)):(N("x0",o.x0=J(p+r)),N("x1",o.x1=J(x+r))),F?N("yanchor",o.yanchor=Q(k+n)):(N("y0",o.y0=Q(v+n)),N("y1",o.y1=Q(b+n)));e.attr("d",y(t,o)),at(c,o),l(t,s,o,U)}function it(r,n){if(j){var i=function(t){return t},a=i,u=i;R?N("xanchor",o.xanchor=J(w+r)):(a=function(t){return J($(t)+r)},V&&"date"===V.type&&(a=g.encodeDate(a))),F?N("yanchor",o.yanchor=Q(k+n)):(u=function(t){return Q(K(t)+n)},H&&"date"===H.type&&(u=g.encodeDate(u))),N("path",o.path=A(D,a,u))}else if(B){if("resize-over-start-point"===O){var h=p+r,f=F?v-n:v+n;N("x0",o.x0=R?h:J(h)),N("y0",o.y0=F?f:Q(f))}else if("resize-over-end-point"===O){var d=x+r,m=F?b-n:b+n;N("x1",o.x1=R?d:J(d)),N("y1",o.y1=F?m:Q(m))}}else{var _=function(t){return-1!==O.indexOf(t)},T=_("n"),q=_("s"),G=_("w"),W=_("e"),Z=T?M+n:M,Y=q?S+n:S,X=G?E+r:E,tt=W?C+r:C;F&&(T&&(Z=M-n),q&&(Y=S-n)),(!F&&Y-Z>10||F&&Z-Y>10)&&(N(I,o[I]=F?Z:Q(Z)),N(L,o[L]=F?Y:Q(Y))),tt-X>10&&(N(P,o[P]=R?X:J(X)),N(z,o[z]=R?tt:J(tt)))}e.attr("d",y(t,o)),at(c,o),l(t,s,o,U)}function at(t,e){(R||F)&&function(){var r="path"!==e.type,n=t.selectAll(".visual-cue").data([0]);n.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":1}).classed("visual-cue",!0);var a=$(R?e.xanchor:i.midRange(r?[e.x0,e.x1]:g.extractPathCoords(e.path,m.paramIsX))),o=K(F?e.yanchor:i.midRange(r?[e.y0,e.y1]:g.extractPathCoords(e.path,m.paramIsY)));if(a=g.roundPositionForSharpStrokeRendering(a,1),o=g.roundPositionForSharpStrokeRendering(o,1),R&&F){var s="M"+(a-1-1)+","+(o-1-1)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",s)}else if(R){var l="M"+(a-1-1)+","+(o-9-1)+"v18 h2 v-18 Z";n.attr("d",l)}else{var c="M"+(a-9-1)+","+(o-1-1)+"h18 v2 h-18 Z";n.attr("d",c)}}()}function ot(t){t.selectAll(".visual-cue").remove()}f.init(et),tt.node().onmousemove=rt}(t,F,x,e,c,O):!0===x.editable&&F.style("pointer-events",z||u.opacity(C)*E<=.5?"stroke":"all");F.node().addEventListener("click",(function(){return function(t,e){if(b(t)){var r=+e.node().getAttribute("data-index");if(r>=0){if(r===t._fullLayout._activeShapeIndex)return void k(t);t._fullLayout._activeShapeIndex=r,t._fullLayout._deactivateShape=k,v(t)}}}(t,F)}))}x._input&&!0===x.visible&&("above"===x.layer?M(t._fullLayout._shapeUpperLayer):"paper"===x.xref||"paper"===x.yref?M(t._fullLayout._shapeLowerLayer):"between"===x.layer?M(w.shapelayerBetween):w._hadPlotinfo?M((w.mainplotinfo||w).shapelayer):M(t._fullLayout._shapeLowerLayer))}function T(t,e,r){var n=(r.xref+r.yref).replace(/paper/g,"").replace(/[xyz][1-9]* *domain/g,"");h.setClipUrl(t,n?"clip"+e._fullLayout._uid+n:null,e)}function A(t,e,r){return t.replace(m.segmentRE,(function(t){var n=0,i=t.charAt(0),a=m.paramIsX[i],o=m.paramIsY[i],s=m.numParams[i];return i+t.substr(1).replace(m.paramRE,(function(t){return n>=s||(a[n]?t=e(t):o[n]&&(t=r(t)),n++),t}))}))}function k(t){b(t)&&t._fullLayout._activeShapeIndex>=0&&(c(t),delete t._fullLayout._activeShapeIndex,v(t))}e.exports={draw:v,drawOne:w,eraseActiveShape:function(t){if(b(t)){c(t);var e=t._fullLayout._activeShapeIndex,r=(t.layout||{}).shapes||[];if(e1?(P=["toggleHover"],z=["resetViews"]):y?(L=["zoomInGeo","zoomOutGeo"],P=["hoverClosestGeo"],z=["resetGeo"]):g?(P=["hoverClosest3d"],z=["resetCameraDefault3d","resetCameraLastSave3d"]):b?(L=["zoomInMapbox","zoomOutMapbox"],P=["toggleHover"],z=["resetViewMapbox"]):w?(L=["zoomInMap","zoomOutMap"],P=["toggleHover"],z=["resetViewMap"]):v?P=["hoverClosestPie"]:k?(P=["hoverClosestCartesian","hoverCompareCartesian"],z=["resetViewSankey"]):P=["toggleHover"],m&&P.push("toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"),(function(t){for(var e=0;en?i.substr(n):a.substr(r))+o:i+a+t*e:o}function d(t,e){for(var r=e._size,n=r.h/r.w,i={},a=Object.keys(t),o=0;os*x)||T)for(i=0;iz&&FL&&(L=F);p/=(L-I)/(2*P),I=c.l2r(I),L=c.l2r(L),c.range=c._input.range=S=t[1]||i[1]<=t[0])&&a[0]e[0])return!0}return!1}function b(r){var a,o,c,f,d,m,g=r._fullLayout,y=g._size,x=y.p,b=h.list(r,"",!0);if(g._paperdiv.style({width:r._context.responsive&&g.autosize&&!r._context._hasZeroWidth&&!r.layout.width?"100%":g.width+"px",height:r._context.responsive&&g.autosize&&!r._context._hasZeroHeight&&!r.layout.height?"100%":g.height+"px"}).selectAll(".main-svg").call(l.setSize,g.width,g.height),r._context.setBackground(r,g.paper_bgcolor),t.drawMainTitle(r),u.manage(r),!g._has("cartesian"))return n.previousPromises(r);function T(t,e,r){var n=t._lw/2;return"x"===t._id.charAt(0)?e?"top"===r?e._offset-x-n:e._offset+e._length+x+n:y.t+y.h*(1-(t.position||0))+n%1:e?"right"===r?e._offset+e._length+x+n:e._offset-x-n:y.l+y.w*(t.position||0)+n%1}for(a=0;a.5?"t":"b",o=t._fullLayout.margin[a],s=0;return"paper"===e.yref?s=r+e.pad.t+e.pad.b:"container"===e.yref&&(s=function(t,e,r,n,i){var a=0;return"middle"===r&&(a+=i/2),"t"===t?("top"===r&&(a+=i),a+=n-e*n):("bottom"===r&&(a+=i),a+=e*n),a}(a,n,i,t._fullLayout.height,r)+e.pad.t+e.pad.b),s>o?s:0}(t,r,m);if(g>0){(function(t,e,r,a){var o="title.automargin",s=t._fullLayout.title,l=s.y>.5?"t":"b",c={x:s.x,y:s.y,t:0,b:0},u={};"paper"===s.yref&&function(t,e,r,n,a){var o="paper"===e.yref?t._fullLayout._size.h:t._fullLayout.height,s=i.isTopAnchor(e)?n:n-a,l="b"===r?o-s:s;return!(i.isTopAnchor(e)&&"t"===r||i.isBottomAnchor(e)&&"b"===r)&&l=0;A--){var k=i.append("path").attr(g).style("opacity",A?.1:y).call(a.stroke,x).call(a.fill,v).call(o.dashLine,A?"solid":b,A?4+_:_);if(f(k,t,p),w){var M=s(t.layout,"selections",p);k.style({cursor:"move"});var S={element:k.node(),plotinfo:m,gd:t,editHelpers:M,isActiveSelection:!0},E=r(l,t);n(E,k,S)}else k.style("pointer-events",A?"all":"none");T[A]=k}var C=T[0];T[1].node().addEventListener("click",(function(){return function(t,e){if(h(t)){var r=+e.node().getAttribute("data-index");if(r>=0){if(r===t._fullLayout._activeSelectionIndex)return void d(t);t._fullLayout._activeSelectionIndex=r,t._fullLayout._deactivateSelection=d,u(t)}}}(t,C)}))}(t._fullLayout._selectionLayer)}function f(t,e,r){var n=r.xref+r.yref;o.setClipUrl(t,"clip"+e._fullLayout._uid+n,e)}function d(t){h(t)&&t._fullLayout._activeSelectionIndex>=0&&(i(t),delete t._fullLayout._activeSelectionIndex,u(t))}e.exports={draw:u,drawOne:p,activateLastSelection:function(t){if(h(t)){var e=t._fullLayout.selections.length-1;t._fullLayout._activeSelectionIndex=e,t._fullLayout._deactivateSelection=d,u(t)}}}}}),on=f({"node_modules/polybooljs/lib/build-log.js"(t,e){e.exports=function(){var t,e=0,r=!1;function n(e,r){return t.list.push({type:e,data:r?JSON.parse(JSON.stringify(r)):void 0}),t}return t={list:[],segmentId:function(){return e++},checkIntersection:function(t,e){return n("check",{seg1:t,seg2:e})},segmentChop:function(t,e){return n("div_seg",{seg:t,pt:e}),n("chop",{seg:t,pt:e})},statusRemove:function(t){return n("pop_seg",{seg:t})},segmentUpdate:function(t){return n("seg_update",{seg:t})},segmentNew:function(t,e){return n("new_seg",{seg:t,primary:e})},segmentRemove:function(t){return n("rem_seg",{seg:t})},tempStatus:function(t,e,r){return n("temp_status",{seg:t,above:e,below:r})},rewind:function(t){return n("rewind",{seg:t})},status:function(t,e,r){return n("status",{seg:t,above:e,below:r})},vert:function(e){return e===r?t:(r=e,n("vert",{x:e}))},log:function(t){return"string"!=typeof t&&(t=JSON.stringify(t,!1," ")),n("log",{txt:t})},reset:function(){return n("reset")},selected:function(t){return n("selected",{segs:t})},chainStart:function(t){return n("chain_start",{seg:t})},chainRemoveHead:function(t,e){return n("chain_rem_head",{index:t,pt:e})},chainRemoveTail:function(t,e){return n("chain_rem_tail",{index:t,pt:e})},chainNew:function(t,e){return n("chain_new",{pt1:t,pt2:e})},chainMatch:function(t){return n("chain_match",{index:t})},chainClose:function(t){return n("chain_close",{index:t})},chainAddHead:function(t,e){return n("chain_add_head",{index:t,pt:e})},chainAddTail:function(t,e){return n("chain_add_tail",{index:t,pt:e})},chainConnect:function(t,e){return n("chain_con",{index1:t,index2:e})},chainReverse:function(t){return n("chain_rev",{index:t})},chainJoin:function(t,e){return n("chain_join",{index1:t,index2:e})},done:function(){return n("done")}}}}}),sn=f({"node_modules/polybooljs/lib/epsilon.js"(t,e){e.exports=function(t){"number"!=typeof t&&(t=1e-10);var e={epsilon:function(e){return"number"==typeof e&&(t=e),t},pointAboveOrOnLine:function(e,r,n){var i=r[0],a=r[1],o=n[0],s=n[1],l=e[0];return(o-i)*(e[1]-a)-(s-a)*(l-i)>=-t},pointBetween:function(e,r,n){var i=e[1]-r[1],a=n[0]-r[0],o=e[0]-r[0],s=n[1]-r[1],l=o*a+i*s;return!(l-t)},pointsSameX:function(e,r){return Math.abs(e[0]-r[0])t!=o-i>t&&(a-c)*(i-u)/(o-u)+c-n>t&&(s=!s),a=c,o=u}return s}};return e}}}),ln=f({"node_modules/polybooljs/lib/linked-list.js"(t,e){e.exports={create:function(){var t={root:{root:!0,next:null},exists:function(e){return!(null===e||e===t.root)},isEmpty:function(){return null===t.root.next},getHead:function(){return t.root.next},insertBefore:function(e,r){for(var n=t.root,i=t.root.next;null!==i;){if(r(i))return e.prev=i.prev,e.next=i,i.prev.next=e,void(i.prev=e);n=i,i=i.next}n.next=e,e.prev=n,e.next=null},findTransition:function(e){for(var r=t.root,n=t.root.next;null!==n&&!e(n);)r=n,n=n.next;return{before:r===t.root?null:r,after:n,insert:function(t){return t.prev=r,t.next=n,r.next=t,null!==n&&(n.prev=t),t}}}};return t},node:function(t){return t.prev=null,t.next=null,t.remove=function(){t.prev.next=t.next,t.next&&(t.next.prev=t.prev),t.prev=null,t.next=null},t}}}}),cn=f({"node_modules/polybooljs/lib/intersecter.js"(t,e){var r=ln();e.exports=function(t,e,n){function i(t,e){return{id:n?n.segmentId():-1,start:t,end:e,myFill:{above:null,below:null},otherFill:null}}function a(t,e,r){return{id:n?n.segmentId():-1,start:t,end:e,myFill:{above:r.myFill.above,below:r.myFill.below},otherFill:null}}var o=r.create();function s(t,r){o.insertBefore(t,(function(n){var i=function(t,r,n,i,a,o){var s=e.pointsCompare(r,a);return 0!==s?s:e.pointsSame(n,o)?0:t!==i?t?1:-1:e.pointAboveOrOnLine(n,i?a:o,i?o:a)?1:-1}(t.isStart,t.pt,r,n.isStart,n.pt,n.other.pt);return i<0}))}function l(t,e){var n=function(t,e){var n=r.node({isStart:!0,pt:t.start,seg:t,primary:e,other:null,status:null});return s(n,t.end),n}(t,e);return function(t,e,n){var i=r.node({isStart:!1,pt:e.end,seg:e,primary:n,other:t,status:null});t.other=i,s(i,t.pt)}(n,t,e),n}function c(t,e){var r=a(e,t.seg.end,t.seg);return function(t,e){n&&n.segmentChop(t.seg,e),t.other.remove(),t.seg.end=e,t.other.pt=e,s(t.other,t.pt)}(t,e),l(r,t.primary)}function u(i,a){var s=r.create();function l(t){return s.findTransition((function(r){var n=function(t,r){var n=t.seg.start,i=t.seg.end,a=r.seg.start,o=r.seg.end;return e.pointsCollinear(n,a,o)?e.pointsCollinear(i,a,o)||e.pointAboveOrOnLine(i,a,o)?1:-1:e.pointAboveOrOnLine(n,a,o)?1:-1}(t,r.ev);return n>0}))}function u(t,r){var i=t.seg,a=r.seg,o=i.start,s=i.end,l=a.start,u=a.end;n&&n.checkIntersection(i,a);var h=e.linesIntersect(o,s,l,u);if(!1===h){if(!e.pointsCollinear(o,s,l)||e.pointsSame(o,u)||e.pointsSame(s,l))return!1;var p=e.pointsSame(o,l),f=e.pointsSame(s,u);if(p&&f)return r;var d=!p&&e.pointBetween(o,l,u),m=!f&&e.pointBetween(s,l,u);if(p)return m?c(r,s):c(t,u),r;d&&(f||(m?c(r,s):c(t,u)),c(r,o))}else 0===h.alongA&&(-1===h.alongB?c(t,l):0===h.alongB?c(t,h.pt):1===h.alongB&&c(t,u)),0===h.alongB&&(-1===h.alongA?c(r,o):0===h.alongA?c(r,h.pt):1===h.alongA&&c(r,s));return!1}for(var h=[];!o.isEmpty();){var p=o.getHead();if(n&&n.vert(p.pt[0]),p.isStart){let e=function(){if(d){var t=u(p,d);if(t)return t}return!!m&&u(p,m)};n&&n.segmentNew(p.seg,p.primary);var f=l(p),d=f.before?f.before.ev:null,m=f.after?f.after.ev:null;n&&n.tempStatus(p.seg,!!d&&d.seg,!!m&&m.seg);var g,y=e();if(y&&(t?(g=null===p.seg.myFill.below||p.seg.myFill.above!==p.seg.myFill.below)&&(y.seg.myFill.above=!y.seg.myFill.above):y.seg.otherFill=p.seg.myFill,n&&n.segmentUpdate(y.seg),p.other.remove(),p.remove()),o.getHead()!==p){n&&n.rewind(p.seg);continue}if(t)g=null===p.seg.myFill.below||p.seg.myFill.above!==p.seg.myFill.below,p.seg.myFill.below=m?m.seg.myFill.above:i,p.seg.myFill.above=g?!p.seg.myFill.below:p.seg.myFill.below;else if(null===p.seg.otherFill){var v;v=m?p.primary===m.primary?m.seg.otherFill.above:m.seg.myFill.above:p.primary?a:i,p.seg.otherFill={above:v,below:v}}n&&n.status(p.seg,!!d&&d.seg,!!m&&m.seg),p.other.status=f.insert(r.node({ev:p}))}else{var x=p.status;if(null===x)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(s.exists(x.prev)&&s.exists(x.next)&&u(x.prev.ev,x.next.ev),n&&n.statusRemove(x.ev.seg),x.remove(),!p.primary){var _=p.seg.myFill;p.seg.myFill=p.seg.otherFill,p.seg.otherFill=_}h.push(p.seg)}o.getHead().remove()}return n&&n.done(),h}return t?{addRegion:function(t){for(var r,n=t[t.length-1],a=0;aa!=f>a&&i<(p-u)*(a-h)/(f-h)+u&&(o=!o)}return o}}}),mn=f({"src/lib/polygon.js"(t,e){var r=Ct().dot,n=k().BADNUM,i=e.exports={};i.tester=function(t){var e,r=t.slice(),i=r[0][0],a=i,o=r[0][1],s=o;for((r[r.length-1][0]!==r[0][0]||r[r.length-1][1]!==r[0][1])&&r.push(r[0]),e=1;ea||c===n||cs||e&&l(t))}:function(t,e){var l=t[0],c=t[1];if(l===n||la||c===n||cs)return!1;var u,h,p,f,d,m=r.length,g=r[0][0],y=r[0][1],v=0;for(u=1;uMath.max(h,g)||c>Math.max(p,y)))if(cu||Math.abs(r(o,p))>i)return!0;return!1},i.filter=function(t,e){var r=[t[0]],n=0,a=0;function o(o){t.push(o);var s=r.length,l=n;r.splice(a+1);for(var c=l+1;c1&&o(t.pop()),{addPt:o,raw:t,filtered:r}}}}),gn=f({"src/components/selections/constants.js"(t,e){e.exports={BENDPX:1.5,MINSELECT:12,SELECTDELAY:100,SELECTID:"-select"}}}),yn=f({"src/components/selections/select.js"(t,e){var r=fn(),n=dn(),i=qt(),a=Qe().dashStyle,o=H(),s=Dr(),l=$e().makeEventData,c=Or(),u=c.freeMode,h=c.rectMode,p=c.drawMode,f=c.openMode,d=c.selectMode,m=Hr(),g=qr(),y=Wr(),v=_e().clearOutline,x=Nr(),_=x.handleEllipse,b=x.readPaths,w=Ur().newShapes,T=Vr(),A=an().activateLastSelection,k=le(),M=k.sorterAsc,S=mn(),E=Jt(),C=xe().getFromId,I=Rr(),L=nn().redrawReglTraces,P=gn(),z=P.MINSELECT,D=S.filter,O=S.tester,R=jr(),F=R.p2r,B=R.axValue,j=R.getTransform;function N(t){return void 0!==t.subplot}function U(t,e,r,n,i,a,o){var s,l,c,u,h,p,d,m,g,v=e._hoverdata,x=e._fullLayout.clickmode.indexOf("event")>-1,_=[];if(function(t){return t&&Array.isArray(t)&&!0!==t[0].hoverOnBox}(v)){W(t,e,a);var b=function(t,e){var r,n,i=t[0],a=-1,o=[];for(n=0;n0?function(t,e){var r,n,i,a=[];for(i=0;i0&&a.push(r);if(1===a.length&&a[0]===e.searchInfo&&(n=e.searchInfo.cd[0].trace).selectedpoints.length===e.pointNumbers.length){for(i=0;i1||(n+=e.selectedpoints.length)>1))return!1;return 1===n}(s)&&(p=K(b))){for(o&&o.remove(),g=0;g=0})(a)&&a._fullLayout._deactivateShape(a),function(t){return t._fullLayout._activeSelectionIndex>=0}(a)&&a._fullLayout._deactivateSelection(a);var o=a._fullLayout._zoomlayer,s=p(r),l=d(r);if(s||l){var c,u,h=o.selectAll(".select-outline-"+n.id);h&&a._fullLayout._outlining&&(s&&(c=w(h,t)),c&&i.call("_guiRelayout",a,{shapes:c}),l&&!N(t)&&(u=T(h,t)),u&&(a._fullLayout._noEmitSelectedAtStart=!0,i.call("_guiRelayout",a,{selections:u}).then((function(){e&&A(a)}))),a._fullLayout._outlining=!1)}n.selection={},n.selection.selectionDefs=t.selectionDefs=[],n.selection.mergedPolygons=t.mergedPolygons=[]}function Y(t){return t._id}function X(t,e,r,n){if(!t.calcdata)return[];var i,a,o,s=[],l=e.map(Y),c=r.map(Y);for(o=0;o0?n[0]:r;return!!e.selectedpoints&&e.selectedpoints.indexOf(i)>-1}function J(t,e,r){var n,a;for(n=0;n-1&&e;if(!a&&e){var et=ot(t,!0);if(et.length){var nt=et[0].xref,ft=et[0].yref;if(nt&&ft){var dt=ct(et);ut([C(t,nt,"x"),C(t,ft,"y")])(Q,dt)}}t._fullLayout._noEmitSelectedAtStart?t._fullLayout._noEmitSelectedAtStart=!1:tt&&ht(t,Q),f._reselect=!1}if(!a&&f._deselect){var mt=f._deselect;(function(t,e,r){for(var n=0;n=0)A._fullLayout._deactivateShape(A);else if(!x){var r=M.clickmode;E.done(Mt).then((function(){if(E.clear(Mt),2===t){for(_t.remove(),K=0;K-1&&U(e,A,n.xaxes,n.yaxes,n.subplot,n,_t),"event"===r&&ht(A,void 0);s.click(A,e,L.id)})).catch(k.error)}},n.doneFn=function(){At.remove(),E.done(Mt).then((function(){E.clear(Mt),!S&&$&&n.selectionDefs&&($.subtract=xt,n.selectionDefs.push($),n.mergedPolygons.length=0,[].push.apply(n.mergedPolygons,Y)),(S||x)&&Z(n,S),n.doneFnCompleted&&n.doneFnCompleted(St),b&&ht(A,at)})).catch(k.error)}},clearOutline:v,clearSelectionsCache:Z,selectOnClick:U}}}),vn=f({"src/components/annotations/arrow_paths.js"(t,e){e.exports=[{path:"",backoff:0},{path:"M-2.4,-3V3L0.6,0Z",backoff:.6},{path:"M-3.7,-2.5V2.5L1.3,0Z",backoff:1.3},{path:"M-4.45,-3L-1.65,-0.2V0.2L-4.45,3L1.55,0Z",backoff:1.55},{path:"M-2.2,-2.2L-0.2,-0.2V0.2L-2.2,2.2L-1.4,3L1.6,0L-1.4,-3Z",backoff:1.6},{path:"M-4.4,-2.1L-0.6,-0.2V0.2L-4.4,2.1L-4,3L2,0L-4,-3Z",backoff:2},{path:"M2,0A2,2 0 1,1 0,-2A2,2 0 0,1 2,0Z",backoff:0,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]}}),xn=f({"src/constants/axis_placeable_objects.js"(t,e){e.exports={axisRefDescription:function(t,e,r){return["If set to a",t,"axis id (e.g. *"+t+"* or","*"+t+"2*), the `"+t+"` position refers to a",t,"coordinate. If set to *paper*, the `"+t+"`","position refers to the distance from the",e,"of the plotting","area in normalized coordinates where *0* (*1*) corresponds to the",e,"("+r+"). If set to a",t,"axis ID followed by","*domain* (separated by a space), the position behaves like for","*paper*, but refers to the distance in fractions of the domain","length from the",e,"of the domain of that axis: e.g.,","*"+t+"2 domain* refers to the domain of the second",t," axis and a",t,"position of 0.5 refers to the","point between the",e,"and the",r,"of the domain of the","second",t,"axis."].join(" ")}}}}),_n=f({"src/components/annotations/attributes.js"(t,e){var r=vn(),n=F(),i=ve(),a=ye().templatedArray;xn(),e.exports=a("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},text:{valType:"string",editType:"calc+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw"},font:n({editType:"calc+arraydraw",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},height:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},showarrow:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:r.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:r.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},arrowwidth:{valType:"number",min:.1,editType:"calc+arraydraw"},standoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},ax:{valType:"any",editType:"calc+arraydraw"},ay:{valType:"any",editType:"calc+arraydraw"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",i.idRegex.x.toString()],editType:"calc"},x:{valType:"any",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},xshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},yref:{valType:"enumerated",values:["paper",i.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calc+arraydraw"},yshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:n({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc"})}}),bn=f({"src/traces/scatter/constants.js"(t,e){e.exports={PTS_LINESONLY:20,minTolerance:.2,toleranceGrowth:10,maxScreensAway:20,eventDataKeys:[]}}}),wn=f({"src/traces/scatter/fillcolor_attribute.js"(t,e){e.exports=function(t){return{valType:"color",editType:"style",anim:!0}}}}),Tn=f({"src/traces/scatter/attributes.js"(t,e){var r=Ce().axisHoverFormat,n=Ot().texttemplateAttrs,i=Ot().hovertemplateAttrs,a=Pe(),o=F(),s=zt().dash,l=zt().pattern,c=Qe(),u=bn(),h=R().extendFlat,p=wn();e.exports={x:{valType:"data_array",editType:"calc+clearAxisTypes",anim:!0},x0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes",anim:!0},dx:{valType:"number",dflt:1,editType:"calc",anim:!0},y:{valType:"data_array",editType:"calc+clearAxisTypes",anim:!0},y0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes",anim:!0},dy:{valType:"number",dflt:1,editType:"calc",anim:!0},xperiod:{valType:"any",dflt:0,editType:"calc"},yperiod:{valType:"any",dflt:0,editType:"calc"},xperiod0:{valType:"any",editType:"calc"},yperiod0:{valType:"any",editType:"calc"},xperiodalignment:{valType:"enumerated",values:["start","middle","end"],dflt:"middle",editType:"calc"},yperiodalignment:{valType:"enumerated",values:["start","middle","end"],dflt:"middle",editType:"calc"},xhoverformat:r("x"),yhoverformat:r("y"),offsetgroup:{valType:"string",dflt:"",editType:"calc"},alignmentgroup:{valType:"string",dflt:"",editType:"calc"},stackgroup:{valType:"string",dflt:"",editType:"calc"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc"},groupnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc"},stackgaps:{valType:"enumerated",values:["infer zero","interpolate"],dflt:"infer zero",editType:"calc"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},texttemplate:n({},{}),hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},mode:{valType:"flaglist",flags:["lines","markers","text"],extras:["none"],editType:"calc"},hoveron:{valType:"flaglist",flags:["points","fills"],editType:"style"},hovertemplate:i({},{keys:u.eventDataKeys}),line:{color:{valType:"color",editType:"style",anim:!0},width:{valType:"number",min:0,dflt:2,editType:"style",anim:!0},shape:{valType:"enumerated",values:["linear","spline","hv","vh","hvh","vhv"],dflt:"linear",editType:"plot"},smoothing:{valType:"number",min:0,max:1.3,dflt:1,editType:"plot"},dash:h({},s,{editType:"style"}),backoff:{valType:"number",min:0,dflt:"auto",arrayOk:!0,editType:"plot"},simplify:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},connectgaps:{valType:"boolean",dflt:!1,editType:"calc"},cliponaxis:{valType:"boolean",dflt:!0,editType:"plot"},fill:{valType:"enumerated",values:["none","tozeroy","tozerox","tonexty","tonextx","toself","tonext"],editType:"calc"},fillcolor:p(!0),fillgradient:h({type:{valType:"enumerated",values:["radial","horizontal","vertical","none"],dflt:"none",editType:"calc"},start:{valType:"number",editType:"calc"},stop:{valType:"number",editType:"calc"},colorscale:{valType:"colorscale",editType:"style"},editType:"calc"}),fillpattern:l,marker:h({symbol:{valType:"enumerated",values:c.symbolList,dflt:"circle",arrayOk:!0,editType:"style"},opacity:{valType:"number",min:0,max:1,arrayOk:!0,editType:"style",anim:!0},angle:{valType:"angle",dflt:0,arrayOk:!0,editType:"plot",anim:!1},angleref:{valType:"enumerated",values:["previous","up"],dflt:"up",editType:"plot",anim:!1},standoff:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"plot",anim:!0},size:{valType:"number",min:0,dflt:6,arrayOk:!0,editType:"calc",anim:!0},maxdisplayed:{valType:"number",min:0,dflt:0,editType:"plot"},sizeref:{valType:"number",dflt:1,editType:"calc"},sizemin:{valType:"number",min:0,dflt:0,editType:"calc"},sizemode:{valType:"enumerated",values:["diameter","area"],dflt:"diameter",editType:"calc"},line:h({width:{valType:"number",min:0,arrayOk:!0,editType:"style",anim:!0},editType:"calc"},a("marker.line",{anim:!0})),gradient:{type:{valType:"enumerated",values:["radial","horizontal","vertical","none"],arrayOk:!0,dflt:"none",editType:"calc"},color:{valType:"color",arrayOk:!0,editType:"calc"},editType:"calc"},editType:"calc"},a("marker",{anim:!0})),selected:{marker:{opacity:{valType:"number",min:0,max:1,editType:"style"},color:{valType:"color",editType:"style"},size:{valType:"number",min:0,editType:"style"},editType:"style"},textfont:{color:{valType:"color",editType:"style"},editType:"style"},editType:"style"},unselected:{marker:{opacity:{valType:"number",min:0,max:1,editType:"style"},color:{valType:"color",editType:"style"},size:{valType:"number",min:0,editType:"style"},editType:"style"},textfont:{color:{valType:"color",editType:"style"},editType:"style"},editType:"style"},textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"middle center",arrayOk:!0,editType:"calc"},textfont:o({editType:"calc",colorEditType:"style",arrayOk:!0}),zorder:{valType:"integer",dflt:0,editType:"plot"}}}}),An=f({"src/components/selections/attributes.js"(t,e){var r=_n(),n=Tn().line,i=zt().dash,a=R().extendFlat,o=Pt().overrideAll,s=ye().templatedArray;xn(),e.exports=o(s("selection",{type:{valType:"enumerated",values:["rect","path"]},xref:a({},r.xref,{}),yref:a({},r.yref,{}),x0:{valType:"any"},x1:{valType:"any"},y0:{valType:"any"},y1:{valType:"any"},path:{valType:"string",editType:"arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:.7,editType:"arraydraw"},line:{color:n.color,width:a({},n.width,{min:1,dflt:1}),dash:a({},i,{dflt:"dot"})}}),"arraydraw","from-root")}}),kn=f({"src/components/selections/defaults.js"(t,e){var r=le(),n=ir(),i=je(),a=An(),o=Hr();function s(t,e,i){function s(n,i){return r.coerce(t,e,a,n,i)}var l=s("path"),c="path"!==s("type",l?"path":"rect");c&&delete e.path,s("opacity"),s("line.color"),s("line.width"),s("line.dash");for(var u=["x","y"],h=0;h<2;h++){var p,f,d,m=u[h],g={_fullLayout:i},y=n.coerceRef(t,e,g,m);if((p=n.getFromId(g,y))._selectionIndices.push(e._index),d=o.rangeToShapePosition(p),f=o.shapePositionToRange(p),c){var v=m+"0",x=m+"1",_=t[v],b=t[x];t[v]=f(t[v],!0),t[x]=f(t[x],!0),n.coercePosition(e,g,s,y,v),n.coercePosition(e,g,s,y,x);var w=e[v],T=e[x];void 0!==w&&void 0!==T&&(e[v]=d(w),e[x]=d(T),t[v]=_,t[x]=b)}}c&&r.noneOrAll(t,e,["x0","x1","y0","y1"])}e.exports=function(t,e){i(t,e,{name:"selections",handleItemDefaults:s});for(var r=e.selections,n=0;n=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function N(t,e,r,n,i){return t.append("path").attr("class","zoombox").style({fill:e>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",l(r,n)).attr("d",i+"Z")}function U(t,e,r){return t.append("path").attr("class","zoombox-corners").style({fill:u.background,stroke:u.defaultLine,"stroke-width":1,opacity:0}).attr("transform",l(e,r)).attr("d","M0,0Z")}function V(t,e,r,n,i,a){t.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),q(t,e,i,a)}function q(t,e,r,n){r||(t.transition().style("fill",n>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),e.transition().style("opacity",1).duration(200))}function G(t){r.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function W(t){P&&t.data&&t._context.showTips&&(n.notifier(n._(t,"Double-click to zoom back out"),"long"),P=!1)}function Z(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,L)/2);return"M"+(t.l-3.5)+","+(t.t-.5+e)+"h3v"+-e+"h"+e+"v-3h-"+(e+3)+"ZM"+(t.r+3.5)+","+(t.t-.5+e)+"h-3v"+-e+"h"+-e+"v-3h"+(e+3)+"ZM"+(t.r+3.5)+","+(t.b+.5-e)+"h-3v"+e+"h"+-e+"v3h"+(e+3)+"ZM"+(t.l-3.5)+","+(t.b+.5-e)+"h3v"+e+"h"+e+"v3h-"+(e+3)+"Z"}function Y(t,e,r,i,a){for(var o,s,l,c,u=!1,h={},p={},f=(a||{}).xaHash,d=(a||{}).yaHash,m=0;m=0)o._fullLayout._deactivateShape(o);else{var l=o._fullLayout.clickmode;if(G(o),2===n&&!yt&&function(){if(!t._transitioningWithDuration){var e=t._context.doubleClick,r=[];it&&(r=r.concat(H)),at&&(r=r.concat(K)),nt.xaxes&&(r=r.concat(nt.xaxes)),nt.yaxes&&(r=r.concat(nt.yaxes));var n,i,a={};if("reset+autosize"===e)for(e="autosize",i=0;i-1&&S(a,o,H,K,e.id,Lt),l.indexOf("event")>-1&&p.click(o,a,e.id);else if(1===n&&yt){var u=g?z:P,h="s"===g||"w"===x?0:1,f=u._name+".range["+h+"]",d=function(t,e){var r,n=t.range[e],a=Math.abs(n-t.range[1-e]);return"date"===t.type?n:"log"===t.type?(r=Math.ceil(Math.max(0,-Math.log(a)/Math.LN10))+3,i("."+r+"g")(Math.pow(10,n))):(r=Math.floor(Math.log(Math.abs(n))/Math.LN10)-Math.floor(Math.log(a)/Math.LN10)+4,i("."+String(r)+"g")(n))}(u,h),m="left",y="middle";if(u.fixedrange)return;g?(y="n"===g?"top":"bottom","right"===u.side&&(m="right")):"e"===x&&(m="right"),o._context.showAxisRangeEntryBoxes&&r.select(_t).call(c.makeEditable,{gd:o,immediate:!0,background:o._fullLayout.paper_bgcolor,text:String(d),fill:u.tickfont?u.tickfont.color:"#444",horizontalAlign:m,verticalAlign:y}).on("edit",(function(t){var e=u.d2r(t);void 0!==e&&s.call("_guiRelayout",o,f,e)}))}}}function Dt(e,r){if(t._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(tt,ft*e+bt)),i=Math.max(0,Math.min(et,dt*r+wt)),a=Math.abs(n-bt),o=Math.abs(i-wt);function s(){St="",Tt.r=Tt.l,Tt.t=Tt.b,Ct.attr("d","M0,0Z")}if(Tt.l=Math.min(bt,n),Tt.r=Math.max(bt,n),Tt.t=Math.min(wt,i),Tt.b=Math.max(wt,i),rt.isSubplotConstrained)a>L||o>L?(St="xy",a/tt>o/et?(o=a*et/tt,wt>i?Tt.t=wt-o:Tt.b=wt+o):(a=o*tt/et,bt>n?Tt.l=bt-a:Tt.r=bt+a),Ct.attr("d",Z(Tt))):s();else if(nt.isSubplotConstrained)if(a>L||o>L){St="xy";var l=Math.min(Tt.l/tt,(et-Tt.b)/et),c=Math.max(Tt.r/tt,(et-Tt.t)/et);Tt.l=l*tt,Tt.r=c*tt,Tt.b=(1-l)*et,Tt.t=(1-c)*et,Ct.attr("d",Z(Tt))}else s();else!at||o0){var u;if(nt.isSubplotConstrained||!it&&1===at.length){for(u=0;u1&&(void 0!==a.maxallowed&&st===(a.range[0]1&&(void 0!==o.maxallowed&<===(o.range[0]1&&n.warn("Full array edits are incompatible with other edits",h);var v=l[""][""];if(s(v))e.set(null);else{if(!Array.isArray(v))return n.warn("Unrecognized full array edit value",h,v),!0;e.set(v)}return!m&&(p(g,y),f(t),!0)}var x,_,b,w,T,A,k,M,S=Object.keys(l).map(Number).sort(i),E=e.get(),C=E||[],I=u(y,h).get(),L=[],P=-1,z=C.length;for(x=0;xC.length-(k?0:1))n.warn("index out of range",h,b);else if(void 0!==A)T.length>1&&n.warn("Insertion & removal are incompatible with edits to the same index.",h,b),s(A)?L.push(b):k?("add"===A&&(A={}),C.splice(b,0,A),I&&I.splice(b,0,{})):n.warn("Unrecognized full object edit value",h,b,A),-1===P&&(P=b);else for(_=0;_=0;x--)C.splice(L[x],1),I&&I.splice(L[x],1);if(C.length?E||e.set(C):e.set(null),m)return!1;if(p(g,y),d!==r){var D;if(-1===P)D=S;else{for(z=Math.max(C.length,z),D=[],x=0;x=P);x++)D.push(b);for(x=P;x0&&n.log("Clearing previous rejected promises from queue."),t._promises=[]},t.cleanLayout=function(e){var r;e||(e={}),e.xaxis1&&(e.xaxis||(e.xaxis=e.xaxis1),delete e.xaxis1),e.yaxis1&&(e.yaxis||(e.yaxis=e.yaxis1),delete e.yaxis1),e.scene1&&(e.scene||(e.scene=e.scene1),delete e.scene1);var a=(i.subplotsRegistry.cartesian||{}).attrRegex,l=((i.subplotsRegistry.polar||{}).attrRegex,(i.subplotsRegistry.ternary||{}).attrRegex,(i.subplotsRegistry.gl3d||{}).attrRegex,Object.keys(e));for(r=0;r3?(x.x=1.02,x.xanchor="left"):x.x<-2&&(x.x=-.02,x.xanchor="right"),x.y>3?(x.y=1.02,x.yanchor="bottom"):x.y<-2&&(x.y=-.02,x.yanchor="top")),"rotate"===e.dragmode&&(e.dragmode="orbit"),o.clean(e),e.template&&e.template.layout&&t.cleanLayout(e.template.layout),e},t.cleanData=function(e){for(var a=0;a0)return t.substr(0,e)}t.hasParent=function(t,e){for(var r=g(e);r;){if(r in t)return!0;r=g(r)}return!1};var y=["x","y","z"];t.clearAxisTypes=function(t,e,r){for(var i=0;i=t.data.length||i<-t.data.length)throw new Error(r+" must be valid indices for gd.data.");if(e.indexOf(i,n+1)>-1||i>=0&&e.indexOf(-t.data.length+i)>-1||i<0&&e.indexOf(t.data.length+i)>-1)throw new Error("each index in "+r+" must be unique.")}}function D(t,e,r){if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(typeof e>"u")throw new Error("currentIndices is a required argument.");if(Array.isArray(e)||(e=[e]),z(t,e,"currentIndices"),typeof r<"u"&&!Array.isArray(r)&&(r=[r]),typeof r<"u"&&z(t,r,"newIndices"),typeof r<"u"&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function O(t,e,n,o,s){!function(t,e,r,n){var a=i.isPlainObject(n);if(!Array.isArray(t.data))throw new Error("gd.data must be an array");if(!i.isPlainObject(e))throw new Error("update must be a key:value object");if(typeof r>"u")throw new Error("indices must be an integer or array of integers");for(var o in z(t,r,"indices"),e){if(!Array.isArray(e[o])||e[o].length!==r.length)throw new Error("attribute "+o+" must be an array of length equal to indices array length");if(a&&(!(o in n)||!Array.isArray(n[o])||n[o].length!==e[o].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object")}}(t,e,n,o);for(var l=function(t,e,n,o){var s,l,c,u,h,p=i.isPlainObject(o),f=[];for(var d in Array.isArray(n)||(n=[n]),n=P(n,t.data.length-1),e)for(var m=0;m0&&"string"!=typeof z.parts[O];)O--;var R=z.parts[O],F=z.parts[O-1]+"."+R,N=z.parts.slice(0,O).join("."),U=a(t.layout,N).get(),V=a(u,N).get(),q=z.get();if(void 0!==D){A[P]=D,S[P]="reverse"===R?D:B(q);var H=c.getLayoutValObject(u,z.parts);if(H&&H.impliedEdits&&null!==D)for(var G in H.impliedEdits)E(i.relativeAttr(P,G),H.impliedEdits[G]);if(-1!==["width","height"].indexOf(P))if(D){E("autosize",null);var Y="height"===P?"width":"height";E(Y,u[Y])}else u[P]=t._initialAutoSize[P];else if("autosize"===P)E("width",D?null:u.width),E("height",D?null:u.height);else if(F.match(W))L(F),a(u,N+"._inputRange").set(null);else if(F.match(Z)){L(F),a(u,N+"._inputRange").set(null);var $=a(u,N).get();$._inputDomain&&($._input.domain=$._inputDomain.slice())}else F.match(X)&&a(u,N+"._inputDomain").set(null);if("type"===R){C=U;var J="linear"===V.type&&"log"===D,Q="log"===V.type&&"linear"===D;if(J||Q){if(C&&C.range)if(V.autorange)J&&(C.range=C.range[1]>C.range[0]?[1,2]:[2,1]);else{var tt=C.range[0],et=C.range[1];J?(tt<=0&&et<=0&&E(N+".autorange",!0),tt<=0?tt=et/1e6:et<=0&&(et=tt/1e6),E(N+".range[0]",Math.log(tt)/Math.LN10),E(N+".range[1]",Math.log(et)/Math.LN10)):(E(N+".range[0]",Math.pow(10,tt)),E(N+".range[1]",Math.pow(10,et)))}else E(N+".autorange",!0);Array.isArray(u._subplots.polar)&&u._subplots.polar.length&&u[z.parts[0]]&&"radialaxis"===z.parts[1]&&delete u[z.parts[0]]._subplot.viewInitial["radialaxis.range"],l.getComponentMethod("annotations","convertCoords")(t,V,D,E),l.getComponentMethod("images","convertCoords")(t,V,D,E)}else E(N+".autorange",!0),E(N+".range",null);a(u,N+"._inputRange").set(null)}else if(R.match(M)){var rt=a(u,P).get(),nt=(D||{}).type;(!nt||"-"===nt)&&(nt="linear"),l.getComponentMethod("annotations","convertCoords")(t,rt,nt,E),l.getComponentMethod("images","convertCoords")(t,rt,nt,E)}var it=b.containerArrayMatch(P);if(it){r=it.array,n=it.index;var at=it.property,ot=H||{editType:"calc"};""!==n&&""===at&&(b.isAddVal(D)?S[P]=null:b.isRemoveVal(D)?S[P]=(a(s,r).get()||[])[n]:i.warn("unrecognized full object value",e)),k.update(T,ot),y[r]||(y[r]={});var st=y[r][n];st||(st=y[r][n]={}),st[at]=D,delete e[P]}else"reverse"===R?(U.range?U.range.reverse():(E(N+".autorange",!0),U.range=[1,0]),V.autorange?T.calc=!0:T.plot=!0):("dragmode"===P&&(!1===D&&!1!==q||!1!==D&&!1===q)||u._has("scatter-like")&&u._has("regl")&&"dragmode"===P&&("lasso"===D||"select"===D)&&"lasso"!==q&&"select"!==q?T.plot=!0:H?k.update(T,H):T.calc=!0,z.set(D))}}for(r in y)b.applyContainerArrayChanges(t,f(s,r),y[r],T,f)||(T.plot=!0);for(var lt in I){var ct=(C=h.getFromId(t,lt))&&C._constraintGroup;if(ct)for(var ut in T.calc=!0,ct)I[ut]||(h.getFromId(t,ut)._constraintShrinkable=!0)}(K(t)||e.height||e.width)&&(T.plot=!0);var ht=u.shapes;for(n=0;n1;)if(n.pop(),void 0!==(r=a(e,n.join(".")+".uirevision").get()))return r;return e.uirevision}function it(t,e){for(var r=0;r=a.length?a[0]:a[t]:a}function l(t){return Array.isArray(o)?t>=o.length?o[0]:o[t]:o}function c(t,e){var r=0;return function(){if(t&&++r===e)return t()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise((function(o,h){var p=0;function f(t){return Array.isArray(a)?p>=a.length?t.transitionOpts=a[p]:t.transitionOpts=a[0]:t.transitionOpts=a,p++,t}var d,m,g=[],y=null==e,v=Array.isArray(e);if(y||v||!i.isPlainObject(e)){if(y||-1!==["string","number"].indexOf(typeof e))for(d=0;d0&&bb)&&T.push(m);g=T}}g.length>0?function(e){if(0!==e.length){for(var i=0;in._timeToNext&&function(){n._currentFrame&&n._currentFrame.onComplete&&n._currentFrame.onComplete();var e=n._currentFrame=n._frameQueue.shift();if(e){var r=e.name?e.name.toString():null;t._fullLayout._currentFrame=r,n._lastFrameAt=Date.now(),n._timeToNext=e.frameOpts.duration,u.transition(t,e.frame.data,e.frame.layout,w.coerceTraceIndices(t,e.frame.traces),e.frameOpts,e.transitionOpts).then((function(){e.onComplete&&e.onComplete()})),t.emit("plotly_animatingframe",{name:r,frame:e.frame,animation:{frame:e.frameOpts,transition:e.transitionOpts}})}else t.emit("plotly_animated"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}()};e()}()}}(g):(t.emit("plotly_animated"),o())}))},t.addFrames=function(t,e,r){if(t=i.getGraphDiv(t),null==e)return Promise.resolve();if(!i.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t+". It's likely that you've failed to create a plot before adding frames. For more details, see https://plotly.com/javascript/animations/");var n,a,o,l,c=t._transitionData._frames,h=t._transitionData._frameHash;if(!Array.isArray(e))throw new Error("addFrames failure: frameList must be an Array of frame definitions"+e);var p=c.length+2*e.length,f=[],d={};for(n=e.length-1;n>=0;n--)if(i.isPlainObject(e[n])){var m=e[n].name,g=(h[m]||d[m]||{}).name,y=e[n].name,v=h[g]||d[g];g&&y&&"number"==typeof y&&v&&S<5&&(S++,i.warn('addFrames: overwriting frame "'+(h[g]||d[g]).name+'" with a frame whose name of type "number" also equates to "'+g+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===S&&i.warn("addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),d[m]={name:m},f.push({frame:u.supplyFrameDefaults(e[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:p+n})}f.sort((function(t,e){return t.index>e.index?-1:t.index=0;n--){if("number"==typeof(a=f[n].frame).name&&i.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!a.name)for(;h[a.name="frame "+t._transitionData._counter++];);if(h[a.name]){for(o=0;o=0;r--)n=e[r],o.push({type:"delete",index:n}),l.unshift({type:"insert",index:n,value:a[n]});var c=u.modifyFrames,h=u.modifyFrames,p=[t,l],f=[t,o];return s&&s.add(t,c,p,h,f),u.modifyFrames(t,o)},t.addTraces=function e(r,n,a){r=i.getGraphDiv(r);var o,l,c=[],u=t.deleteTraces,h=e,p=[r,c],f=[r,n];for(function(t,e,r){var n,i;if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(typeof e>"u")throw new Error("traces must be defined.");for(Array.isArray(e)||(e=[e]),n=0;n"u")return l=t.redraw(r),s.add(r,u,p,h,f),l;Array.isArray(a)||(a=[a]);try{D(r,c,a)}catch(t){throw r.data.splice(r.data.length-n.length,n.length),t}return s.startSequence(r),s.add(r,u,p,h,f),l=t.moveTraces(r,c,a),s.stopSequence(r),l},t.deleteTraces=function e(r,n){r=i.getGraphDiv(r);var a,o,l=[],c=t.addTraces,u=e,h=[r,l,n],p=[r,n];if(typeof n>"u")throw new Error("indices must be an integer or array of integers.");for(Array.isArray(n)||(n=[n]),z(r,n,"indices"),(n=P(n,r.data.length-1)).sort(i.sorterDes),a=0;a=0&&r"u")for(a=[],o=0;o=0&&r")?"":e.html(t).text()}));return e.remove(),n}(_),(_=_.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(s,"'")}}}),Fn=f({"src/snapshot/svgtoimg.js"(t,e){var r=le(),n=pe().EventEmitter,i=On();e.exports=function(t){var e=t.emitter||new n,a=new Promise((function(n,a){var o,s,l=window.Image,c=t.svg,u=t.format||"png",h=t.canvas,p=t.scale||1,f=t.width||300,d=t.height||150,m=p*f,g=p*d,y=h.getContext("2d",{willReadFrequently:!0}),v=new l;"svg"===u||r.isSafari()?s=i.encodeSVG(c):(o=i.createBlob(c,"svg"),s=i.createObjectURL(o)),h.width=m,h.height=g,v.onload=function(){var r;switch(o=null,i.revokeObjectURL(s),"svg"!==u&&y.drawImage(v,0,0,m,g),u){case"jpeg":r=h.toDataURL("image/jpeg");break;case"png":r=h.toDataURL("image/png");break;case"webp":r=h.toDataURL("image/webp");break;case"svg":r=s;break;default:var l="Image format is not jpeg, png, svg or webp.";if(a(new Error(l)),!t.promise)return e.emit("error",l)}n(r),t.promise||e.emit("success",r)},v.onerror=function(r){if(o=null,i.revokeObjectURL(s),a(r),!t.promise)return e.emit("error",r)},v.src=s}));return t.promise?a:e}}}),Bn=f({"src/plot_api/to_image.js"(t,e){var r=A(),n=Dn(),i=Ae(),a=le(),o=On(),s=Rn(),l=Fn(),c=y().version,u={format:{valType:"enumerated",values:["png","jpeg","webp","svg","full-json"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}};e.exports=function(t,e){var h,p,f,d;function m(t){return!(t in e)||a.validate(e[t],u[t])}if(e=e||{},a.isPlainObject(t)?(h=t.data||[],p=t.layout||{},f=t.config||{},d={}):(t=a.getGraphDiv(t),h=a.extendDeep([],t.data),p=a.extendDeep({},t.layout),f=t._context,d=t._fullLayout||{}),!m("width")&&null!==e.width||!m("height")&&null!==e.height)throw new Error("Height and width should be pixel values.");if(!m("format"))throw new Error("Export format is not "+a.join2(u.format.values,", "," or ")+".");var g={};function y(t,r){return a.coerce(e,g,u,t,r)}var v=y("format"),x=y("width"),_=y("height"),b=y("scale"),w=y("setBackground"),T=y("imageDataOnly"),A=document.createElement("div");A.style.position="absolute",A.style.left="-5000px",document.body.appendChild(A);var k=a.extendFlat({},p);x?k.width=x:null===e.width&&r(d.width)&&(k.width=d.width),_?k.height=_:null===e.height&&r(d.height)&&(k.height=d.height);var M=a.extendFlat({},f,{_exportedPlot:!0,staticPlot:!0,setBackground:w}),S=o.getRedrawFunc(A);function E(){return new Promise((function(t){setTimeout(t,o.getDelay(A._fullLayout))}))}function C(){return new Promise((function(t,e){var r=s(A,v,b),u=A._fullLayout.width,h=A._fullLayout.height;function p(){n.purge(A),document.body.removeChild(A)}if("full-json"===v){var f=i.graphJson(A,!1,"keepdata","object",!0,!0);return f.version=c,f=JSON.stringify(f),p(),t(T?f:o.encodeJSON(f))}if(p(),"svg"===v)return t(T?r:o.encodeSVG(r));var d=document.createElement("canvas");d.id=a.randstr(),l({format:v,width:u,height:h,scale:b,canvas:d,svg:r,promise:!0}).then(t).catch(e)}))}return new Promise((function(t,e){n.newPlot(A,h,k,M).then(S).then(E).then(C).then((function(e){t(function(t){return T?t.replace(o.IMAGE_URL_PREFIX,""):t}(e))})).catch((function(t){e(t)}))}))}}}),jn=f({"src/plot_api/validate.js"(t,e){var r=le(),n=Ae(),i=ge(),a=Y().dfltConfig,o=r.isPlainObject,s=Array.isArray,l=r.isArrayOrTypedArray;function c(t,e,n,i,a,u){u=u||[];for(var h=Object.keys(t),m=0;mx.length&&i.push(p("unused",a,y.concat(x.length)));var k,M,S,E,C,I=x.length,L=Array.isArray(A);if(L&&(I=Math.min(I,A.length)),2===_.dimensions)for(M=0;Mx[M].length&&i.push(p("unused",a,y.concat(M,x[M].length)));var P=x[M].length;for(k=0;k<(L?Math.min(P,A[M].length):P);k++)S=L?A[M][k]:A,E=v[M][k],C=x[M][k],r.validate(E,S)?C!==E&&C!==+E&&i.push(p("dynamic",a,y.concat(M,k),E,C)):i.push(p("value",a,y.concat(M,k),E))}else i.push(p("array",a,y.concat(M),v[M]));else for(M=0;M1&&f.push(p("object","layout"))),n.supplyDefaults(d);for(var m=d._fullData,g=l.length,y=0;yT?h.push({code:"unused",traceType:v,templateCount:w,dataCount:T}):T>w&&h.push({code:"reused",traceType:v,templateCount:w,dataCount:T})}}else h.push({code:"data"});if(function t(e,n){for(var i in e)if("_"!==i.charAt(0)){var a=e[i],o=f(e,i,n);r(a)?(Array.isArray(e)&&!1===a._template&&a.templateitemname&&h.push({code:"missing",path:o,templateitemname:a.templateitemname}),t(a,o)):Array.isArray(a)&&d(a)&&t(a,o)}}({data:g,layout:p},""),h.length)return h.map(m)}}}),qn=f({"src/plot_api/index.js"(t){var e=Dn();t._doPlot=e._doPlot,t.newPlot=e.newPlot,t.restyle=e.restyle,t.relayout=e.relayout,t.redraw=e.redraw,t.update=e.update,t._guiRestyle=e._guiRestyle,t._guiRelayout=e._guiRelayout,t._guiUpdate=e._guiUpdate,t._storeDirectGUIEdit=e._storeDirectGUIEdit,t.react=e.react,t.extendTraces=e.extendTraces,t.prependTraces=e.prependTraces,t.addTraces=e.addTraces,t.deleteTraces=e.deleteTraces,t.moveTraces=e.moveTraces,t.purge=e.purge,t.addFrames=e.addFrames,t.deleteFrames=e.deleteFrames,t.animate=e.animate,t.setPlotConfig=e.setPlotConfig;var r=It().getGraphDiv,n=Zr().eraseActiveShape;t.deleteActiveShape=function(t){return n(r(t))},t.toImage=Bn(),t.validate=jn(),t.downloadImage=Un();var i=Vn();t.makeTemplate=i.makeTemplate,t.validateTemplate=i.validateTemplate}}),Hn=f({"src/traces/scatter/xy_defaults.js"(t,e){var r=le(),n=qt();e.exports=function(t,e,i,a){var o,s=a("x"),l=a("y");if(n.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],i),s){var c=r.minRowLength(s);l?o=Math.min(c,r.minRowLength(l)):(o=c,a("y0"),a("dy"))}else{if(!l)return 0;o=r.minRowLength(l),a("x0"),a("dx")}return e._length=o,o}}}),Gn=f({"src/traces/scatter/period_defaults.js"(t,e){var r=le().dateTick0,n=k().ONEWEEK;function i(t,e){return r(e,t%n==0?1:0)}e.exports=function(t,e,r,n,a){if(a||(a={x:!0,y:!0}),a.x){var o=n("xperiod");o&&(n("xperiod0",i(o,e.xcalendar)),n("xperiodalignment"))}if(a.y){var s=n("yperiod");s&&(n("yperiod0",i(s,e.ycalendar)),n("yperiodalignment"))}}}}),Wn=f({"src/traces/scatter/stack_defaults.js"(t,e){var r=["orientation","groupnorm","stackgaps"];e.exports=function(t,e,n,i){var a=n._scatterStackOpts,o=i("stackgroup");if(o){var s=e.xaxis+e.yaxis,l=a[s];l||(l=a[s]={});var c=l[o],u=!1;c?c.traces.push(e):(c=l[o]={traceIndices:[],traces:[e]},u=!0);for(var h={orientation:e.x&&!e.y?"h":"v"},p=0;p=0;p--){var f=t[p];if("scatter"===f.type&&f.xaxis===u.xaxis&&f.yaxis===u.yaxis){f.opacity=void 0;break}}}}}}}),ei=f({"src/traces/scatter/layout_defaults.js"(t,e){var r=le(),n=be();e.exports=function(t,e){var i,a="group"===e.barmode;"group"===e.scattermode&&(i=a?e.bargap:.2,r.coerce(t,e,n,"scattergap",i))}}}),ri=f({"src/plots/cartesian/align_period.js"(t,e){var r=A(),n=le(),i=n.dateTime2ms,a=n.incrementMonth,o=k().ONEAVGMONTH;e.exports=function(t,e,n,s){if("date"!==e.type)return{vals:s};var l=t[n+"periodalignment"];if(!l)return{vals:s};var c,u=t[n+"period"];if(r(u)){if((u=+u)<=0)return{vals:s}}else if("string"==typeof u&&"M"===u.charAt(0)){var h=+u.substring(1);if(!(h>0&&Math.round(h)===h))return{vals:s};c=h}for(var p=e.calendar,f="start"===l,d="end"===l,m=t[n+"period0"],g=i(m,p)||0,y=[],v=[],x=[],_=s.length,b=0;b<_;b++){var w,T,A,k=s[b];if(c){for(w=Math.round((k-g)/(c*o)),A=a(g,c*w,p);A>k;)A=a(A,-c,p);for(;A<=k;)A=a(A,c,p);T=a(A,-c,p)}else{for(A=g+(w=Math.round((k-g)/u))*u;A>k;)A-=u;for(;A<=k;)A+=u;T=A-u}y[b]=f?T:d?A:(T+A)/2,v[b]=T,x[b]=A}return{vals:y,starts:v,ends:x}}}}),ni=f({"src/traces/scatter/colorscale_calc.js"(t,e){var r=Ee().hasColorscale,n=We(),i=Ye();e.exports=function(t,e){i.hasLines(e)&&r(e,"line")&&n(t,e,{vals:e.line.color,containerStr:"line",cLetter:"c"}),i.hasMarkers(e)&&(r(e,"marker")&&n(t,e,{vals:e.marker.color,containerStr:"marker",cLetter:"c"}),r(e,"marker.line")&&n(t,e,{vals:e.marker.line.color,containerStr:"marker.line",cLetter:"c"}))}}}),ii=f({"src/traces/scatter/arrays_to_calcdata.js"(t,e){var r=le();e.exports=function(t,e){for(var n=0;nd&&I[y].gap;)y--;for(x=I[y].s,g=I.length-1;g>y;g--)I[g].s=x;for(;dh+c||!r(u))}for(var f=0;fS[h]&&h0?o:s)/(I._m*z*(I._m>0?o:s)))),a*=1e3}if(l===i){if(P&&(l=I.c2p(n.y,!0)),l===i)return!1;l*=1e3}return[a,l]}function Y(t,e,r,n){var i=r-t,a=n-e,o=.5-t,s=.5-e,l=i*i+a*a,c=i*o+a*s;if(c>0&&cot||t[1]lt)return[u(t[0],at,ot),u(t[1],st,lt)]}function ht(t,e){if(t[0]===e[0]&&(t[0]===at||t[0]===ot)||t[1]===e[1]&&(t[1]===st||t[1]===lt))return!0}function pt(t,e,r){return function(n,i){var a=ut(n),o=ut(i),s=[];if(a&&o&&ht(a,o))return s;a&&s.push(a),o&&s.push(o);var c=2*l.constrain((n[t]+i[t])/2,e,r)-((a||n)[t]+(o||i)[t]);return c&&((a&&o?c>0==a[t]>o[t]?a:o:a||o)[t]+=c),s}}function ft(t){var e=t[0],r=t[1],n=e===G[W-1][0],i=r===G[W-1][1];if(!n||!i)if(W>1){var a=e===G[W-2][0],o=r===G[W-2][1];n&&(e===at||e===ot)&&a?o?W--:G[W-1]=t:i&&(r===st||r===lt)&&o?a?W--:G[W-1]=t:G[W++]=t}else G[W++]=t}function dt(t){G[W-1][0]!==t[0]&&G[W-1][1]!==t[1]&&ft([Q,tt]),ft(t),et=null,Q=tt=0}"linear"===j||"spline"===j?nt=function(t,e){for(var r=[],n=0,i=0;i<4;i++){var a=ct[i],o=c(t[0],t[1],e[0],e[1],a[0],a[1],a[2],a[3]);o&&(!n||Math.abs(o.x-r[0][0])>1||Math.abs(o.y-r[0][1])>1)&&(o=[o.x,o.y],n&&$(o,t)<$(r[0],t)?r.unshift(o):r.push(o),n++)}return r}:"hv"===j||"vh"===j?nt=function(t,e){var r=[],n=ut(t),i=ut(e);return n&&i&&ht(n,i)||(n&&r.push(n),i&&r.push(i)),r}:"hvh"===j?nt=pt(0,at,ot):"vhv"===j&&(nt=pt(1,st,lt));var mt=l.isArrayOrTypedArray(R);function gt(e){if(e&&O&&(e.i=n,e.d=t,e.trace=E,e.marker=mt?R[e.i]:R,e.backoff=O),M=e[0]/z,S=e[1]/D,K=e[0]ot?ot:0,J=e[1]lt?lt:0,K||J){if(W)if(et){var r=nt(et,e);r.length>1&&(dt(r[0]),G[W++]=r[1])}else rt=nt(G[W-1],e)[0],G[W++]=rt;else G[W++]=[K||e[0],J||e[1]];var i=G[W-1];K&&J&&(i[0]!==K||i[1]!==J)?(et&&(Q!==K&&tt!==J?ft(Q&&tt?function(t,e){var r=e[0]-t[0],n=(e[1]-t[1])/r;return(t[1]*e[0]-e[1]*t[0])/r>0?[n>0?at:ot,lt]:[n>0?ot:at,st]}(et,e):[Q||K,tt||J]):Q&&tt&&ft([Q,tt])),ft([K,J])):Q-K&&tt-J&&ft([K||Q,J||tt]),et=e,Q=K,tt=J}else et&&dt(nt(et,e)[0]),G[W++]=e}for(n=0;nX(m,yt))break;p=m,(w=v[0]*y[0]+v[1]*y[1])>_?(_=w,f=m,g=!1):w=t.length||!m)break;gt(m),a=m}}else gt(f)}et&&ft([Q||et[0],tt||et[1]]),V.push(G.slice(0,W))}var vt=j.slice(j.length-1);if(O&&"h"!==vt&&"v"!==vt){for(var xt=!1,_t=-1,bt=[],wt=0;wt=0?l=f:(l=f=p,p++),l=u[0]&&t.x<=u[1]&&t.y>=h[0]&&t.y<=h[1]})),m=Math.ceil(d.length/f),g=0;o.forEach((function(t,r){var n=t[0].trace;l.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;function x(t){return v?t.transition():t}var _=u.xaxis,b=u.yaxis,w=p[0].trace,T=w.line,A=r.select(d),k=a(A,"g","errorbars"),M=a(A,"g","lines"),S=a(A,"g","points"),E=a(A,"g","text");if(n.getComponentMethod("errorbars","plot")(t,k,u,m),!0===w.visible){x(A).style("opacity",w.opacity);var C,I,L,P,z=w.fill.charAt(w.fill.length-1);"x"!==z&&"y"!==z&&(z=""),"y"===z?(L=1,P=b.c2p(0,!0)):"x"===z&&(L=0,P=_.c2p(0,!0)),p[0][u.isRangePlot?"nodeRangePlot3":"node3"]=A;var D="",O=[],R=w._prevtrace,F=null,B=null;R&&(D=R._prevRevpath||"",I=R._nextFill,O=R._ownPolygons,F=R._fillsegments,B=R._fillElement);var j,N,U,V,q,H,G,W,Z="",Y="",X=[];w._polygons=[];var $=[],K=[],J=i.noop;if(C=w._ownFill,l.hasLines(w)||"none"!==w.fill){I&&I.datum(p),-1!==["hv","vh","hvh","vhv"].indexOf(T.shape)?(U=s.steps(T.shape),V=s.steps(T.shape.split("").reverse().join(""))):U=V="spline"===T.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?s.smoothclosed(t.slice(1),T.smoothing):s.smoothopen(t,T.smoothing)}:function(t){return"M"+t.join("L")},q=function(t){return V(t.reverse())},K=c(p,{xaxis:_,yaxis:b,trace:w,connectGaps:w.connectgaps,baseTolerance:Math.max(T.width||1,3)/4,shape:T.shape,backoff:T.backoff,simplify:T.simplify,fill:w.fill}),$=new Array(K.length);var Q=0;for(g=0;g0,g=u(t,e,n);(h=i.selectAll("g.trace").data(g,(function(t){return t[0].trace.uid}))).enter().append("g").attr("class",(function(t){return"trace scatter trace"+t[0].trace.uid})).style("stroke-miterlimit",2),h.order(),function(t,e,n){e.each((function(e){var i=a(r.select(this),"g","fills");s.setClipUrl(i,n.layerClipId,t);var l=e[0].trace,c=[];l._ownfill&&c.push("_ownFill"),l._nexttrace&&c.push("_nextFill");var u=i.selectAll("g").data(c,o);u.enter().append("g"),u.exit().each((function(t){l[t]=null})).remove(),u.order().each((function(t){l[t]=a(r.select(this),"path","js-fill")}))}))}(t,h,e),m?(c&&(f=c()),r.transition().duration(l.duration).ease(l.easing).each("end",(function(){f&&f()})).each("interrupt",(function(){f&&f()})).each((function(){i.selectAll("g.trace").each((function(r,n){p(t,n,e,r,g,this,l)}))}))):h.each((function(r,n){p(t,n,e,r,g,this,l)})),d&&h.exit().remove(),i.selectAll("path:not([d])").remove()}}}),fi=f({"src/traces/scatter/marker_colorbar.js"(t,e){e.exports={container:"marker",min:"cmin",max:"cmax"}}}),di=f({"src/traces/scatter/format_labels.js"(t,e){var r=ir();e.exports=function(t,e,n){var i={},a={_fullLayout:n},o=r.getFromTrace(a,e,"x"),s=r.getFromTrace(a,e,"y"),l=t.orig_x;void 0===l&&(l=t.x);var c=t.orig_y;return void 0===c&&(c=t.y),i.xLabel=r.tickText(o,o.c2l(l),!0).text,i.yLabel=r.tickText(s,s.c2l(c),!0).text,i}}}),mi=f({"src/traces/scatter/style.js"(t,e){var r=x(),n=Qe(),i=qt();function a(t,e,r){n.pointStyle(t.selectAll("path.point"),e,r)}function o(t,e,r){n.textPointStyle(t.selectAll("text"),e,r)}e.exports={style:function(t){var e=r.select(t).selectAll("g.trace.scatter");e.style("opacity",(function(t){return t[0].trace.opacity})),e.selectAll("g.points").each((function(e){a(r.select(this),e.trace||e[0].trace,t)})),e.selectAll("g.text").each((function(e){o(r.select(this),e.trace||e[0].trace,t)})),e.selectAll("g.trace path.js-line").call(n.lineGroupStyle),e.selectAll("g.trace path.js-fill").call(n.fillGroupStyle,t,!1),i.getComponentMethod("errorbars","style")(e)},stylePoints:a,styleText:o,styleOnSelect:function(t,e,r){var i=e[0].trace;i.selectedpoints?(n.selectedPointStyle(r.selectAll("path.point"),i),n.selectedTextStyle(r.selectAll("text"),i)):(a(r,i,t),o(r,i,t))}}}}),gi=f({"src/traces/scatter/get_trace_color.js"(t,e){var r=H(),n=Ye();e.exports=function(t,e){var i,a;if("lines"===t.mode)return(i=t.line.color)&&r.opacity(i)?i:t.fillcolor;if("none"===t.mode)return t.fill?t.fillcolor:"";var o=e.mcc||(t.marker||{}).color,s=e.mlcc||((t.marker||{}).line||{}).color;return(a=o&&r.opacity(o)?o:s&&r.opacity(s)&&(e.mlw||((t.marker||{}).line||{}).width)?s:"")?r.opacity(a)<.3?r.addOpacity(a,.3):a:(i=(t.line||{}).color)&&r.opacity(i)&&n.hasLines(t)&&t.line.width?i:t.fillcolor}}}),yi=f({"src/traces/scatter/hover.js"(t,e){var r=le(),n=Dr(),i=qt(),a=gi(),o=H(),s=r.fillText;e.exports=function(t,e,l,c){var u=t.cd,h=u[0].trace,p=t.xa,f=t.ya,d=p.c2p(e),m=f.c2p(l),g=[d,m],y=h.hoveron||"",v=-1!==h.mode.indexOf("markers")?3:.5,x=!!h.xperiodalignment,_=!!h.yperiodalignment;if(-1!==y.indexOf("points")){var b=function(t){var e=Math.max(v,t.mrc||0),r=p.c2p(t.x)-d,n=f.c2p(t.y)-m;return Math.max(Math.sqrt(r*r+n*n)-e,1-v/e)},w=n.getDistanceFunction(c,(function(t){if(x){var e=p.c2p(t.xStart),r=p.c2p(t.xEnd);return d>=Math.min(e,r)&&d<=Math.max(e,r)?0:1/0}var n=Math.max(3,t.mrc||0),i=1-1/n,a=Math.abs(p.c2p(t.x)-d);return a=Math.min(e,r)&&m<=Math.max(e,r)?0:1/0}var n=Math.max(3,t.mrc||0),i=1-1/n,a=Math.abs(f.c2p(t.y)-m);return ar!=(c=i[n][1])>=r&&(o=i[n-1][0],s=i[n][0],c-l&&(a=o+(s-o)*(r-l)/(c-l),h=Math.min(h,a),d=Math.max(d,a)));return{x0:h=Math.max(h,0),x1:d=Math.min(d,p._length),y0:r,y1:r}}(h._polygons);null===P&&(P={x0:g[0],x1:g[0],y0:g[1],y1:g[1]});var z=o.defaultLine;return o.opacity(h.fillcolor)?z=h.fillcolor:o.opacity((h.line||{}).color)&&(z=h.line.color),r.extendFlat(t,{distance:t.maxHoverDistance,x0:P.x0,x1:P.x1,y0:P.y0,y1:P.y1,color:z,hovertemplate:!1}),delete t.index,h.text&&!r.isArrayOrTypedArray(h.text)?t.text=String(h.text):t.text=h.name,[t]}}}}),vi=f({"src/traces/scatter/select.js"(t,e){var r=Ye();e.exports=function(t,e){var n,i,a,o,s=t.cd,l=t.xaxis,c=t.yaxis,u=[],h=s[0].trace;if(!r.hasMarkers(h)&&!r.hasText(h))return[];if(!1===e)for(n=0;n0&&(i["_"+r+"axes"]||{})[e])return i;if((i[r+"axis"]||r)===e){if(a(i,r))return i;if((i[r]||[]).length||i[r+"0"])return i}}}(e,s,l);if(c){if("histogram"===c.type&&l==={v:"y",h:"x"}[c.orientation||"v"])return void(t.type="linear");var u=l+"calendar",h=c[u],p={noMultiCategory:!r(c,"cartesian")||r(c,"noMultiCategory")};if("box"===c.type&&c._hasPreCompStats&&l==={h:"x",v:"y"}[c.orientation||"v"]&&(p.noMultiCategory=!0),p.autotypenumbers=t.autotypenumbers,a(c,l)){var f=i(c),d=[];for(o=0;o0||r(o);s&&(a="array");var l,c=n("categoryorder",a);"array"===c&&(l=n("categoryarray")),!s&&"array"===c&&(c=e.categoryorder="trace"),"trace"===c?e._initialCategories=[]:"array"===c?e._initialCategories=l.slice():(l=function(t,e){var r,n,i,a=e.dataAttr||t._id.charAt(0),o={};if(e.axData)r=e.axData;else for(r=[],n=0;n=2){var l,c,u="";if(2===o.length)for(l=0;l<2;l++)if(c=_(o[l])){u=g;break}var h=a("pattern",u);if(h===g)for(l=0;l<2;l++)(c=_(o[l]))&&(e.bounds[l]=o[l]=c-1);if(h)for(l=0;l<2;l++)switch(c=o[l],h){case g:if(!r(c))return void(e.enabled=!1);if((c=+c)!==Math.floor(c)||c<0||c>=7)return void(e.enabled=!1);e.bounds[l]=o[l]=c;break;case y:if(!r(c))return void(e.enabled=!1);if((c=+c)<0||c>24)return void(e.enabled=!1);e.bounds[l]=o[l]=c}if(!1===n.autorange){var p=n.range;if(p[0]p[1])return void(e.enabled=!1)}else if(o[0]>p[0]&&o[1]_[1]-1/4096&&(e.domain=s),n.noneOrAll(t.domain,e.domain,s),"sync"===e.tickmode&&(e.tickmode="auto")}return i("layer"),e}}}),ki=f({"src/plots/cartesian/layout_defaults.js"(t,e){var r=le(),n=H(),i=$e().isUnifiedHover,a=Ir(),o=ye(),s=Nt(),l=Ie(),c=_i(),u=Ti(),h=rn(),p=Ai(),f=xe(),d=f.id2name,m=f.name2id,g=ve().AX_ID_PATTERN,y=qt(),v=y.traceIs,x=y.getComponentMethod;function _(t,e,r){Array.isArray(t[e])?t[e].push(r):t[e]=[r]}e.exports=function(t,e,y){var b,w,T=e.autotypenumbers,A={},k={},M={},S={},E={},C={},I={},L={},P={},z={};for(b=0;bs.duration?(function(){for(var r={},i=0;i rect").call(a.setTranslate,0,0).call(a.setScale,1,1),t.plot.call(a.setTranslate,e._offset,r._offset).call(a.setScale,1,1);var n=t.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(a.setPointGroupScale,1,1),n.selectAll(".textpoint").call(a.setTextPointsScale,1,1),n.call(a.hideOutsideRangePoints,t)}function g(e,r){var n=e.plotinfo,s=n.xaxis,l=n.yaxis,c=s._length,u=l._length,h=!!e.xr1,p=!!e.yr1,f=[];if(h){var d=i.simpleMap(e.xr0,s.r2l),m=i.simpleMap(e.xr1,s.r2l),g=d[1]-d[0],y=m[1]-m[0];f[0]=(d[0]*(1-r)+r*m[0]-d[0])/(d[1]-d[0])*c,f[2]=c*(1-r+r*y/g),s.range[0]=s.l2r(d[0]*(1-r)+r*m[0]),s.range[1]=s.l2r(d[1]*(1-r)+r*m[1])}else f[0]=0,f[2]=c;if(p){var v=i.simpleMap(e.yr0,l.r2l),x=i.simpleMap(e.yr1,l.r2l),_=v[1]-v[0],b=x[1]-x[0];f[1]=(v[1]*(1-r)+r*x[1]-v[1])/(v[0]-v[1])*u,f[3]=u*(1-r+r*b/_),l.range[0]=s.l2r(v[0]*(1-r)+r*x[0]),l.range[1]=l.l2r(v[1]*(1-r)+r*x[1])}else f[1]=0,f[3]=u;o.drawOne(t,s,{skipTitle:!0}),o.drawOne(t,l,{skipTitle:!0}),o.redrawComponents(t,[s._id,l._id]);var w=h?c/f[2]:1,T=p?u/f[3]:1,A=h?f[0]:0,k=p?f[1]:0,M=h?f[0]/f[2]*c:0,S=p?f[1]/f[3]*u:0,E=s._offset-M,C=l._offset-S;n.clipRect.call(a.setTranslate,A,k).call(a.setScale,1/w,1/T),n.plot.call(a.setTranslate,E,C).call(a.setScale,w,T),a.setPointGroupScale(n.zoomScalePts,1/w,1/T),a.setTextPointsScale(n.zoomScaleTxt,1/w,1/T)}o.redrawComponents(t)}}}),Si=f({"src/plots/cartesian/index.js"(t){var e=x(),r=qt(),n=le(),i=Ae(),a=Qe(),o=we().getModuleCalcData,s=xe(),l=ve(),c=ke(),u=n.ensureSingle;function h(t,e,r){return n.ensureSingle(t,e,r,(function(t){t.datum(r)}))}var p=l.zindexSeparator;function f(t,n,i,s,c){for(var u,h,p,f=l.traceLayerClasses,d=t._fullLayout,m=d._zindices,g=d._modules,y=[],v=[],x=0;x1,m=e.mainplotinfo;if(!e.mainplot||d)if(f)e.xlines=u(n,"path","xlines-above"),e.ylines=u(n,"path","ylines-above"),e.xaxislayer=u(n,"g","xaxislayer-above"),e.yaxislayer=u(n,"g","yaxislayer-above");else{if(!a){var g=u(n,"g","layer-subplot");e.shapelayer=u(g,"g","shapelayer"),e.imagelayer=u(g,"g","imagelayer"),m&&d?(e.minorGridlayer=m.minorGridlayer,e.gridlayer=m.gridlayer,e.zerolinelayer=m.zerolinelayer):(e.minorGridlayer=u(n,"g","minor-gridlayer"),e.gridlayer=u(n,"g","gridlayer"),e.zerolinelayer=u(n,"g","zerolinelayer"));var y=u(n,"g","layer-between");e.shapelayerBetween=u(y,"g","shapelayer"),e.imagelayerBetween=u(y,"g","imagelayer"),u(n,"path","xlines-below"),u(n,"path","ylines-below"),e.overlinesBelow=u(n,"g","overlines-below"),u(n,"g","xaxislayer-below"),u(n,"g","yaxislayer-below"),e.overaxesBelow=u(n,"g","overaxes-below")}e.overplot=u(n,"g","overplot"),e.plot=u(e.overplot,"g",i),a||(e.xlines=u(n,"path","xlines-above"),e.ylines=u(n,"path","ylines-above"),e.overlinesAbove=u(n,"g","overlines-above"),u(n,"g","xaxislayer-above"),u(n,"g","yaxislayer-above"),e.overaxesAbove=u(n,"g","overaxes-above"),e.xlines=n.select(".xlines-"+o),e.ylines=n.select(".ylines-"+c),e.xaxislayer=n.select(".xaxislayer-"+o),e.yaxislayer=n.select(".yaxislayer-"+c))}else{var v=m.plotgroup,x=i+"-x",_=i+"-y";e.minorGridlayer=m.minorGridlayer,e.gridlayer=m.gridlayer,e.zerolinelayer=m.zerolinelayer,u(m.overlinesBelow,"path",x),u(m.overlinesBelow,"path",_),u(m.overaxesBelow,"g",x),u(m.overaxesBelow,"g",_),e.plot=u(m.overplot,"g",i),u(m.overlinesAbove,"path",x),u(m.overlinesAbove,"path",_),u(m.overaxesAbove,"g",x),u(m.overaxesAbove,"g",_),e.xlines=v.select(".overlines-"+o).select("."+x),e.ylines=v.select(".overlines-"+c).select("."+_),e.xaxislayer=v.select(".overaxes-"+o).select("."+x),e.yaxislayer=v.select(".overaxes-"+c).select("."+_)}a||(f||(h(e.minorGridlayer,"g",e.xaxis._id),h(e.minorGridlayer,"g",e.yaxis._id),e.minorGridlayer.selectAll("g").map((function(t){return t[0]})).sort(s.idSort),h(e.gridlayer,"g",e.xaxis._id),h(e.gridlayer,"g",e.yaxis._id),e.gridlayer.selectAll("g").map((function(t){return t[0]})).sort(s.idSort)),e.xlines.style("fill","none").classed("crisp",!0),e.ylines.style("fill","none").classed("crisp",!0))}function m(t,r){if(t){var n={};for(var i in t.each((function(t){var i=t[0];e.select(this).remove(),g(i,r),n[i]=!0})),r._plots)for(var a=r._plots[i].overlays||[],o=0;o0){var g=m.id;if(-1!==g.indexOf(p))continue;g+=p+(u+1),m=n.extendFlat({},m,{id:g,plot:o._cartesianlayer.selectAll(".subplot").select("."+g)})}for(var y,v=[],x=0;x1&&(w+=p+b),_.push(n+w),r=0;r=0,x=e.indexOf("end")>=0,_=d.backoff*g+a.standoff,b=m.backoff*y+a.startstandoff;if("line"===f.nodeName){c={x:+t.attr("x1"),y:+t.attr("y1")},u={x:+t.attr("x2"),y:+t.attr("y2")};var w=c.x-u.x,T=c.y-u.y;if(p=(h=Math.atan2(T,w))+Math.PI,_&&b&&_+b>Math.sqrt(w*w+T*T))return void D();if(_){if(_*_>w*w+T*T)return void D();var A=_*Math.cos(h),k=_*Math.sin(h);u.x+=A,u.y+=k,t.attr({x2:u.x,y2:u.y})}if(b){if(b*b>w*w+T*T)return void D();var M=b*Math.cos(h),S=b*Math.sin(h);c.x-=M,c.y-=S,t.attr({x1:c.x,y1:c.y})}}else if("path"===f.nodeName){var E=f.getTotalLength(),C="";if(E<_+b)return void D();var I=f.getPointAtLength(0),L=f.getPointAtLength(.1);h=Math.atan2(I.y-L.y,I.x-L.x),c=f.getPointAtLength(Math.min(b,E)),C="0px,"+b+"px,";var P=f.getPointAtLength(E),z=f.getPointAtLength(E-.1);p=Math.atan2(P.y-z.y,P.x-z.x),u=f.getPointAtLength(Math.max(0,E-_)),C+=E-(C?b+_:_)+"px,"+E+"px",t.style("stroke-dasharray",C)}function D(){t.style("stroke-dasharray","0px,100px")}function O(e,i,c,u){e.path&&(e.noRotate&&(c=0),r.select(f.parentNode).append("path").attr({class:t.attr("class"),d:e.path,transform:l(i.x,i.y)+s(180*c/Math.PI)+o(u)}).style({fill:n.rgb(a.arrowcolor),"stroke-width":0}))}v&&O(m,c,h,y),x&&O(d,u,p,g)}}}),Ii=f({"src/components/annotations/draw.js"(t,e){var r=x(),n=qt(),i=Ae(),a=le(),o=a.strTranslate,s=ir(),l=H(),c=Qe(),u=Dr(),h=Se(),p=fr(),f=pr(),d=ye().arrayEditor,m=Ci();function g(t,e){var r=t._fullLayout.annotations[e]||{},n=s.getFromId(t,r.xref),i=s.getFromId(t,r.yref);n&&n.setScale(),i&&i.setScale(),v(t,r,e,!1,n,i)}function y(t,e,r,n,i){var a=i[r],o=i[r+"ref"],l=-1!==r.indexOf("y"),c="domain"===s.getRefType(o),u=l?n.h:n.w;return t?c?a+(l?-e:e)/t._length:t.p2r(t.r2p(a)+e):a+(l?-e:e)/u}function v(t,e,i,g,v,x){var _,b,w=t._fullLayout,T=t._fullLayout._size,A=t._context.edits;g?(_="annotation-"+g,b=g+".annotations"):(_="annotation",b="annotations");var k=d(t.layout,b,e),M=k.modifyBase,S=k.modifyItem,E=k.getUpdateObj;w._infolayer.selectAll("."+_+'[data-index="'+i+'"]').remove();var C="clip"+w._uid+"_ann"+i;if(e._input&&!1!==e.visible){var I={x:{},y:{}},L=+e.textangle||0,P=w._infolayer.append("g").classed(_,!0).attr("data-index",String(i)).style("opacity",e.opacity),z=P.append("g").classed("annotation-text-g",!0),D=A[e.showarrow?"annotationTail":"annotationPosition"],O=e.captureevents||A.annotationText||D,R=z.append("g").style("pointer-events",O?"all":null).call(p,"pointer").on("click",(function(){t._dragging=!1,t.emit("plotly_clickannotation",W(r.event))}));e.hovertext&&R.on("mouseover",(function(){var r=e.hoverlabel,n=r.font,i=this.getBoundingClientRect(),a=t.getBoundingClientRect();u.loneHover({x0:i.left-a.left,x1:i.right-a.left,y:(i.top+i.bottom)/2-a.top,text:e.hovertext,color:r.bgcolor,borderColor:r.bordercolor,fontFamily:n.family,fontSize:n.size,fontColor:n.color,fontWeight:n.weight,fontStyle:n.style,fontVariant:n.variant,fontShadow:n.fontShadow,fontLineposition:n.fontLineposition,fontTextcase:n.fontTextcase},{container:w._hoverlayer.node(),outerContainer:w._paper.node(),gd:t})})).on("mouseout",(function(){u.loneUnhover(w._hoverlayer.node())}));var F=e.borderwidth,B=e.borderpad,j=F+B,N=R.append("rect").attr("class","bg").style("stroke-width",F+"px").call(l.stroke,e.bordercolor).call(l.fill,e.bgcolor),U=e.width||e.height,V=w._topclips.selectAll("#"+C).data(U?[0]:[]);V.enter().append("clipPath").classed("annclip",!0).attr("id",C).append("rect"),V.exit().remove();var q=e.font,H=w._meta?a.templateString(e.text,w._meta):e.text,G=R.append("text").classed("annotation-text",!0).text(H);A.annotationText?G.call(h.makeEditable,{delegate:R,gd:t}).call(Z).on("edit",(function(r){e.text=r,this.call(Z),S("text",r),v&&v.autorange&&M(v._name+".autorange",!0),x&&x.autorange&&M(x._name+".autorange",!0),n.call("_guiRelayout",t,E())})):G.call(Z)}else r.selectAll("#"+C).remove();function W(t){var r={index:i,annotation:e._input,fullAnnotation:e,event:t};return g&&(r.subplotId=g),r}function Z(r){return r.call(c.font,q).attr({"text-anchor":{left:"start",right:"end"}[e.align]||"middle"}),h.convertToTspans(r,t,Y),r}function Y(){var r=G.selectAll("a");1===r.size()&&r.text()===G.text()&&R.insert("a",":first-child").attr({"xlink:xlink:href":r.attr("xlink:href"),"xlink:xlink:show":r.attr("xlink:show")}).style({cursor:"pointer"}).node().appendChild(N.node());var i=R.select(".annotation-text-math-group"),u=!i.empty(),d=c.bBox((u?i:G).node()),_=d.width,b=d.height,k=e.width||_,O=e.height||b,B=Math.round(k+2*j),q=Math.round(O+2*j);function H(t,e){return"auto"===e&&(e=t<1/3?"left":t>2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}for(var Z=!1,Y=["x","y"],X=0;X1)&&(nt===rt?((ft=it.r2fraction(e["a"+et]))<0||ft>1)&&(Z=!0):Z=!0),$=it._offset+it.r2p(e[et]),Q=.5}else{var dt="domain"===pt;"x"===et?(J=e[et],$=dt?it._offset+it._length*J:$=T.l+T.w*J):(J=1-e[et],$=dt?it._offset+it._length*J:$=T.t+T.h*J),Q=e.showarrow?.5:J}if(e.showarrow){ht.head=$;var mt=e["a"+et];if(tt=ot*H(.5,e.xanchor)-st*H(.5,e.yanchor),nt===rt){var gt=s.getRefType(nt);"domain"===gt?("y"===et&&(mt=1-mt),ht.tail=it._offset+it._length*mt):"paper"===gt?"y"===et?(mt=1-mt,ht.tail=T.t+T.h*mt):ht.tail=T.l+T.w*mt:ht.tail=it._offset+it.r2p(mt),K=tt}else ht.tail=$+mt,K=tt+mt;ht.text=ht.tail+tt;var yt=w["x"===et?"width":"height"];if("paper"===rt&&(ht.head=a.constrain(ht.head,1,yt-1)),"pixel"===nt){var vt=-Math.max(ht.tail-3,ht.text),xt=Math.min(ht.tail+3,ht.text)-yt;vt>0?(ht.tail+=vt,ht.text+=vt):xt>0&&(ht.tail-=xt,ht.text-=xt)}ht.tail+=ut,ht.head+=ut}else K=tt=lt*H(Q,ct),ht.text=$+tt;ht.text+=ut,tt+=ut,K+=ut,e["_"+et+"padplus"]=lt/2+K,e["_"+et+"padminus"]=lt/2-K,e["_"+et+"size"]=lt,e["_"+et+"shift"]=tt}if(Z)R.remove();else{var _t=0,bt=0;if("left"!==e.align&&(_t=(k-_)*("center"===e.align?.5:1)),"top"!==e.valign&&(bt=(O-b)*("middle"===e.valign?.5:1)),u)i.select("svg").attr({x:j+_t-1,y:j+bt}).call(c.setClipUrl,U?C:null,t);else{var wt=j+bt-d.top,Tt=j+_t-d.left;G.call(h.positionText,Tt,wt).call(c.setClipUrl,U?C:null,t)}V.select("rect").call(c.setRect,j,j,k,O),N.call(c.setRect,F/2,F/2,B-F,q-F),R.call(c.setTranslate,Math.round(I.x.text-B/2),Math.round(I.y.text-q/2)),z.attr({transform:"rotate("+L+","+I.x.text+","+I.y.text+")"});var At,kt=function(r,i){P.selectAll(".annotation-arrow-g").remove();var s=I.x.head,u=I.y.head,h=I.x.tail+r,p=I.y.tail+i,d=I.x.text+r,_=I.y.text+i,b=a.rotationXYMatrix(L,d,_),w=a.apply2DTransform(b),k=a.apply2DTransform2(b),C=+N.attr("width"),D=+N.attr("height"),O=d-.5*C,F=O+C,B=_-.5*D,j=B+D,U=[[O,B,O,j],[O,j,F,j],[F,j,F,B],[F,B,O,B]].map(k);if(!U.reduce((function(t,e){return t^!!a.segmentsIntersect(s,u,s+1e6,u+1e6,e[0],e[1],e[2],e[3])}),!1)){U.forEach((function(t){var e=a.segmentsIntersect(h,p,s,u,t[0],t[1],t[2],t[3]);e&&(h=e.x,p=e.y)}));var V=e.arrowwidth,q=e.arrowcolor,H=e.arrowside,G=P.append("g").style({opacity:l.opacity(q)}).classed("annotation-arrow-g",!0),W=G.append("path").attr("d","M"+h+","+p+"L"+s+","+u).style("stroke-width",V+"px").call(l.stroke,l.rgb(q));if(m(W,H,e),A.annotationPosition&&W.node().parentNode&&!g){var Z=s,Y=u;if(e.standoff){var X=Math.sqrt(Math.pow(s-h,2)+Math.pow(u-p,2));Z+=e.standoff*(h-s)/X,Y+=e.standoff*(p-u)/X}var $,K,J=G.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(h-Z)+","+(p-Y),transform:o(Z,Y)}).style("stroke-width",V+6+"px").call(l.stroke,"rgba(0,0,0,0)").call(l.fill,"rgba(0,0,0,0)");f.init({element:J.node(),gd:t,prepFn:function(){var t=c.getTranslate(R);$=t.x,K=t.y,v&&v.autorange&&M(v._name+".autorange",!0),x&&x.autorange&&M(x._name+".autorange",!0)},moveFn:function(t,r){var n=w($,K),i=n[0]+t,a=n[1]+r;R.call(c.setTranslate,i,a),S("x",y(v,t,"x",T,e)),S("y",y(x,r,"y",T,e)),e.axref===e.xref&&S("ax",y(v,t,"ax",T,e)),e.ayref===e.yref&&S("ay",y(x,r,"ay",T,e)),G.attr("transform",o(t,r)),z.attr({transform:"rotate("+L+","+i+","+a+")"})},doneFn:function(){n.call("_guiRelayout",t,E());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}};e.showarrow&&kt(0,0),D&&f.init({element:R.node(),gd:t,prepFn:function(){At=z.attr("transform")},moveFn:function(t,r){var n="pointer";if(e.showarrow)e.axref===e.xref?S("ax",y(v,t,"ax",T,e)):S("ax",e.ax+t),e.ayref===e.yref?S("ay",y(x,r,"ay",T.w,e)):S("ay",e.ay+r),kt(t,r);else{if(g)return;var i,a;if(v)i=y(v,t,"x",T,e);else{var s=e._xsize/T.w,l=e.x+(e._xshift-e.xshift)/T.w-s/2;i=f.align(l+t/T.w,s,0,1,e.xanchor)}if(x)a=y(x,r,"y",T,e);else{var c=e._ysize/T.h,u=e.y-(e._yshift+e.yshift)/T.h-c/2;a=f.align(u-r/T.h,c,0,1,e.yanchor)}S("x",i),S("y",a),(!v||!x)&&(n=f.getCursor(v?.5:i,x?.5:a,e.xanchor,e.yanchor))}z.attr({transform:o(t,r)+At}),p(R,n)},clickFn:function(r,n){e.captureevents&&t.emit("plotly_clickannotation",W(n))},doneFn:function(){p(R),n.call("_guiRelayout",t,E());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}}e.exports={draw:function(t){var e=t._fullLayout;e._infolayer.selectAll(".annotation").remove();for(var r=0;r0||r.explicitOff.length>0},onClick:function(t,e){var o,s,l=a(t,e),c=l.on,u=l.off.concat(l.explicitOff),h={},p=t._fullLayout.annotations;if(c.length||u.length){for(o=0;o1){c=!0;break}}c?t.fullLayout._infolayer.select(".annotation-"+t.id+'[data-index="'+s+'"]').remove():(l._pdata=n(t.glplot.cameraParams,[e.xaxis.r2l(l.x)*a[0],e.yaxis.r2l(l.y)*a[1],e.zaxis.r2l(l.z)*a[2]]),r(t.graphDiv,l,s,t.id,l._xa,l._ya))}}}}),Vi=f({"src/components/annotations3d/index.js"(t,e){var r=qt(),n=le();e.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:Fi()}}},layoutAttributes:Fi(),handleDefaults:Bi(),includeBasePlot:function(t,e){var i=r.subplotsRegistry.gl3d;if(i)for(var a=i.attrRegex,o=Object.keys(t),s=0;s0?p+c:c;return{ppad:c,ppadplus:u?d:m,ppadminus:u?m:d}}return{ppad:c}}function l(t,e,r){var n,o,s="x"===t._id.charAt(0)?"x":"y",l="category"===t.type||"multicategory"===t.type,c=0,u=0,h=l?t.r2c:t.d2c;if("scaled"===e[s+"sizemode"]?(n=e[s+"0"],o=e[s+"1"],l&&(c=e[s+"0shift"],u=e[s+"1shift"])):(n=e[s+"anchor"],o=e[s+"anchor"]),void 0!==n)return[h(n)+c,h(o)+u];if(e.path){var p,f,d,m,g=1/0,y=-1/0,v=e.path.match(i.segmentRE);for("date"===t.type&&(h=a.decodeDate(h)),p=0;py&&(y=m));if(y>=g)return[g,y]}}e.exports=function(t){var e,a=t._fullLayout,c=r.filterVisible(a.shapes);if(c.length&&t._fullData.length)for(var u=0;u0)&&(o("active"),o("direction"),o("type"),o("showactive"),o("x"),o("y"),r.noneOrAll(t,e,["x","y"]),o("xanchor"),o("yanchor"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),r.coerceFont(o,"font",a.font),o("bgcolor",a.paper_bgcolor),o("bordercolor"),o("borderwidth"))}function l(t,e){function n(n,i){return r.coerce(t,e,o,n,i)}n("visible","skip"===t.method||Array.isArray(t.args))&&(n("method"),n("args"),n("args2"),n("label"),n("execute"))}e.exports=function(t,e){n(t,e,{name:a,handleItemDefaults:s})}}}),ra=f({"src/components/updatemenus/scrollbox.js"(t,e){e.exports=o;var r=x(),n=H(),i=Qe(),a=le();function o(t,e,r){this.gd=t,this.container=e,this.id=r,this.position=null,this.translateX=null,this.translateY=null,this.hbar=null,this.vbar=null,this.bg=this.container.selectAll("rect.scrollbox-bg").data([0]),this.bg.exit().on(".drag",null).on("wheel",null).remove(),this.bg.enter().append("rect").classed("scrollbox-bg",!0).style("pointer-events","all").attr({opacity:0,x:0,y:0,width:0,height:0})}o.barWidth=2,o.barLength=20,o.barRadius=2,o.barPad=1,o.barColor="#808BA4",o.prototype.enable=function(t,e,a){var s=this.gd._fullLayout,l=s.width,c=s.height;this.position=t;var u,h,p,f,d=this.position.l,m=this.position.w,g=this.position.t,y=this.position.h,v=this.position.direction,x="down"===v,_="left"===v,b="up"===v,w=m,T=y;!x&&!_&&!("right"===v)&&!b&&(this.position.direction="down",x=!0),x||b?(h=(u=d)+w,x?(p=g,T=(f=Math.min(p+T,c))-p):T=(f=g+T)-(p=Math.max(f-T,0))):(f=(p=g)+T,_?w=(h=d+w)-(u=Math.max(h-w,0)):(u=d,w=(h=Math.min(u+w,l))-u)),this._box={l:u,t:p,w,h:T};var A=m>w,k=o.barLength+2*o.barPad,M=o.barWidth+2*o.barPad,S=d,E=g+y;E+M>c&&(E=c-M);var C=this.container.selectAll("rect.scrollbar-horizontal").data(A?[0]:[]);C.exit().on(".drag",null).remove(),C.enter().append("rect").classed("scrollbar-horizontal",!0).call(n.fill,o.barColor),A?(this.hbar=C.attr({rx:o.barRadius,ry:o.barRadius,x:S,y:E,width:k,height:M}),this._hbarXMin=S+k/2,this._hbarTranslateMax=w-k):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var I=y>T,L=o.barWidth+2*o.barPad,P=o.barLength+2*o.barPad,z=d+m,D=g;z+L>l&&(z=l-L);var O=this.container.selectAll("rect.scrollbar-vertical").data(I?[0]:[]);O.exit().on(".drag",null).remove(),O.enter().append("rect").classed("scrollbar-vertical",!0).call(n.fill,o.barColor),I?(this.vbar=O.attr({rx:o.barRadius,ry:o.barRadius,x:z,y:D,width:L,height:P}),this._vbarYMin=D+P/2,this._vbarTranslateMax=T-P):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var R=this.id,F=u-.5,B=I?h+L+.5:h+.5,j=p-.5,N=A?f+M+.5:f+.5,U=s._topdefs.selectAll("#"+R).data(A||I?[0]:[]);if(U.exit().remove(),U.enter().append("clipPath").attr("id",R).append("rect"),A||I?(this._clipRect=U.select("rect").attr({x:Math.floor(F),y:Math.floor(j),width:Math.ceil(B)-Math.floor(F),height:Math.ceil(N)-Math.floor(j)}),this.container.call(i.setClipUrl,R,this.gd),this.bg.attr({x:d,y:g,width:m,height:y})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),A||I){var V=r.behavior.drag().on("dragstart",(function(){r.event.sourceEvent.preventDefault()})).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(V);var q=r.behavior.drag().on("dragstart",(function(){r.event.sourceEvent.preventDefault(),r.event.sourceEvent.stopPropagation()})).on("drag",this._onBarDrag.bind(this));A&&this.hbar.on(".drag",null).call(q),I&&this.vbar.on(".drag",null).call(q)}this.setTranslate(e,a)},o.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},o.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=r.event.dx),this.vbar&&(e-=r.event.dy),this.setTranslate(t,e)},o.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=r.event.deltaY),this.vbar&&(e+=r.event.deltaY),this.setTranslate(t,e)},o.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var n=t+this._hbarXMin,i=n+this._hbarTranslateMax;t=(a.constrain(r.event.x,n,i)-n)/(i-n)*(this.position.w-this._box.w)}if(this.vbar){var o=e+this._vbarYMin,s=o+this._vbarTranslateMax;e=(a.constrain(r.event.y,o,s)-o)/(s-o)*(this.position.h-this._box.h)}this.setTranslate(t,e)},o.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=a.constrain(t||0,0,r),e=a.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(i.setTranslate,this._box.l-this.position.l-t,this._box.t-this.position.t-e),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+t-.5),y:Math.floor(this.position.t+e-.5)}),this.hbar){var o=t/r;this.hbar.call(i.setTranslate,t+o*this._hbarTranslateMax,e)}if(this.vbar){var s=e/n;this.vbar.call(i.setTranslate,t,e+s*this._vbarTranslateMax)}}}}),na=f({"src/components/updatemenus/draw.js"(t,e){var r=x(),n=Ae(),i=H(),a=Qe(),o=le(),s=Se(),l=ye().arrayEditor,c=Me().LINE_SPACING,u=Qi(),h=ra();function p(t){return t._index}function f(t,e){return+t.attr(u.menuIndexAttrName)===e._index}function d(t,e,r,n,i,a,o,s){e.active=o,l(t.layout,u.name,e).applyUpdate("active",o),"buttons"===e.type?g(t,n,null,null,e):"dropdown"===e.type&&(i.attr(u.menuIndexAttrName,"-1"),m(t,n,i,a,e),s||g(t,n,i,a,e))}function m(t,e,r,n,i){var s=o.ensureSingle(e,"g",u.headerClassName,(function(t){t.style("pointer-events","all")})),l=i._dims,c=i.active,h=i.buttons[c]||u.blankHeaderOpts,p={y:i.pad.t,yPad:0,x:i.pad.l,xPad:0,index:0},d={width:l.headerWidth,height:l.headerHeight};s.call(y,i,h,t).call(M,i,p,d),o.ensureSingle(e,"text",u.headerArrowClassName,(function(t){t.attr("text-anchor","end").call(a.font,i.font).text(u.arrowSymbol[i.direction])})).attr({x:l.headerWidth-u.arrowOffsetX+i.pad.l,y:l.headerHeight/2+u.textOffsetY+i.pad.t}),s.on("click",(function(){r.call(S,String(f(r,i)?-1:i._index)),g(t,e,r,n,i)})),s.on("mouseover",(function(){s.call(w)})),s.on("mouseout",(function(){s.call(T,i)})),a.setTranslate(e,l.lx,l.ly)}function g(t,e,i,a,s){i||(i=e).attr("pointer-events","all");var l=function(t){return-1==+t.attr(u.menuIndexAttrName)}(i)&&"buttons"!==s.type?[]:s.buttons,c="dropdown"===s.type?u.dropdownButtonClassName:u.buttonClassName,h=i.selectAll("g."+c).data(o.filterVisible(l)),p=h.enter().append("g").classed(c,!0),f=h.exit();"dropdown"===s.type?(p.attr("opacity","0").transition().attr("opacity","1"),f.transition().attr("opacity","0").remove()):f.remove();var m=0,g=0,v=s._dims,x=-1!==["up","down"].indexOf(s.direction);"dropdown"===s.type&&(x?g=v.headerHeight+u.gapButtonHeader:m=v.headerWidth+u.gapButtonHeader),"dropdown"===s.type&&"up"===s.direction&&(g=-u.gapButtonHeader+u.gapButton-v.openHeight),"dropdown"===s.type&&"left"===s.direction&&(m=-u.gapButtonHeader+u.gapButton-v.openWidth);var _={x:v.lx+m+s.pad.l,y:v.ly+g+s.pad.t,yPad:u.gapButton,xPad:u.gapButton,index:0},A={l:_.x+s.borderwidth,t:_.y+s.borderwidth};h.each((function(o,l){var c=r.select(this);c.call(y,s,o,t).call(M,s,_),c.on("click",(function(){r.event.defaultPrevented||(o.execute&&(o.args2&&s.active===l?(d(t,s,0,e,i,a,-1),n.executeAPICommand(t,o.method,o.args2)):(d(t,s,0,e,i,a,l),n.executeAPICommand(t,o.method,o.args))),t.emit("plotly_buttonclicked",{menu:s,button:o,active:s.active}))})),c.on("mouseover",(function(){c.call(w)})),c.on("mouseout",(function(){c.call(T,s),h.call(b,s)}))})),h.call(b,s),x?(A.w=Math.max(v.openWidth,v.headerWidth),A.h=_.y-A.t):(A.w=_.x-A.l,A.h=Math.max(v.openHeight,v.headerHeight)),A.direction=s.direction,a&&(h.size()?function(t,e,r,n,i,a){var o,s,l,c=i.direction,h="up"===c||"down"===c,p=i._dims,f=i.active;if(h)for(s=0,l=0;l0?[0]:[]);if(s.enter().append("g").classed(u.containerClassName,!0).style("cursor","pointer"),s.exit().each((function(){r.select(this).selectAll("g."+u.headerGroupClassName).each(a)})).remove(),0!==i.length){var l=s.selectAll("g."+u.headerGroupClassName).data(i,p);l.enter().append("g").classed(u.headerGroupClassName,!0);for(var c=o.ensureSingle(s,"g",u.dropdownButtonGroupClassName,(function(t){t.style("pointer-events","all")})),y=0;y0&&(l=l.transition().duration(e.transition.duration).ease(e.transition.easing)),l.attr("transform",s(o-.5*u.gripWidth,e._dims.currentValueTotalHeight))}}function E(t,e){var r=t._dims;return r.inputAreaStart+u.stepInset+(r.inputAreaLength-2*u.stepInset)*Math.min(1,Math.max(0,e))}function C(t,e){var r=t._dims;return Math.min(1,Math.max(0,(e-u.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*u.stepInset-2*r.inputAreaStart)))}function I(t,e,r){var n=r._dims,s=o.ensureSingle(t,"rect",u.railTouchRectClass,(function(n){n.call(k,e,t,r).style("pointer-events","all")}));s.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,u.tickOffset+r.ticklen+n.labelHeight)}).call(i.fill,r.bgcolor).attr("opacity",0),a.setTranslate(s,0,n.currentValueTotalHeight)}function L(t,e){var r=e._dims,n=r.inputAreaLength-2*u.railInset,s=o.ensureSingle(t,"rect",u.railRectClass);s.attr({width:n,height:u.railWidth,rx:u.railRadius,ry:u.railRadius,"shape-rendering":"crispEdges"}).call(i.stroke,e.bordercolor).call(i.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),a.setTranslate(s,u.railInset,.5*(r.inputAreaWidth-u.railWidth)+r.currentValueTotalHeight)}e.exports=function(t){var e=t._context.staticPlot,i=t._fullLayout,o=function(t,e){for(var r=t[u.name],n=[],i=0;i0?[0]:[]);function l(e){e._commandObserver&&(e._commandObserver.remove(),delete e._commandObserver),n.autoMargin(t,m(e))}if(s.enter().append("g").classed(u.containerClassName,!0).style("cursor",e?null:"ew-resize"),s.exit().each((function(){r.select(this).selectAll("g."+u.groupClassName).each(l)})).remove(),0!==o.length){var c=s.selectAll("g."+u.groupClassName).data(o,g);c.enter().append("g").classed(u.groupClassName,!0),c.exit().each(l).remove();for(var h=0;h0?t.touches[0].clientX:0}function g(t,e,r,n){var i=a.ensureSingle(t,"rect",d.bgClassName,(function(t){t.attr({x:0,y:0,"shape-rendering":"crispEdges"})})),c=n.borderwidth%2==0?n.borderwidth:n.borderwidth-1,u=-n._offsetShift,h=s.crispRound(e,n.borderwidth);i.attr({width:n._width+c,height:n._height+c,transform:o(u,u),"stroke-width":h}).call(l.stroke,n.bordercolor).call(l.fill,n.bgcolor)}function y(t,e,r,n){var i=e._fullLayout;a.ensureSingleById(i._topdefs,"clipPath",n._clipId,(function(t){t.append("rect").attr({x:0,y:0})})).select("rect").attr({width:n._width,height:n._height})}function v(t,e,n,o){var l,c=e.calcdata,p=t.selectAll("g."+d.rangePlotClassName).data(n._subplotsWith,a.identity);p.enter().append("g").attr("class",(function(t){return d.rangePlotClassName+" "+t})).call(s.setClipUrl,o._clipId,e),p.order(),p.exit().remove(),p.each((function(t,a){var s=r.select(this),p=0===a,f=h.getFromId(e,t,"y"),d=f._name,m=o[d],g={data:[],layout:{xaxis:{type:n.type,domain:[0,1],range:o.range.slice(),calendar:n.calendar},width:o._width,height:o._height,margin:{t:0,b:0,l:0,r:0}},_context:e._context};n.rangebreaks&&(g.layout.xaxis.rangebreaks=n.rangebreaks),g.layout[d]={type:f.type,domain:[0,1],range:"match"!==m.rangemode?m.range.slice():f.range.slice(),calendar:f.calendar},f.rangebreaks&&(g.layout[d].rangebreaks=f.rangebreaks),i.supplyDefaults(g);var y=g._fullLayout.xaxis,v=g._fullLayout[d];y.clearCalc(),y.setScale(),v.clearCalc(),v.setScale();var x={id:t,plotgroup:s,xaxis:y,yaxis:v,isRangePlot:!0};p?l=x:(x.mainplot="xy",x.mainplotinfo=l),u.rangePlot(e,x,function(t,e){for(var r=[],n=0;n=n.max)e=B[r+1];else if(t=n.pmax)e=B[r+1];else if(ti._length||v+b<0)return;u=y+b,p=v+b;break;case l:if(_="col-resize",y+b>i._length)return;u=y+b,p=v;break;case c:if(_="col-resize",v+b<0)return;u=y,p=v+b;break;default:_="ew-resize",u=g,p=g+b}if(p0)){var m=function(t,e,r){for(var n=r.filter((function(r){return e[r].anchor===t._id})),i=0,a=0;a1){p||f||d||"independent"===A("pattern")&&(p=!0),g._hasSubplotGrid=p;var x,_,b="top to bottom"===A("roworder"),w=p?.2:.1,T=p?.3:.1;m&&e._splomGridDflt&&(x=e._splomGridDflt.xside,_=e._splomGridDflt.yside),g._domains={x:c("x",A,w,x,v),y:c("y",A,T,_,y,b)}}else delete e.grid}function A(t,e){return r.coerce(n,g,s,t,e)}},contentDefaults:function(t,e){var r=e.grid;if(r&&r._domains){var n,i,a,o,s,c,h,p=t.grid||{},f=e._subplots,d=r._hasSubplotGrid,m=r.rows,g=r.columns,y="independent"===r.pattern,v=r._axisMap={};if(d){var x=p.subplots||[];c=r.subplots=new Array(m);var _=1;for(n=0;n0,h=t._context.staticPlot;e.each((function(e){var p,f=e[0].trace,d=f.error_x||{},m=f.error_y||{};f.ids&&(p=function(t){return t.id});var g=a.hasMarkers(f)&&f.marker.maxdisplayed>0;!m.visible&&!d.visible&&(e=[]);var y=r.select(this).selectAll("g.errorbar").data(e,p);if(y.exit().remove(),e.length){d.visible||y.selectAll("path.xerror").remove(),m.visible||y.selectAll("path.yerror").remove(),y.style("opacity",1);var v=y.enter().append("g").classed("errorbar",!0);u&&v.style("opacity",0).transition().duration(s.duration).style("opacity",1),i.setClipUrl(y,o.layerClipId,t),y.each((function(t){var e=r.select(this),i=function(t,e,r){var i={x:e.c2p(t.x),y:r.c2p(t.y)};return void 0!==t.yh&&(i.yh=r.c2p(t.yh),i.ys=r.c2p(t.ys),n(i.ys)||(i.noYS=!0,i.ys=r.c2p(t.ys,!0))),void 0!==t.xh&&(i.xh=e.c2p(t.xh),i.xs=e.c2p(t.xs),n(i.xs)||(i.noXS=!0,i.xs=e.c2p(t.xs,!0))),i}(t,l,c);if(!g||t.vis){var a,o=e.select("path.yerror");if(m.visible&&n(i.x)&&n(i.yh)&&n(i.ys)){var p=m.width;a="M"+(i.x-p)+","+i.yh+"h"+2*p+"m-"+p+",0V"+i.ys,i.noYS||(a+="m-"+p+",0h"+2*p),o.size()?u&&(o=o.transition().duration(s.duration).ease(s.easing)):o=e.append("path").style("vector-effect",h?"none":"non-scaling-stroke").classed("yerror",!0),o.attr("d",a)}else o.remove();var f=e.select("path.xerror");if(d.visible&&n(i.y)&&n(i.xh)&&n(i.xs)){var y=(d.copy_ystyle?m:d).width;a="M"+i.xh+","+(i.y-y)+"v"+2*y+"m0,-"+y+"H"+i.xs,i.noXS||(a+="m0,-"+y+"v"+2*y),f.size()?u&&(f=f.transition().duration(s.duration).ease(s.easing)):f=e.append("path").style("vector-effect",h?"none":"non-scaling-stroke").classed("xerror",!0),f.attr("d",a)}else f.remove()}}))}}))}}}),La=f({"src/components/errorbars/style.js"(t,e){var r=x(),n=H();e.exports=function(t){t.each((function(t){var e=t[0].trace,i=e.error_y||{},a=e.error_x||{},o=r.select(this);o.selectAll("path.yerror").style("stroke-width",i.thickness+"px").call(n.stroke,i.color),a.copy_ystyle&&(a=i),o.selectAll("path.xerror").style("stroke-width",a.thickness+"px").call(n.stroke,a.color)}))}}}),Pa=f({"src/components/errorbars/index.js"(t,e){var r=le(),n=Pt().overrideAll,i=Ma(),a={error_x:r.extendFlat({},i),error_y:r.extendFlat({},i)};delete a.error_x.copy_zstyle,delete a.error_y.copy_zstyle,delete a.error_y.copy_ystyle;var o={error_x:r.extendFlat({},i),error_y:r.extendFlat({},i),error_z:r.extendFlat({},i)};delete o.error_x.copy_ystyle,delete o.error_y.copy_ystyle,delete o.error_z.copy_ystyle,delete o.error_z.copy_zstyle,e.exports={moduleType:"component",name:"errorbars",schema:{traces:{scatter:a,bar:a,histogram:a,scatter3d:n(o,"calc","nested"),scattergl:n(a,"calc","nested")}},supplyDefaults:Sa(),calc:Ca(),makeComputeError:Ea(),plot:Ia(),style:La(),hoverInfo:function(t,e,r){(e.error_y||{}).visible&&(r.yerr=t.yh-t.y,e.error_y.symmetric||(r.yerrneg=t.y-t.ys)),(e.error_x||{}).visible&&(r.xerr=t.xh-t.x,e.error_x.symmetric||(r.xerrneg=t.x-t.xs))}}}}),za=f({"src/components/colorbar/constants.js"(t,e){e.exports={cn:{colorbar:"colorbar",cbbg:"cbbg",cbfill:"cbfill",cbfills:"cbfills",cbline:"cbline",cblines:"cblines",cbaxis:"cbaxis",cbtitleunshift:"cbtitleunshift",cbtitle:"cbtitle",cboutline:"cboutline",crisp:"crisp",jsPlaceholder:"js-placeholder"}}}}),Da=f({"src/components/colorbar/draw.js"(t,e){var r=x(),n=O(),i=Ae(),a=qt(),o=ir(),s=pr(),l=le(),c=l.strTranslate,u=R().extendFlat,h=fr(),p=Qe(),f=H(),d=tr(),m=Se(),g=Ee().flipScale,y=Ti(),v=Ai(),_=Ie(),b=Me(),w=b.LINE_SPACING,T=b.FROM_TL,A=b.FROM_BR,k=za().cn;e.exports={draw:function(t){var e=t._fullLayout._infolayer.selectAll("g."+k.colorbar).data(function(t){var e,r,n,i,a=t._fullLayout,o=t.calcdata,s=[];function l(t){return u(t,{_fillcolor:null,_line:{color:null,width:null,dash:null},_levels:{start:null,end:null,size:null},_filllevels:null,_fillgradient:null,_zrange:null})}function c(){"function"==typeof i.calc?i.calc(t,n,e):(e._fillgradient=r.reversescale?g(r.colorscale):r.colorscale,e._zrange=[r[i.min],r[i.max]])}for(var h=0;h0?n>=l:n<=l));i++)n>u&&n0?n>=l:n<=l));i++)n>r[0]&&n1){var ft=Math.pow(10,Math.floor(Math.log(pt)/Math.LN10));ut*=ft*l.roundUp(pt/ft,[2,5,10]),(Math.abs(W.start)/W.size+1e-6)%1<2e-6&&(lt.tick0=0)}lt.dtick=ut}lt.domain=s?[ot+P/B.h,ot+Q-P/B.h]:[ot+L/B.w,ot+Q-L/B.w],lt.setScale(),t.attr("transform",c(Math.round(B.l),Math.round(B.t)));var dt,mt=t.select("."+k.cbtitleunshift).attr("transform",c(-Math.round(B.l),-Math.round(B.t))),gt=lt.ticklabelposition,yt=lt.title.font.size,vt=t.select("."+k.cbaxis),xt=0,_t=0;function bt(r,n){var i={propContainer:lt,propName:e._propPrefix+"title",traceIndex:e._traceIndex,_meta:e._meta,placeholder:F._dfltTitle.colorbar,containerGroup:t.select("."+k.cbtitle)},o="h"===r.charAt(0)?r.substr(1):"h"+r;t.selectAll("."+o+",."+o+"-math-group").remove(),d.draw(a,r,u(i,n||{}))}return l.syncOrAsync([i.previousPromises,function(){var t,e;(s&&ct||!s&&!ct)&&("top"===V&&(t=L+B.l+tt*z,e=P+B.t+et*(1-ot-Q)+3+.75*yt),"bottom"===V&&(t=L+B.l+tt*z,e=P+B.t+et*(1-ot)-3-.25*yt),"right"===V&&(e=P+B.t+et*D+3+.75*yt,t=L+B.l+tt*ot),bt(lt._id+"title",{attributes:{x:t,y:e,"text-anchor":s?"start":"middle"}}))},function(){if(!s&&!ct||s&&ct){var i,u=t.select("."+k.cbtitle),h=u.select("text"),f=[-M/2,M/2],d=u.select(".h"+lt._id+"title-math-group").node(),g=15.6;if(h.node()&&(g=parseInt(h.node().style.fontSize,10)*w),d?(i=p.bBox(d),_t=i.width,(xt=i.height)>g&&(f[1]-=(xt-g)/2)):h.node()&&!h.classed(k.jsPlaceholder)&&(i=p.bBox(h.node()),_t=i.width,xt=i.height),s){if(xt){if(xt+=5,"top"===V)lt.domain[1]-=xt/B.h,f[1]*=-1;else{lt.domain[0]+=xt/B.h;var y=m.lineCount(h);f[1]+=(1-y)*g}u.attr("transform",c(f[0],f[1])),lt.setScale()}}else _t&&("right"===V&&(lt.domain[0]+=(_t+yt/2)/B.w),u.attr("transform",c(f[0],f[1])),lt.setScale())}t.selectAll("."+k.cbfills+",."+k.cblines).attr("transform",s?c(0,Math.round(B.h*(1-lt.domain[1]))):c(Math.round(B.w*lt.domain[0]),0)),vt.attr("transform",s?c(0,Math.round(-B.t)):c(Math.round(-B.l),0));var v=t.select("."+k.cbfills).selectAll("rect."+k.cbfill).attr("style","").data(Y);v.enter().append("rect").classed(k.cbfill,!0).attr("style",""),v.exit().remove();var x=q.map(lt.c2p).map(Math.round).sort((function(t,e){return t-e}));v.each((function(t,i){var o=[0===i?q[0]:(Y[i]+Y[i-1])/2,i===Y.length-1?q[1]:(Y[i]+Y[i+1])/2].map(lt.c2p).map(Math.round);s&&(o[1]=l.constrain(o[1]+(o[1]>o[0])?1:-1,x[0],x[1]));var c=r.select(this).attr(s?"x":"y",rt).attr(s?"y":"x",r.min(o)).attr(s?"width":"height",Math.max($,2)).attr(s?"height":"width",Math.max(r.max(o)-r.min(o),2));if(e._fillgradient)p.gradient(c,a,e._id,s?"vertical":"horizontalreversed",e._fillgradient,"fill");else{var u=G(t).replace("e-","");c.attr("fill",n(u).toHexString())}}));var _=t.select("."+k.cblines).selectAll("path."+k.cbline).data(N.color&&N.width?X:[]);_.enter().append("path").classed(k.cbline,!0),_.exit().remove(),_.each((function(t){var e=rt,n=Math.round(lt.c2p(t))+N.width/2%1;r.select(this).attr("d","M"+(s?e+","+n:n+","+e)+(s?"h":"v")+$).call(p.lineGroupStyle,N.width,H(t),N.dash)})),vt.selectAll("g."+lt._id+"tick,path").remove();var b=rt+$+(M||0)/2-("outside"===e.ticks?1:0),T=o.calcTicks(lt),A=o.getTickSigns(lt)[2];return o.drawTicks(a,lt,{vals:"inside"===lt.ticks?o.clipEnds(lt,T):T,layer:vt,path:o.makeTickPath(lt,b,A),transFn:o.makeTransTickFn(lt)}),o.drawLabels(a,lt,{vals:T,layer:vt,transFn:o.makeTransTickLabelFn(lt),labelFns:o.makeLabelFns(lt,b)})},function(){if(s&&!ct||!s&&ct){var t,n,i=lt.position||0,o=lt._offset+lt._length/2;if("right"===V)n=o,t=B.l+tt*i+10+yt*(lt.showticklabels?1:.5);else if(t=o,"bottom"===V&&(n=B.t+et*i+10+(-1===gt.indexOf("inside")?lt.tickfont.size:0)+("intside"!==lt.ticks&&e.ticklen||0)),"top"===V){var l=U.text.split("
").length;n=B.t+et*i+10-$-w*yt*l}bt((s?"h":"v")+lt._id+"title",{avoid:{selection:r.select(a).selectAll("g."+lt._id+"tick"),side:V,offsetTop:s?0:B.t,offsetLeft:s?B.l:0,maxShift:s?F.width:F.height},attributes:{x:t,y:n,"text-anchor":"middle"},transform:{rotate:s?-90:0,offset:0}})}},i.previousPromises,function(){var r,o=$+M/2;-1===gt.indexOf("inside")&&(r=p.bBox(vt.node()),o+=s?r.width:r.height),dt=mt.select("text");var l=0,u=s&&"top"===V,d=!s&&"right"===V,m=0;if(dt.node()&&!dt.classed(k.jsPlaceholder)){var y,v=mt.select(".h"+lt._id+"title-math-group").node();v&&(s&&ct||!s&&!ct)?(l=(r=p.bBox(v)).width,y=r.height):(l=(r=p.bBox(mt.node())).right-B.l-(s?rt:st),y=r.bottom-B.t-(s?st:rt),!s&&"top"===V&&(o+=r.height,m=r.height)),d&&(dt.attr("transform",c(l/2+yt/2,0)),l*=2),o=Math.max(o,s?l:y)}var _=2*(s?L:P)+o+S+M/2,w=0;!s&&U.text&&"bottom"===I&&D<=0&&(_+=w=_/2,m+=w),F._hColorbarMoveTitle=w,F._hColorbarMoveCBTitle=m;var j=S+M,N=(s?rt:st)-j/2-(s?L:0),q=(s?st:rt)-(s?J:P+m-w);t.select("."+k.cbbg).attr("x",N).attr("y",q).attr(s?"width":"height",Math.max(_-w,2)).attr(s?"height":"width",Math.max(J+j,2)).call(f.fill,E).call(f.stroke,e.bordercolor).style("stroke-width",S);var H=d?Math.max(l-10,0):0;t.selectAll("."+k.cboutline).attr("x",(s?rt:st+L)+H).attr("y",(s?st+P-J:rt)+(u?xt:0)).attr(s?"width":"height",Math.max($,2)).attr(s?"height":"width",Math.max(J-(s?2*P+xt:2*L+H),2)).call(f.stroke,e.outlinecolor).style({fill:"none","stroke-width":M});var G=s?nt*_:0,W=s?0:(1-it)*_-m;if(G=R?B.l-G:-G,W=O?B.t-W:-W,t.attr("transform",c(G,W)),!s&&(S||n(E).getAlpha()&&!n.equals(F.paper_bgcolor,E))){var Z=vt.selectAll("text"),Y=Z[0].length,X=t.select("."+k.cbbg).node(),K=p.bBox(X),Q=p.getTranslate(t);Z.each((function(t,e){var r=Y-1;if(0===e||e===r){var n,i=p.bBox(this),a=p.getTranslate(this);if(e===r){var o=i.right+a.x;(n=K.right+Q.x+st-S-2+z-o)>0&&(n=0)}else if(0===e){var s=i.left+a.x;(n=K.left+Q.x+st+S+2-s)<0&&(n=0)}n&&(Y<3?this.setAttribute("transform","translate("+n+",0) "+this.getAttribute("transform")):this.setAttribute("visibility","hidden"))}}))}var tt={},et=T[C],at=A[C],ot=T[I],ut=A[I],ht=_-$;s?("pixels"===g?(tt.y=D,tt.t=J*ot,tt.b=J*ut):(tt.t=tt.b=0,tt.yt=D+h*ot,tt.yb=D-h*ut),"pixels"===b?(tt.x=z,tt.l=_*et,tt.r=_*at):(tt.l=ht*et,tt.r=ht*at,tt.xl=z-x*et,tt.xr=z+x*at)):("pixels"===g?(tt.x=z,tt.l=J*et,tt.r=J*at):(tt.l=tt.r=0,tt.xl=z+h*et,tt.xr=z-h*at),"pixels"===b?(tt.y=1-D,tt.t=_*ot,tt.b=_*ut):(tt.t=ht*ot,tt.b=ht*ut,tt.yt=D-x*ot,tt.yb=D+x*ut));var pt=e.y<.5?"b":"t",ft=e.x<.5?"l":"r";a._fullLayout._reservedMargin[e._id]={};var _t={r:F.width-N-G,l:N+tt.r,b:F.height-q-W,t:q+tt.b};R&&O?i.autoMargin(a,e._id,tt):R?a._fullLayout._reservedMargin[e._id][pt]=_t[pt]:O||s?a._fullLayout._reservedMargin[e._id][ft]=_t[ft]:a._fullLayout._reservedMargin[e._id][pt]=_t[pt]}],a)}(g,e,t);x&&x.then&&(t._promises||[]).push(x),t._context.edits.colorbarPosition&&function(t,e,r){var n,i,o,l="v"===e.orientation,u=r._fullLayout._size;s.init({element:t.node(),gd:r,prepFn:function(){n=t.attr("transform"),h(t)},moveFn:function(r,a){t.attr("transform",n+c(r,a)),i=s.align((l?e._uFrac:e._vFrac)+r/u.w,l?e._thickFrac:e._lenFrac,0,1,e.xanchor),o=s.align((l?e._vFrac:1-e._uFrac)-a/u.h,l?e._lenFrac:e._thickFrac,0,1,e.yanchor);var p=s.getCursor(i,o,e.xanchor,e.yanchor);h(t,p)},doneFn:function(){if(h(t),void 0!==i&&void 0!==o){var n={};n[e._propPrefix+"x"]=i,n[e._propPrefix+"y"]=o,void 0!==e._traceIndex?a.call("_guiRestyle",r,n,e._traceIndex):a.call("_guiRelayout",r,n)}}})}(g,e,t)})),e.exit().each((function(e){i.autoMargin(t,e._id)})).remove(),e.order()}}}}),Oa=f({"src/components/colorbar/index.js"(t,e){e.exports={moduleType:"component",name:"colorbar",attributes:Le(),supplyDefaults:Ve(),draw:Da().draw,hasColorbar:De()}}}),Ra=f({"src/components/legend/index.js"(t,e){e.exports={moduleType:"component",name:"legend",layoutAttributes:mr(),supplyLayoutDefaults:yr(),draw:kr(),style:Ar()}}}),Fa=f({"src/locale-en.js"(t,e){e.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}}}),Ba=f({"src/locale-en-us.js"(t,e){e.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}}}),ja=f({"src/snapshot/cloneplot.js"(t,e){var r=qt(),n=le(),i=n.extendFlat,a=n.extendDeep;function o(t){var e;switch(t){case"themes__thumb":e={autosize:!0,width:150,height:150,title:{text:""},showlegend:!1,margin:{l:5,r:5,t:5,b:5,pad:0},annotations:[]};break;case"thumbnail":e={title:{text:""},hidesources:!0,showlegend:!1,borderwidth:0,bordercolor:"",margin:{l:1,r:1,t:1,b:1,pad:0},annotations:[]};break;default:e={}}return e}e.exports=function(t,e){var n,s,l=t.data,c=t.layout,u=a([],l),h=a({},c,o(e.tileClass)),p=t._context||{};if(e.width&&(h.width=e.width),e.height&&(h.height=e.height),"thumbnail"===e.tileClass||"themes__thumb"===e.tileClass){h.annotations=[];var f=Object.keys(h);for(n=0;n-1&&(h[f[n]].title={text:""});for(n=0;n=0)return t}else if("string"==typeof t&&"%"===(t=t.trim()).slice(-1)&&r(t.slice(0,-1))&&(t=+t.slice(0,-1))>=0)return t+"%"}function f(t,e,r,i,a,o){var s=!1!==(o=o||{}).moduleHasSelected,l=!1!==o.moduleHasUnselected,c=!1!==o.moduleHasConstrain,u=!1!==o.moduleHasCliponaxis,p=!1!==o.moduleHasTextangle,f=!1!==o.moduleHasInsideanchor,d=!!o.hasPathbar,m=Array.isArray(a)||"auto"===a,g=m||"inside"===a,y=m||"outside"===a;if(g||y){var v=h(i,"textfont",r.font),x=n.extendFlat({},v),_=!(t.textfont&&t.textfont.color);if(_&&delete x.color,h(i,"insidetextfont",x),d){var b=n.extendFlat({},v);_&&delete b.color,h(i,"pathbar.textfont",b)}y&&h(i,"outsidetextfont",v),s&&i("selected.textfont.color"),l&&i("unselected.textfont.color"),c&&i("constraintext"),u&&i("cliponaxis"),p&&i("textangle"),i("texttemplate")}g&&f&&i("insidetextanchor")}e.exports={supplyDefaults:function(t,e,r,c){function h(r,i){return n.coerce(t,e,u,r,i)}if(o(t,e,c,h)){s(t,e,c,h),h("xhoverformat"),h("yhoverformat"),h("zorder"),h("orientation",e.x&&!e.y?"h":"v"),h("base"),h("offset"),h("width"),h("text"),h("hovertext"),h("hovertemplate");var p=h("textposition");f(t,0,c,h,p,{moduleHasSelected:!0,moduleHasUnselected:!0,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),l(t,e,h,r,c);var d=(e.marker.line||{}).color,m=a.getComponentMethod("errorbars","supplyDefaults");m(t,e,d||i.defaultLine,{axis:"y"}),m(t,e,d||i.defaultLine,{axis:"x",inherit:"y"}),n.coerceSelectionMarkerOpacity(e,h)}else e.visible=!1},crossTraceDefaults:function(t,e){var r,i;function a(t,e){return n.coerce(i._input,i,u,t,e)}for(var o=0;o0&&!p[y]&&(h=!0),p[y]=!0),g.visible&&"histogram"===g.type&&"category"!==n.getFromId({_fullLayout:e},g["v"===g.orientation?"xaxis":"yaxis"]).type&&(u=!0)}}if(c){"overlay"!==f&&l("barnorm"),l("bargap",u&&!h?0:.2),l("bargroupgap");var v=l("barcornerradius");e.barcornerradius=o(v)}else delete e.barmode}}}),$a=f({"src/traces/bar/arrays_to_calcdata.js"(t,e){var r=le();e.exports=function(t,e){for(var n=0;na))return r}return void 0!==n?n:t.dflt},t.coerceColor=function(t,e,n){return r(e).isValid()?e:void 0!==n?n:t.dflt},t.coerceEnumerated=function(t,e,r){return t.coerceNumber&&(e=+e),-1!==t.values.indexOf(e)?e:void 0!==r?r:t.dflt},t.getValue=function(t,e){var r;return n(t)?e1||0===i.bargap&&0===i.bargroupgap&&!t[0].trace.marker.line.width)&&r.select(this).attr("shape-rendering","crispEdges")})),e.selectAll("g.points").each((function(e){f(r.select(this),e[0].trace,t)})),o.getComponentMethod("errorbars","style")(e)},styleTextPoints:d,styleOnSelect:function(t,e,n){var s=e[0].trace;s.selectedpoints?function(t,e,n){i.selectedPointStyle(t.selectAll("path"),e),function(t,e,n){t.each((function(t){var o,s=r.select(this);if(t.selected){o=a.ensureUniformFontSize(n,m(s,t,e,n));var l=e.selected.textfont&&e.selected.textfont.color;l&&(o.color=l),i.font(s,o)}else i.selectedTextStyle(s,e)}))}(t.selectAll("text"),e,n)}(n,s,t):(f(n,s,t),o.getComponentMethod("errorbars","style")(n))},getInsideTextFont:y,getOutsideTextFont:v,getBarColor:b,resizeText:s}}}),eo=f({"src/traces/bar/plot.js"(t,e){var r=x(),n=A(),i=le(),a=Se(),o=H(),s=Qe(),l=qt(),c=ir().tickText,u=Ja(),h=u.recordMinTextSize,p=u.clearMinTextSize,f=to(),d=Qa(),m=Ha(),g=Ga(),y=g.text,v=g.textposition,_=$e().appendArrayPointValue,b=m.TEXTPAD;function w(t){return t.id}function T(t){return(t>0)-(t<0)}function k(t,e){return t0}function E(t,e,r,n,i){return!(t<0||e<0)&&(r<=t&&n<=e||r<=e&&n<=t||(i?t>=r*(e/n):e>=n*(t/r)))}function C(t){return"auto"===t?0:t}function I(t,e){var r=Math.PI/180*e,n=Math.abs(Math.sin(r)),i=Math.abs(Math.cos(r));return{x:t.width*i+t.height*n,y:t.width*n+t.height*i}}function L(t,e,r,n,i,a){var o=!!a.isHorizontal,s=!!a.constrained,l=a.angle||0,c=a.anchor,u="end"===c,h="start"===c,p=((a.leftToRight||0)+1)/2,f=1-p,d=a.hasB,m=a.r,g=a.overhead,y=i.width,v=i.height,x=Math.abs(e-t),_=Math.abs(n-r),w=x>2*b&&_>2*b?b:0;x-=2*w,_-=2*w;var T=C(l);"auto"===l&&!(y<=x&&v<=_)&&(y>x||v>_)&&(!(y>_||v>x)||yb){var E=function(t,e,r,n,i,a,o,s,l){var c,u,h,p,f=Math.max(0,Math.abs(e-t)-2*b),d=Math.max(0,Math.abs(n-r)-2*b),m=a-b,g=o?m-Math.sqrt(m*m-(m-o)*(m-o)):m,y=l?2*m:s?m-o:2*g,v=l?2*m:s?2*g:m-o;return i.y/i.x>=d/(f-y)?p=d/i.y:i.y/i.x<=(d-v)/f?p=f/i.x:!l&&s?(c=i.x*i.x+i.y*i.y/4,h=(f-m)*(f-m)+(d/2-m)*(d/2-m)-m*m,p=(-(u=-2*i.x*(f-m)-i.y*(d/2-m))+Math.sqrt(u*u-4*c*h))/(2*c)):l?(c=(i.x*i.x+i.y*i.y)/4,h=(f/2-m)*(f/2-m)+(d/2-m)*(d/2-m)-m*m,p=(-(u=-i.x*(f/2-m)-i.y*(d/2-m))+Math.sqrt(u*u-4*c*h))/(2*c)):(c=i.x*i.x/4+i.y*i.y,h=(f/2-m)*(f/2-m)+(d-m)*(d-m)-m*m,p=(-(u=-i.x*(f/2-m)-2*i.y*(d-m))+Math.sqrt(u*u-4*c*h))/(2*c)),{scale:p=Math.min(1,p),pad:s?Math.max(0,m-Math.sqrt(Math.max(0,m*m-(m-(d-i.y*p)/2)*(m-(d-i.y*p)/2)))-o):Math.max(0,m-Math.sqrt(Math.max(0,m*m-(m-(f-i.x*p)/2)*(m-(f-i.x*p)/2)))-o)}}(t,e,r,n,S,m,g,o,d);A=E.scale,M=E.pad}else A=1,s&&(A=Math.min(1,x/S.x,_/S.y)),M=0;var L=i.left*f+i.right*p,P=(i.top+i.bottom)/2,z=(t+b)*f+(e-b)*p,D=(r+n)/2,O=0,R=0;if(h||u){var F=(o?S.x:S.y)/2;m&&(u||d)&&(w+=M);var B=o?k(t,e):k(r,n);o?h?(z=t+B*w,O=-B*F):(z=e-B*w,O=B*F):h?(D=r+B*w,R=-B*F):(D=n-B*w,R=B*F)}return{textX:L,textY:P,targetX:z,targetY:D,anchorX:O,anchorY:R,scale:A,rotate:T}}e.exports={plot:function(t,e,u,m,g,x){var A=e.xaxis,P=e.yaxis,z=t._fullLayout,D=t._context.staticPlot;g||(g={mode:z.barmode,norm:z.barmode,gap:z.bargap,groupgap:z.bargroupgap},p("bar",z));var O=i.makeTraceGroups(m,u,"trace bars").each((function(l){var u=r.select(this),p=l[0].trace,m=l[0].t,O="waterfall"===p.type,R="funnel"===p.type,F="histogram"===p.type,B="bar"===p.type,j=B||R,N=0;O&&p.connector.visible&&"between"===p.connector.mode&&(N=p.connector.line.width/2);var U="h"===p.orientation,V=S(g),q=i.ensureSingle(u,"g","points"),H=function(t){if(t.ids)return w}(p),G=q.selectAll("g.point").data(i.identity,H);G.enter().append("g").classed("point",!0),G.exit().remove(),G.each((function(u,w){var S,O,R=r.select(this),q=function(t,e,r,n){var i=[],a=[],o=n?e:r,s=n?r:e;return i[0]=o.c2p(t.s0,!0),a[0]=s.c2p(t.p0,!0),i[1]=o.c2p(t.s1,!0),a[1]=s.c2p(t.p1,!0),n?[i,a]:[a,i]}(u,A,P,U),H=q[0][0],G=q[0][1],W=q[1][0],Z=q[1][1],Y=0==(U?G-H:Z-W);if(Y&&j&&d.getLineWidth(p,u)&&(Y=!1),Y||(Y=!(n(H)&&n(G)&&n(W)&&n(Z))),u.isBlank=Y,Y&&(U?G=H:Z=W),N&&!Y&&(U?(H-=k(H,G)*N,G+=k(H,G)*N):(W-=k(W,Z)*N,Z+=k(W,Z)*N)),"waterfall"===p.type){if(!Y){var X=p[u.dir].marker;S=X.line.width,O=X.color}}else S=d.getLineWidth(p,u),O=u.mc||p.marker.color;function $(t){var e=r.round(S/2%1,2);return 0===g.gap&&0===g.groupgap?r.round(Math.round(t)-e,2):t}var K=o.opacity(O)<1||S>.01?$:function(t,e,r){return r&&t===e?t:Math.abs(t-e)>=2?$(t):t>e?Math.ceil(t):Math.floor(t)};t._context.staticPlot||(H=K(H,G,U),G=K(G,H,U),W=K(W,Z,!U),Z=K(Z,W,!U));var J,Q=U?A.c2p:P.c2p;J=u.s0>0?u._sMax:u.s0<0?u._sMin:u.s1>0?u._sMax:u._sMin;var tt,et,rt=B||F?function(t,e){if(!t)return 0;var r,n=Math.abs(U?Z-W:G-H),i=Math.abs(U?G-H:Z-W),a=K(Math.abs(Q(J,!0)-Q(0,!0))),o=u.hasB?Math.min(n/2,i/2):Math.min(n/2,a);return r="%"===e?n*(Math.min(50,t)/100):t,K(Math.max(Math.min(r,o),0))}(m.cornerradiusvalue,m.cornerradiusform):0,nt="M"+H+","+W+"V"+Z+"H"+G+"V"+W+"Z",it=0;if(rt&&u.s){var at=0===T(u.s0)||T(u.s)===T(u.s0)?u.s1:u.s0;if((it=K(u.hasB?0:Math.abs(Q(J,!0)-Q(at,!0))))0?Math.sqrt(it*(2*rt-it)):0,ht=ot>0?Math.max:Math.min;tt="M"+H+","+W+"V"+(Z-ct*st)+"H"+ht(G-(rt-it)*ot,H)+"A "+rt+","+rt+" 0 0 "+lt+" "+G+","+(Z-rt*st-ut)+"V"+(W+rt*st+ut)+"A "+rt+","+rt+" 0 0 "+lt+" "+ht(G-(rt-it)*ot,H)+","+(W+ct*st)+"Z"}else if(u.hasB)tt="M"+(H+rt*ot)+","+W+"A "+rt+","+rt+" 0 0 "+lt+" "+H+","+(W+rt*st)+"V"+(Z-rt*st)+"A "+rt+","+rt+" 0 0 "+lt+" "+(H+rt*ot)+","+Z+"H"+(G-rt*ot)+"A "+rt+","+rt+" 0 0 "+lt+" "+G+","+(Z-rt*st)+"V"+(W+rt*st)+"A "+rt+","+rt+" 0 0 "+lt+" "+(G-rt*ot)+","+W+"Z";else{var pt=(et=Math.abs(Z-W)+it)0?Math.sqrt(it*(2*rt-it)):0,dt=st>0?Math.max:Math.min;tt="M"+(H+pt*ot)+","+W+"V"+dt(Z-(rt-it)*st,W)+"A "+rt+","+rt+" 0 0 "+lt+" "+(H+rt*ot-ft)+","+Z+"H"+(G-rt*ot+ft)+"A "+rt+","+rt+" 0 0 "+lt+" "+(G-pt*ot)+","+dt(Z-(rt-it)*st,W)+"V"+W+"Z"}}else tt=nt}else tt=nt;var mt=M(i.ensureSingle(R,"path"),z,g,x);if(mt.style("vector-effect",D?"none":"non-scaling-stroke").attr("d",isNaN((G-H)*(Z-W))||Y&&t._context.staticPlot?"M0,0Z":tt).call(s.setClipUrl,e.layerClipId,t),!z.uniformtext.mode&&V){var gt=s.makePointStyleFns(p);s.singlePointStyle(u,mt,p,gt,t)}(function(t,e,r,n,o,l,u,p,m,g,x,w,T){var A,S=e.xaxis,P=e.yaxis,z=t._fullLayout;function D(e,r,n){return i.ensureSingle(e,"text").text(r).attr({class:"bartext bartext-"+A,"text-anchor":"middle","data-notex":1}).call(s.font,n).call(a.convertToTspans,t)}var O=n[0].trace,R="h"===O.orientation,F=function(t,e,r,n,a){var o,s=e[0].trace;return o=s.texttemplate?function(t,e,r,n,a){var o=e[0].trace,s=i.castOption(o,r,"texttemplate");if(!s)return"";var l,u,h,p,f="histogram"===o.type,d="waterfall"===o.type,m="funnel"===o.type,g="h"===o.orientation;function y(t){return c(p,p.c2l(t),!0).text}g?(l="y",u=a,h="x",p=n):(l="x",u=n,h="y",p=a);var v=e[r],x={};x.label=v.p,x.labelLabel=x[l+"Label"]=function(t){return c(u,u.c2l(t),!0).text}(v.p);var b=i.castOption(o,v.i,"text");(0===b||b)&&(x.text=b),x.value=v.s,x.valueLabel=x[h+"Label"]=y(v.s);var w={};_(w,o,v.i),(f||void 0===w.x)&&(w.x=g?x.value:x.label),(f||void 0===w.y)&&(w.y=g?x.label:x.value),(f||void 0===w.xLabel)&&(w.xLabel=g?x.valueLabel:x.labelLabel),(f||void 0===w.yLabel)&&(w.yLabel=g?x.labelLabel:x.valueLabel),d&&(x.delta=+v.rawS||v.s,x.deltaLabel=y(x.delta),x.final=v.v,x.finalLabel=y(x.final),x.initial=x.final-x.delta,x.initialLabel=y(x.initial)),m&&(x.value=v.s,x.valueLabel=y(x.value),x.percentInitial=v.begR,x.percentInitialLabel=i.formatPercent(v.begR),x.percentPrevious=v.difR,x.percentPreviousLabel=i.formatPercent(v.difR),x.percentTotal=v.sumR,x.percenTotalLabel=i.formatPercent(v.sumR));var T=i.castOption(o,v.i,"customdata");return T&&(x.customdata=T),i.texttemplateString(s,x,t._d3locale,w,x,o._meta||{})}(t,e,r,n,a):s.textinfo?function(t,e,r,n){var a=t[0].trace,o="h"===a.orientation,s="waterfall"===a.type,l="funnel"===a.type;function u(t){return c(o?r:n,+t,!0).text}var h,p=a.textinfo,f=t[e],d=p.split("+"),m=[],g=function(t){return-1!==d.indexOf(t)};if(g("label")&&m.push(function(t){return c(o?n:r,t,!0).text}(t[e].p)),g("text")&&(0===(h=i.castOption(a,f.i,"text"))||h)&&m.push(h),s){var y=+f.rawS||f.s,v=f.v,x=v-y;g("initial")&&m.push(u(x)),g("delta")&&m.push(u(y)),g("final")&&m.push(u(v))}if(l){g("value")&&m.push(u(f.s));var _=0;g("percent initial")&&_++,g("percent previous")&&_++,g("percent total")&&_++;var b=_>1;g("percent initial")&&(h=i.formatPercent(f.begR),b&&(h+=" of initial"),m.push(h)),g("percent previous")&&(h=i.formatPercent(f.difR),b&&(h+=" of previous"),m.push(h)),g("percent total")&&(h=i.formatPercent(f.sumR),b&&(h+=" of total"),m.push(h))}return m.join("
")}(e,r,n,a):d.getValue(s.text,r),d.coerceString(y,o)}(z,n,o,S,P);A=function(t,e){var r=d.getValue(t.textposition,e);return d.coerceEnumerated(v,r)}(O,o);var B="stack"===w.mode||"relative"===w.mode,j=n[o],N=!B||j._outmost,U=j.hasB,V=g&&g-x>b;if(F&&"none"!==A&&(!j.isBlank&&l!==u&&p!==m||"auto"!==A&&"inside"!==A)){var q=z.font,H=f.getBarColor(n[o],O),G=f.getInsideTextFont(O,o,q,H),W=f.getOutsideTextFont(O,o,q),Z=O.insidetextanchor||"end",Y=r.datum();R?"log"===S.type&&Y.s0<=0&&(l=S.range[0]0&&J>0;it=V?U?E(rt-2*g,nt,K,J,R)||E(rt,nt-2*g,K,J,R):R?E(rt-(g-x),nt,K,J,R)||E(rt,nt-2*(g-x),K,J,R):E(rt,nt-(g-x),K,J,R)||E(rt-2*(g-x),nt,K,J,R):E(rt,nt,K,J,R),at&&it?A="inside":(A="outside",X.remove(),X=null)}else A="inside";if(!X){var ot=(X=D(r,F,Q=i.ensureUniformFontSize(t,"outside"===A?W:G))).attr("transform");if(X.attr("transform",""),K=($=s.bBox(X.node())).width,J=$.height,X.attr("transform",ot),K<=0||J<=0)return void X.remove()}var st,lt=O.textangle;"outside"===A?st=function(t,e,r,n,i,a){var o,s=!!a.isHorizontal,l=!!a.constrained,c=a.angle||0,u=i.width,h=i.height,p=Math.abs(e-t),f=Math.abs(n-r);o=s?f>2*b?b:0:p>2*b?b:0;var d=1;l&&(d=s?Math.min(1,f/h):Math.min(1,p/u));var m=C(c),g=I(i,m),y=(s?g.x:g.y)/2,v=(i.left+i.right)/2,x=(i.top+i.bottom)/2,_=(t+e)/2,w=(r+n)/2,T=0,A=0,M=s?k(e,t):k(r,n);return s?(_=e-M*o,T=M*y):(w=n+M*o,A=-M*y),{textX:v,textY:x,targetX:_,targetY:w,anchorX:T,anchorY:A,scale:d,rotate:m}}(l,u,p,m,$,{isHorizontal:R,constrained:"both"===O.constraintext||"outside"===O.constraintext,angle:lt}):st=L(l,u,p,m,$,{isHorizontal:R,constrained:"both"===O.constraintext||"inside"===O.constraintext,angle:lt,anchor:Z,hasB:U,r:g,overhead:x}),st.fontSize=Q.size,h("histogram"===O.type?"bar":O.type,st,z),j.transform=st;var ct=M(X,z,w,T);i.setTransormAndDisplay(ct,st)}else r.select("text").remove()})(t,e,R,l,w,H,G,W,Z,rt,it,g,x),e.layerClipId&&s.hideOutsideRangePoint(u,R.select("text"),A,P,p.xcalendar,p.ycalendar)}));var W=!1===p.cliponaxis;s.setClipUrl(u,W?null:e.layerClipId,t)}));l.getComponentMethod("errorbars","plot")(t,O,e,g)},toMoveInsideBar:L}}}),ro=f({"src/traces/bar/hover.js"(t,e){var r=Dr(),n=qt(),i=H(),a=le().fillText,o=Qa().getLineWidth,s=ir().hoverLabelText,l=k().BADNUM;function c(t,e,n,i,o){var c,u,h,p,f,d,m,g=t.cd,y=g[0].trace,v=g[0].t,x="closest"===i,_="waterfall"===y.type,b=t.maxHoverDistance,w=t.maxSpikeDistance;"h"===y.orientation?(c=n,u=e,h="y",p="x",f=D,d=P):(c=e,u=n,h="x",p="y",d=D,f=P);var T=y[h+"period"],A=x||T;function k(t){return S(t,-1)}function M(t){return S(t,1)}function S(t,e){var r=t.w;return t[h]+e*r/2}function E(t){return t[h+"End"]-t[h+"Start"]}var C=x?k:T?function(t){return t.p-E(t)/2}:function(t){return Math.min(k(t),t.p-v.bardelta/2)},I=x?M:T?function(t){return t.p+E(t)/2}:function(t){return Math.max(M(t),t.p+v.bardelta/2)};function L(t,e,n){return o.finiteRange&&(n=0),r.inbox(t-c,e-c,n+Math.min(1,Math.abs(e-t)/m)-1)}function P(t){return L(C(t),I(t),b)}function z(t){var e=t[p];if(_){var r=Math.abs(t.rawS)||0;u>0?e+=r:u<0&&(e-=r)}return e}function D(t){var e=u,n=t.b,i=z(t);return r.inbox(n-e,i-e,b+(i-e)/(i-n)-1)}var O=t[h+"a"],R=t[p+"a"];m=Math.abs(O.r2c(O.range[1])-O.r2c(O.range[0]));var F,B,j,N,U=r.getDistanceFunction(i,f,d,(function(t){return(f(t)+d(t))/2}));if(r.getClosest(g,U,t),!1!==t.index&&g[t.index].p!==l){A||(C=function(t){return Math.min(k(t),t.p-v.bargroupwidth/2)},I=function(t){return Math.max(M(t),t.p+v.bargroupwidth/2)});var V=g[t.index],q=y.base?V.b+V.s:V.s;t[p+"0"]=t[p+"1"]=R.c2p(V[p],!0),t[p+"LabelVal"]=q;var H=v.extents[v.extents.round(V.p)];t[h+"0"]=O.c2p(x?C(V):H[0],!0),t[h+"1"]=O.c2p(x?I(V):H[1],!0);var G=void 0!==V.orig_p;return t[h+"LabelVal"]=G?V.orig_p:V.p,t.labelLabel=s(O,t[h+"LabelVal"],y[h+"hoverformat"]),t.valueLabel=s(R,t[p+"LabelVal"],y[p+"hoverformat"]),t.baseLabel=s(R,V.b,y[p+"hoverformat"]),t.spikeDistance=(B=u,j=(F=V).b,N=z(F),(r.inbox(j-B,N-B,w+(N-B)/(N-j)-1)+function(t){return L(k(t),M(t),w)}(V))/2),t[h+"Spike"]=O.c2p(V.p,!0),a(V,y,t),t.hovertemplate=y.hovertemplate,t}}function u(t,e){var r=e.mcc||t.marker.color,n=e.mlcc||t.marker.line.color,a=o(t,e);return i.opacity(r)?r:i.opacity(n)&&a?n:void 0}e.exports={hoverPoints:function(t,e,r,i,a){var o=c(t,e,r,i,a);if(o){var s=o.cd,l=s[0].trace,h=s[o.index];return o.color=u(l,h),n.getComponentMethod("errorbars","hoverInfo")(h,l,o),[o]}},hoverOnBars:c,getTraceColor:u}}}),no=f({"src/traces/bar/event_data.js"(t,e){e.exports=function(t,e,r){return t.x="xVal"in e?e.xVal:e.x,t.y="yVal"in e?e.yVal:e.y,e.xa&&(t.xaxis=e.xa),e.ya&&(t.yaxis=e.ya),"h"===r.orientation?(t.label=t.y,t.value=t.x):(t.label=t.x,t.value=t.y),t}}}),io=f({"src/traces/bar/select.js"(t,e){function r(t,e,r,n,i){var a=e.c2p(n?t.s0:t.p0,!0),o=e.c2p(n?t.s1:t.p1,!0),s=r.c2p(n?t.p0:t.s0,!0),l=r.c2p(n?t.p1:t.s1,!0);return i?[(a+o)/2,(s+l)/2]:n?[o,(s+l)/2]:[(a+o)/2,l]}e.exports=function(t,e){var n,i=t.cd,a=t.xaxis,o=t.yaxis,s=i[0].trace,l="funnel"===s.type,c="h"===s.orientation,u=[];if(!1===e)for(n=0;n0?(g="v",y=x>0?Math.min(b,_):Math.min(_)):x>0?(g="h",y=Math.min(b)):y=0;if(y){e._length=y;var S=i("orientation",g);e._hasPreCompStats?"v"===S&&0===x?(i("x0",0),i("dx",1)):"h"===S&&0===v&&(i("y0",0),i("dy",1)):"v"===S&&0===x?i("x0"):"h"===S&&0===v&&i("y0"),n.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],a)}else e.visible=!1}function u(t,e,n,i){var a=i.prefix,o=r.coerce2(t,e,l,"marker.outliercolor"),s=n("marker.line.outliercolor"),c="outliers";e._hasPreCompStats?c="all":(o||s)&&(c="suspectedoutliers");var u=n(a+"points",c);u?(n("jitter","all"===u?.3:0),n("pointpos","all"===u?-1.5:0),n("marker.symbol"),n("marker.opacity"),n("marker.size"),n("marker.angle"),n("marker.color",e.line.color),n("marker.line.color"),n("marker.line.width"),"suspectedoutliers"===u&&(n("marker.line.outliercolor",e.marker.color),n("marker.line.outlierwidth")),n("selected.marker.color"),n("unselected.marker.color"),n("selected.marker.size"),n("unselected.marker.size"),n("text"),n("hovertext")):delete e.marker;var h=n("hoveron");("all"===h||-1!==h.indexOf("points"))&&n("hovertemplate"),r.coerceSelectionMarkerOpacity(e,n)}e.exports={supplyDefaults:function(t,e,n,o){function s(n,i){return r.coerce(t,e,l,n,i)}if(c(t,e,s,o),!1!==e.visible){a(t,e,o,s),s("xhoverformat"),s("yhoverformat");var h=e._hasPreCompStats;h&&(s("lowerfence"),s("upperfence")),s("line.color",(t.marker||{}).color||n),s("line.width"),s("fillcolor",i.addOpacity(e.line.color,.5));var p=!1;if(h){var f=s("mean"),d=s("sd");f&&f.length&&(p=!0,d&&d.length&&(p="sd"))}s("whiskerwidth");var m,g=s("sizemode");"quartiles"===g&&(m=s("boxmean",p)),s("showwhiskers","quartiles"===g),("sd"===g||"sd"===m)&&s("sdmultiple"),s("width"),s("quartilemethod");var y=!1;if(h){var v=s("notchspan");v&&v.length&&(y=!0)}else r.validate(t.notchwidth,l.notchwidth)&&(y=!0);s("notched",y)&&s("notchwidth"),u(t,e,s,{prefix:"box"}),s("zorder")}},crossTraceDefaults:function(t,e){var n,i;function a(t){return r.coerce(i._input,i,l,t)}for(var s=0;sE.uf};if(e._hasPreCompStats){var U=e[x],V=function(t){return v.d2c((e[t]||[])[l])},q=1/0,H=-1/0;for(l=0;l=E.q1&&E.q3>=E.med){var W=V("lowerfence");E.lf=W!==o&&W<=E.q1?W:p(E,I,L);var Z=V("upperfence");E.uf=Z!==o&&Z>=E.q3?Z:f(E,I,L);var Y=V("mean");E.mean=Y!==o?Y:L?a.mean(I,L):(E.q1+E.q3)/2;var X=V("sd");E.sd=Y!==o&&X>=0?X:L?a.stdev(I,L,E.mean):E.q3-E.q1,E.lo=d(E),E.uo=m(E);var $=V("notchspan");$=$!==o&&$>0?$:g(E,L),E.ln=E.med-$,E.un=E.med+$;var K=E.lf,J=E.uf;e.boxpoints&&I.length&&(K=Math.min(K,I[0]),J=Math.max(J,I[L-1])),e.notched&&(K=Math.min(K,E.ln),J=Math.max(J,E.un)),E.min=K,E.max=J}else{var Q;a.warn(["Invalid input - make sure that q1 <= median <= q3","q1 = "+E.q1,"median = "+E.med,"q3 = "+E.q3].join("\n")),Q=E.med!==o?E.med:E.q1!==o?E.q3!==o?(E.q1+E.q3)/2:E.q1:E.q3!==o?E.q3:0,E.med=Q,E.q1=E.q3=Q,E.lf=E.uf=Q,E.mean=E.sd=Q,E.ln=E.un=Q,E.min=E.max=Q}q=Math.min(q,E.min),H=Math.max(H,E.max),E.pts2=C.filter(N),M.push(E)}}e._extremes[v._id]=n.findExtremes(v,[q,H],{padded:!0})}else{var tt=v.makeCalcdata(e,x),et=function(t,e){for(var r=t.length,n=new Array(r+1),i=0;i=0&&it0){var ut,ht;(E={}).pos=E[b]=B[l],C=E.pts=nt[l].sort(u),L=(I=E[x]=C.map(h)).length,E.min=I[0],E.max=I[L-1],E.mean=a.mean(I,L),E.sd=a.stdev(I,L,E.mean)*e.sdmultiple,E.med=a.interp(I,.5),L%2&&(lt||ct)?(lt?(ut=I.slice(0,L/2),ht=I.slice(L/2+1)):ct&&(ut=I.slice(0,L/2+1),ht=I.slice(L/2)),E.q1=a.interp(ut,.5),E.q3=a.interp(ht,.5)):(E.q1=a.interp(I,.25),E.q3=a.interp(I,.75)),E.lf=p(E,I,L),E.uf=f(E,I,L),E.lo=d(E),E.uo=m(E);var pt=g(E,L);E.ln=E.med-pt,E.un=E.med+pt,at=Math.min(at,E.ln),ot=Math.max(ot,E.un),E.pts2=C.filter(N),M.push(E)}e.notched&&a.isTypedArray(tt)&&(tt=Array.from(tt)),e._extremes[v._id]=n.findExtremes(v,e.notched?tt.concat([at,ot]):tt,{padded:!0})}return function(t,e){if(a.isArrayOrTypedArray(e.selectedpoints))for(var r=0;r0?(M[0].t={num:T[S],dPos:j,posLetter:b,valLetter:x,labels:{med:s(t,"median:"),min:s(t,"min:"),q1:s(t,"q1:"),q3:s(t,"q3:"),max:s(t,"max:"),mean:"sd"===e.boxmean||"sd"===e.sizemode?s(t,"mean ± σ:").replace("σ",1===e.sdmultiple?"σ":e.sdmultiple+"σ"):s(t,"mean:"),lf:s(t,"lower fence:"),uf:s(t,"upper fence:")}},T[S]++,M):[{t:{empty:!0}}]};var l={text:"tx",hovertext:"htx"};function c(t,e,r){for(var n in l)a.isArrayOrTypedArray(e[n])&&(Array.isArray(r)?a.isArrayOrTypedArray(e[n][r[0]])&&(t[l[n]]=e[n][r[0]][r[1]]):t[l[n]]=e[n][r])}function u(t,e){return t.v-e.v}function h(t){return t.v}function p(t,e,r){return 0===r?t.q1:Math.min(t.q1,e[Math.min(a.findBin(2.5*t.q1-1.5*t.q3,e,!0)+1,r-1)])}function f(t,e,r){return 0===r?t.q3:Math.max(t.q3,e[Math.max(a.findBin(2.5*t.q3-1.5*t.q1,e),0)])}function d(t){return 4*t.q1-3*t.q3}function m(t){return 4*t.q3-3*t.q1}function g(t,e){return 0===e?0:1.57*(t.q3-t.q1)/Math.sqrt(e)}}}),po=f({"src/traces/box/cross_trace_calc.js"(t,e){var r=ir(),n=le(),i=rn().getAxisGroup,a=["v","h"];function o(t,e,a,o){var s,l,c,u=e.calcdata,h=e._fullLayout,p=o._id,f=p.charAt(0),d=[],m=0;for(s=0;s1,_=1-h[t+"gap"],b=1-h[t+"groupgap"];for(s=0;s0){var H=M.pointpos,G=M.jitter,W=M.marker.size/2,Z=0;H+G>=0&&((Z=V*(H+G))>D?(q=!0,N=W,B=Z):Z>R&&(N=W,B=D)),Z<=D&&(B=D);var Y=0;H-G<=0&&((Y=-V*(H-G))>O?(q=!0,U=W,j=Y):Y>F&&(U=W,j=O)),Y<=O&&(j=O)}else B=D,j=O;var X=new Array(c.length);for(l=0;lt.lo&&(x.so=!0)}return a}));p.enter().append("path").classed("point",!0),p.exit().remove(),p.call(i.translatePoints,o,s)}function s(t,e,i,a){var o,s,l=e.val,c=e.pos,u=!!c.rangebreaks,h=a.bPos,p=a.bPosPxOffset||0,f=i.boxmean||(i.meanline||{}).visible;Array.isArray(a.bdPos)?(o=a.bdPos[0],s=a.bdPos[1]):(o=a.bdPos,s=a.bdPos);var d=t.selectAll("path.mean").data("box"===i.type&&i.boxmean||"violin"===i.type&&i.box.visible&&i.meanline.visible?n.identity:[]);d.enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}),d.exit().remove(),d.each((function(t){var e=c.c2l(t.pos+h,!0),n=c.l2p(e-o)+p,a=c.l2p(e+s)+p,d=u?(n+a)/2:c.l2p(e)+p,m=l.c2p(t.mean,!0),g=l.c2p(t.mean-t.sd,!0),y=l.c2p(t.mean+t.sd,!0);"h"===i.orientation?r.select(this).attr("d","M"+m+","+n+"V"+a+("sd"===f?"m0,0L"+g+","+d+"L"+m+","+n+"L"+y+","+d+"Z":"")):r.select(this).attr("d","M"+n+","+m+"H"+a+("sd"===f?"m0,0L"+d+","+g+"L"+n+","+m+"L"+d+","+y+"Z":""))}))}e.exports={plot:function(t,e,i,l){var c=t._context.staticPlot,u=e.xaxis,h=e.yaxis;n.makeTraceGroups(l,i,"trace boxes").each((function(t){var e,n,i=r.select(this),l=t[0],p=l.t,f=l.trace;p.wdPos=p.bdPos*f.whiskerwidth,!0!==f.visible||p.empty?i.remove():("h"===f.orientation?(e=h,n=u):(e=u,n=h),a(i,{pos:e,val:n},f,p,c),o(i,{x:u,y:h},f,p),s(i,{pos:e,val:n},f,p))}))},plotBoxAndWhiskers:a,plotPoints:o,plotBoxMean:s}}}),mo=f({"src/traces/box/style.js"(t,e){var r=x(),n=H(),i=Qe();e.exports={style:function(t,e,a){var o=a||r.select(t).selectAll("g.trace.boxes");o.style("opacity",(function(t){return t[0].trace.opacity})),o.each((function(e){var a=r.select(this),o=e[0].trace,s=o.line.width;function l(t,e,r,i){t.style("stroke-width",e+"px").call(n.stroke,r).call(n.fill,i)}var c=a.selectAll("path.box");if("candlestick"===o.type)c.each((function(t){if(!t.empty){var e=r.select(this),n=o[t.dir];l(e,n.line.width,n.line.color,n.fillcolor),e.style("opacity",o.selectedpoints&&!t.selected?.3:1)}}));else{l(c,s,o.line.color,o.fillcolor),a.selectAll("path.mean").style({"stroke-width":s,"stroke-dasharray":2*s+"px,"+s+"px"}).call(n.stroke,o.line.color);var u=a.selectAll("path.point");i.pointStyle(u,o,t)}}))},styleOnSelect:function(t,e,r){var n=e[0].trace,a=r.selectAll("path.point");n.selectedpoints?i.selectedPointStyle(a,n):i.pointStyle(a,n,t)}}}}),go=f({"src/traces/box/hover.js"(t,e){var r=ir(),n=le(),i=Dr(),a=H(),o=n.fillText;function s(t,e,o,s){var l,c,u,h,p,f,d,m,g,y,v,x,_,b,w=t.cd,T=t.xa,A=t.ya,k=w[0].trace,M=w[0].t,S="violin"===k.type,E=M.bdPos,C=M.wHover,I=function(t){return u.c2l(t.pos)+M.bPos-u.c2l(f)};S&&"both"!==k.side?("positive"===k.side&&(g=function(t){var e=I(t);return i.inbox(e,e+C,y)},x=E,_=0),"negative"===k.side&&(g=function(t){var e=I(t);return i.inbox(e-C,e,y)},x=0,_=E)):(g=function(t){var e=I(t);return i.inbox(e-C,e+C,y)},x=_=E),b=S?function(t){return i.inbox(t.span[0]-p,t.span[1]-p,y)}:function(t){return i.inbox(t.min-p,t.max-p,y)},"h"===k.orientation?(p=e,f=o,d=b,m=g,l="y",u=A,c="x",h=T):(p=o,f=e,d=g,m=b,l="x",u=T,c="y",h=A);var L=Math.min(1,E/Math.abs(u.r2c(u.range[1])-u.r2c(u.range[0])));function P(t){return(d(t)+m(t))/2}y=t.maxHoverDistance-L,v=t.maxSpikeDistance-L;var z=i.getDistanceFunction(s,d,m,P);if(i.getClosest(w,z,t),!1===t.index)return[];var D=w[t.index],O=k.line.color,R=(k.marker||{}).color;a.opacity(O)&&k.line.width?t.color=O:a.opacity(R)&&k.boxpoints?t.color=R:t.color=k.fillcolor,t[l+"0"]=u.c2p(D.pos+M.bPos-_,!0),t[l+"1"]=u.c2p(D.pos+M.bPos+x,!0),t[l+"LabelVal"]=void 0!==D.orig_p?D.orig_p:D.pos;var F=l+"Spike";t.spikeDistance=P(D)*v/y,t[F]=u.c2p(D.pos,!0);var B=k.boxmean||"sd"===k.sizemode||(k.meanline||{}).visible,j=k.boxpoints||k.points,N=j&&B?["max","uf","q3","med","mean","q1","lf","min"]:j&&!B?["max","uf","q3","med","q1","lf","min"]:!j&&B?["max","q3","med","mean","q1","min"]:["max","q3","med","q1","min"],U=h.range[1]0&&(a=!0);for(var l=0;la){var o=a-n[t];return n[t]=a,o}}return 0},max:function(t,e,n,i){var a=i[e];if(r(a)){if(a=Number(a),!r(n[t]))return n[t]=a,a;if(n[t]l?t>a?t>1.1*n?n:t>1.1*i?i:a:t>o?o:t>s?s:l:Math.pow(10,Math.floor(Math.log(t)/Math.LN10))}function p(t,e,r,i,o,s){if(i&&t>a){var l=f(e,o,s),c=f(r,o,s),u=t===n?0:1;return l[u]!==c[u]}return Math.floor(r/t)-Math.floor(e/t)>.1}function f(t,e,r){var i=e.c2d(t,n,r).split("-");return""===i[0]&&(i.unshift(),i[0]="-"+i[0]),i}e.exports=function(t,e,r,i,o){var s,l,h=-1.1*e,p=-.1*e,f=t-p,d=r[0],m=r[1],g=Math.min(u(d+p,d+f,i,o),u(m+p,m+f,i,o)),y=Math.min(u(d+h,d+p,i,o),u(m+h,m+p,i,o));if(g>y&&ya){var v=s===n?1:6,x=s===n?"M12":"M1";return function(e,r){var a=i.c2d(e,n,o),s=a.indexOf("-",v);s>0&&(a=a.substr(0,s));var u=i.d2c(a,0,o);if(u"u"){if(l)return[L,d,!0];L=function(t,e,r,i,a){var o,s,l,c=t._fullLayout,u=function(t,e){for(var r=e.xaxis,n=e.yaxis,i=e.orientation,a=[],o=t._fullData,s=0;so.r2l(B)&&(N=a.tickIncrement(N,_.size,!0,f)),D.start=o.l2r(N),F||n.nestedProperty(e,y+".start").set(D.start)}var U=_.end,V=o.r2l(z.end),q=void 0!==V;if((_.endFound||q)&&V!==o.r2l(U)){var H=q?V:n.aggNums(Math.max,null,d);D.end=o.l2r(H),q||n.nestedProperty(e,y+".start").set(D.end)}var G="autobin"+s;return!1===e._input[G]&&(e._input[y]=n.extendFlat({},e[y]||{}),delete e._input[G],delete e[G]),[D,d]}e.exports={calc:function(t,e){var i,p,f,d,m=[],g=[],y="h"===e.orientation,v=a.getFromId(t,y?e.yaxis:e.xaxis),x=y?"y":"x",_={x:"y",y:"x"}[x],b=e[x+"calendar"],w=e.cumulative,T=h(t,e,v,x),A=T[0],k=T[1],M="string"==typeof A.size,S=[],E=M?S:A,C=[],I=[],L=[],P=0,z=e.histnorm,D=e.histfunc,O=-1!==z.indexOf("density");w.enabled&&O&&(z=z.replace(/ ?density$/,""),O=!1);var R,F="max"===D||"min"===D?null:0,B=s.count,j=l[z],N=!1,U=function(t){return v.r2c(t,0,b)};for(n.isArrayOrTypedArray(e[_])&&"count"!==D&&(R=e[_],N="avg"===D,B=s[D]),i=U(A.start),f=U(A.end)+(i-a.tickIncrement(i,A.size,!1,b))/1e6;i=0&&d=0;n--)s(n);else if("increasing"===e){for(n=1;n=0;n--)t[n]+=t[n+1];"exclude"===r&&(t.push(0),t.shift())}}(g,w.direction,w.currentbin);var K=Math.min(m.length,g.length),J=[],Q=0,tt=K-1;for(i=0;i=Q;i--)if(g[i]){tt=i;break}for(i=Q;i<=tt;i++)if(r(m[i])&&r(g[i])){var et={p:m[i],s:g[i],b:0};w.enabled||(et.pts=L[i],W?et.ph0=et.ph1=L[i].length?k[L[i][0]]:m[i]:(e._computePh=!0,et.ph0=H(S[i]),et.ph1=H(S[i+1],!0))),J.push(et)}return 1===J.length&&(J[0].width1=a.tickIncrement(J[0].p,A.size,!1,b)-J[0].p),o(J,e),n.isArrayOrTypedArray(e.selectedpoints)&&n.tagSelected(J,e,X),J},calcAllAutoBins:h}}}),Lo=f({"src/traces/histogram2d/calc.js"(t,e){var r=le(),n=ir(),i=Mo(),a=So(),o=Eo(),s=Co(),l=Io().calcAllAutoBins;function c(t,e,r,n){var i,a=new Array(t);if(n)for(i=0;iS&&T.splice(S,T.length-S),M.length>S&&M.splice(S,M.length-S);var E=[],C=[],I=[],L="string"==typeof w.size,P="string"==typeof k.size,z=[],D=[],O=L?z:w,R=P?D:k,F=0,B=[],j=[],N=e.histnorm,U=e.histfunc,V=-1!==N.indexOf("density"),q="max"===U||"min"===U?null:0,H=i.count,G=a[N],W=!1,Z=[],Y=[],X="z"in e?e.z:"marker"in e&&Array.isArray(e.marker.color)?e.marker.color:"";X&&"count"!==U&&(W="avg"===U,H=i[U]);var $=w.size,K=x(w.start),J=x(w.end)+(K-n.tickIncrement(K,$,!1,y))/1e6;for(s=K;s=0&&f=0&&dm&&(y=Math.max(y,Math.abs(t[a][o]-d)/(g-m))))}return y}e.exports=function(t,e){var n,a,o=1;for(i(t,e),n=0;n.01;n++)o=i(t,e,(a=o,.5-.25*Math.min(1,.5*a)));return o>.01&&r.log("interp2d didn't converge quickly",o),t}}}),Oo=f({"src/traces/heatmap/find_empties.js"(t,e){var r=le().maxRowLength;e.exports=function(t){var e,n,i,a,o,s,l,c,u=[],h={},p=[],f=t[0],d=[],m=[0,0,0],g=r(t);for(n=0;n=0;o--)(s=((h[[(n=(a=p[o])[0])-1,i=a[1]]]||m)[2]+(h[[n+1,i]]||m)[2]+(h[[n,i-1]]||m)[2]+(h[[n,i+1]]||m)[2])/20)&&(l[a]=[n,i,s],p.splice(o,1),c=!0);if(!c)throw"findEmpties iterated with no new neighbors";for(a in l)h[a]=l[a],u.push(l[a])}return u.sort((function(t,e){return e[2]-t[2]}))}}}),Ro=f({"src/traces/heatmap/make_bound_array.js"(t,e){var r=qt(),n=le().isArrayOrTypedArray;e.exports=function(t,e,i,a,o,s){var l,c,u,h=[],p=r.traceIs(t,"contour"),f=r.traceIs(t,"histogram");if(n(e)&&e.length>1&&!f&&"category"!==s.type){var d=e.length;if(!(d<=o))return p?e.slice(0,o):e.slice(0,o+1);if(p)h=Array.from(e).slice(0,o);else if(1===o)h="log"===s.type?[.5*e[0],2*e[0]]:[e[0]-.5,e[0]+.5];else if("log"===s.type){for(h=[Math.pow(e[0],1.5)/Math.pow(e[1],.5)],u=1;u1){var e=(t[t.length-1]-t[0])/(t.length-1),r=Math.abs(e/100);for(A=0;Ar)return!1}return!0}(M.rangebreaks||S.rangebreaks)&&(T=function(t,e,r){for(var n=[],i=-1,a=0;a0;)A=k.c2p(j[I]),I--;for(A0;)C=M.c2p(N[I]),I--;C=k._length||A<=0||E>=M._length||C<=0)return z.selectAll("image").data([]).exit().remove(),void _(z);"fast"===X?(K=W,J=G):(K=Q,J=tt);var et=document.createElement("canvas");et.width=K,et.height=J;var rt,nt,it=et.getContext("2d",{willReadFrequently:!0}),at=p(O,{noNumericCheck:!0,returnArray:!0});"fast"===X?(rt=Z?function(t){return W-1-t}:s.identity,nt=Y?function(t){return G-1-t}:s.identity):(rt=function(t){return s.constrain(Math.round(k.c2p(j[t])-x),0,Q)},nt=function(t){return s.constrain(Math.round(M.c2p(N[t])-E),0,tt)});var ot,st,lt,ct,ut=nt(0),ht=[ut,ut],pt=Z?0:1,ft=Y?0:1,dt=0,mt=0,gt=0,yt=0;function vt(t,e){if(void 0!==t){var r=at(t);return r[0]=Math.round(r[0]),r[1]=Math.round(r[1]),r[2]=Math.round(r[2]),dt+=e,mt+=r[0]*e,gt+=r[1]*e,yt+=r[2]*e,r}return[0,0,0,0]}function xt(t,e,r,n){var i=t[r.bin0];if(void 0===i)return vt(void 0,1);var a,o=t[r.bin1],s=e[r.bin0],l=e[r.bin1],c=o-i||0,u=s-i||0;return a=void 0===o?void 0===l?0:void 0===s?2*(l-i):2*(2*l-s-i)/3:void 0===l?void 0===s?0:2*(2*i-o-s)/3:void 0===s?2*(2*l-o-i)/3:l+i-o-s,vt(i+r.frac*c+n.frac*(u+r.frac*a))}if("default"!==X){var _t,bt=0;try{_t=new Uint8Array(K*J*4)}catch{_t=new Array(K*J*4)}if("smooth"===X){var wt,Tt,At,kt=U||j,Mt=V||N,St=new Array(kt.length),Et=new Array(Mt.length),Ct=new Array(Q),It=U?w:b,Lt=V?w:b;for(I=0;IXt||Xt>M._length))for(L=Gt;LKt||Kt>k._length)){var Jt=c({x:$t,y:Yt},O,t._fullLayout);Jt.x=$t,Jt.y=Yt;var Qt=D.z[I][L];void 0===Qt?(Jt.z="",Jt.zLabel=""):(Jt.z=Qt,Jt.zLabel=o.tickText(Ut,Qt,"hover").text);var te=D.text&&D.text[I]&&D.text[I][L];(void 0===te||!1===te)&&(te=""),Jt.text=te;var ee=s.texttemplateString(jt,Jt,t._fullLayout._d3locale,Jt,O._meta||{});if(ee){var re=ee.split("
"),ne=re.length,ie=0;for(P=0;P=b[0].length||f<0||f>b.length)return}else{if(r.inbox(e-x[0],e-x[x.length-1],0)>0||r.inbox(s-_[0],s-_[_.length-1],0)>0)return;if(d){var E;for(M=[2*x[0]-x[1]],E=1;E=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}}}),ls=f({"src/traces/contour/attributes.js"(t,e){var r=bo(),n=Tn(),i=Ce(),a=i.axisHoverFormat,o=i.descriptionOnlyNumbers,s=Pe(),l=zt().dash,c=F(),u=R().extendFlat,h=ss(),p=h.COMPARISON_OPS2,f=h.INTERVAL_OPS,d=n.line;e.exports=u({z:r.z,x:r.x,x0:r.x0,dx:r.dx,y:r.y,y0:r.y0,dy:r.dy,xperiod:r.xperiod,yperiod:r.yperiod,xperiod0:n.xperiod0,yperiod0:n.yperiod0,xperiodalignment:r.xperiodalignment,yperiodalignment:r.yperiodalignment,text:r.text,hovertext:r.hovertext,transpose:r.transpose,xtype:r.xtype,ytype:r.ytype,xhoverformat:a("x"),yhoverformat:a("y"),zhoverformat:a("z",1),hovertemplate:r.hovertemplate,texttemplate:u({},r.texttemplate,{}),textfont:u({},r.textfont,{}),hoverongaps:r.hoverongaps,connectgaps:u({},r.connectgaps,{}),fillcolor:{valType:"color",editType:"calc"},autocontour:{valType:"boolean",dflt:!0,editType:"calc",impliedEdits:{"contours.start":void 0,"contours.end":void 0,"contours.size":void 0}},ncontours:{valType:"integer",dflt:15,min:1,editType:"calc"},contours:{type:{valType:"enumerated",values:["levels","constraint"],dflt:"levels",editType:"calc"},start:{valType:"number",dflt:null,editType:"plot",impliedEdits:{"^autocontour":!1}},end:{valType:"number",dflt:null,editType:"plot",impliedEdits:{"^autocontour":!1}},size:{valType:"number",dflt:null,min:0,editType:"plot",impliedEdits:{"^autocontour":!1}},coloring:{valType:"enumerated",values:["fill","heatmap","lines","none"],dflt:"fill",editType:"calc"},showlines:{valType:"boolean",dflt:!0,editType:"plot"},showlabels:{valType:"boolean",dflt:!1,editType:"plot"},labelfont:c({editType:"plot",colorEditType:"style"}),labelformat:{valType:"string",dflt:"",editType:"plot",description:o("contour label")},operation:{valType:"enumerated",values:[].concat(p).concat(f),dflt:"=",editType:"calc"},value:{valType:"any",dflt:0,editType:"calc"},editType:"calc",impliedEdits:{autocontour:!1}},line:{color:u({},d.color,{editType:"style+colorbars"}),width:{valType:"number",min:0,editType:"style+colorbars"},dash:l,smoothing:u({},d.smoothing,{}),editType:"plot"},zorder:n.zorder},s("",{cLetter:"z",autoColorDflt:!1,editTypeOverride:"calc"}))}}),cs=f({"src/traces/histogram2dcontour/attributes.js"(t,e){var r=es(),n=ls(),i=Pe(),a=Ce().axisHoverFormat,o=R().extendFlat;e.exports=o({x:r.x,y:r.y,z:r.z,marker:r.marker,histnorm:r.histnorm,histfunc:r.histfunc,nbinsx:r.nbinsx,xbins:r.xbins,nbinsy:r.nbinsy,ybins:r.ybins,autobinx:r.autobinx,autobiny:r.autobiny,bingroup:r.bingroup,xbingroup:r.xbingroup,ybingroup:r.ybingroup,autocontour:n.autocontour,ncontours:n.ncontours,contours:n.contours,line:{color:n.line.color,width:o({},n.line.width,{dflt:.5}),dash:n.line.dash,smoothing:n.line.smoothing,editType:"plot"},xhoverformat:a("x"),yhoverformat:a("y"),zhoverformat:a("z",1),hovertemplate:r.hovertemplate,texttemplate:n.texttemplate,textfont:n.textfont},i("",{cLetter:"z",editTypeOverride:"calc"}))}}),us=f({"src/traces/contour/contours_defaults.js"(t,e){e.exports=function(t,e,r,n){var i=n("contours.start"),a=n("contours.end"),o=!1===i||!1===a,s=r("contours.size");((o?e.autocontour=!0:r("autocontour",!1))||!s)&&r("ncontours")}}}),hs=f({"src/traces/contour/label_defaults.js"(t,e){var r=le();e.exports=function(t,e,n,i){if(i||(i={}),t("contours.showlabels")){var a=e.font;r.coerceFont(t,"contours.labelfont",a,{overrideDflt:{color:n}}),t("contours.labelformat")}!1!==i.hasHover&&t("zhoverformat")}}}),ps=f({"src/traces/contour/style_defaults.js"(t,e){var r=qe(),n=hs();e.exports=function(t,e,i,a,o){var s,l=i("contours.coloring"),c="";"fill"===l&&(s=i("contours.showlines")),!1!==s&&("lines"!==l&&(c=i("line.color","#000")),i("line.width",.5),i("line.dash")),"none"!==l&&(!0!==t.showlegend&&(e.showlegend=!1),e._dfltShowLegend=!1,r(t,e,a,i,{prefix:"",cLetter:"z"})),i("line.smoothing"),n(i,a,c,o)}}}),fs=f({"src/traces/histogram2dcontour/defaults.js"(t,e){var r=le(),n=rs(),i=us(),a=ps(),o=To(),s=cs();e.exports=function(t,e,l,c){function u(n,i){return r.coerce(t,e,s,n,i)}n(t,e,u,c),!1!==e.visible&&(i(t,e,u,(function(n){return r.coerce2(t,e,s,n)})),a(t,e,u,c),u("xhoverformat"),u("yhoverformat"),u("hovertemplate"),e.contours&&"heatmap"===e.contours.coloring&&o(u,c))}}}),ds=f({"src/traces/contour/set_contours.js"(t,e){var r=ir(),n=le();function i(t,e,n){var i={type:"linear",range:[t,e]};return r.autoTicks(i,(e-t)/(n||15)),i}e.exports=function(t,e){var a=t.contours;if(t.autocontour){var o=t.zmin,s=t.zmax;(t.zauto||void 0===o)&&(o=n.aggNums(Math.min,null,e)),(t.zauto||void 0===s)&&(s=n.aggNums(Math.max,null,e));var l=i(o,s,t.ncontours);a.size=l.dtick,a.start=r.tickFirst(l),l.range.reverse(),a.end=r.tickFirst(l),a.start===o&&(a.start+=a.size),a.end===s&&(a.end-=a.size),a.start>a.end&&(a.start=a.end=(a.start+a.end)/2),t._input.contours||(t._input.contours={}),n.extendFlat(t._input.contours,{start:a.start,end:a.end,size:a.size}),t._input.autocontour=!0}else if("constraint"!==a.type){var c,u=a.start,h=a.end,p=t._input.contours;u>h&&(a.start=p.start=h,h=a.end=p.end=u,u=a.start),a.size>0||(c=u===h?1:i(u,h,t.ncontours).dtick,p.size=a.size=c)}}}}),ms=f({"src/traces/contour/end_plus.js"(t,e){e.exports=function(t){return t.end+t.size/1e6}}}),gs=f({"src/traces/contour/calc.js"(t,e){var r=Ze(),n=Fo(),i=ds(),a=ms();e.exports=function(t,e){var o=n(t,e),s=o[0].z;i(e,s);var l,c=e.contours,u=r.extractOpts(e);if("heatmap"===c.coloring&&u.auto&&!1===e.autocontour){var h=c.start,p=a(c),f=c.size||1,d=Math.floor((p-h)/f)+1;isFinite(f)||(f=1,d=1);var m=h-f/2;l=[m,m+d*f]}else l=s;return r.calc(t,e,{vals:l,cLetter:"z"}),o}}}),ys=f({"src/traces/contour/constants.js"(t,e){e.exports={BOTTOMSTART:[1,9,13,104,713],TOPSTART:[4,6,7,104,713],LEFTSTART:[8,12,14,208,1114],RIGHTSTART:[2,3,11,208,1114],NEWDELTA:[null,[-1,0],[0,-1],[-1,0],[1,0],null,[0,-1],[-1,0],[0,1],[0,1],null,[0,1],[1,0],[1,0],[0,-1]],CHOOSESADDLE:{104:[4,1],208:[2,8],713:[7,13],1114:[11,14]},SADDLEREMAINDER:{1:4,2:8,4:1,7:13,8:2,11:14,13:7,14:11},LABELDISTANCE:2,LABELINCREASE:10,LABELMIN:3,LABELMAX:10,LABELOPTIMIZER:{EDGECOST:1,ANGLECOST:1,NEIGHBORCOST:5,SAMELEVELFACTOR:10,SAMELEVELDISTANCE:5,MAXCOST:100,INITIALSEARCHPOINTS:10,ITERATIONS:5}}}}),vs=f({"src/traces/contour/make_crossings.js"(t,e){var r=ys();function n(t,e){var r=(e[0][0]>t?0:1)+(e[0][1]>t?0:2)+(e[1][1]>t?0:4)+(e[1][0]>t?0:8);return 5===r||10===r?t>(e[0][0]+e[0][1]+e[1][0]+e[1][1])/4?5===r?713:1114:5===r?104:208:15===r?0:r}e.exports=function(t){var e,i,a,o,s,l,c,u,h,p=t[0].z,f=p.length,d=p[0].length,m=2===f||2===d;for(i=0;i20&&e?208===t||1114===t?i=0===r[0]?1:-1:a=0===r[1]?1:-1:-1!==n.BOTTOMSTART.indexOf(t)?a=1:-1!==n.LEFTSTART.indexOf(t)?i=1:-1!==n.TOPSTART.indexOf(t)?a=-1:i=-1,[i,a]}(p,o,e),d=[s(t,e,[-f[0],-f[1]])],m=t.z.length,g=t.z[0].length,y=e.slice(),v=f.slice();for(u=0;u<1e4;u++){if(p>20?(p=n.CHOOSESADDLE[p][(f[0]||f[1])<0?0:1],t.crossings[h]=n.SADDLEREMAINDER[p]):delete t.crossings[h],!(f=n.NEWDELTA[p])){r.log("Found bad marching index:",p,e,t.level);break}d.push(s(t,e,f)),e[0]+=f[0],e[1]+=f[1],h=e.join(","),i(d[d.length-1],d[d.length-2],l,c)&&d.pop();var x=f[0]&&(e[0]<0||e[0]>g-2)||f[1]&&(e[1]<0||e[1]>m-2);if(e[0]===y[0]&&e[1]===y[1]&&f[0]===v[0]&&f[1]===v[1]||o&&x)break;p=t.crossings[h]}1e4===u&&r.log("Infinite loop in contour?");var _,b,w,T,A,k,M,S,E,C,I,L=i(d[0],d[d.length-1],l,c),P=0,z=.2*t.smoothing,D=[],O=0;for(u=1;u=O;u--)if((_=D[u])=O&&_+D[b]S&&E--,t.edgepaths[E]=I.concat(d,C));break}j||(t.edgepaths[S]=d.concat(C))}for(S=0;S":o(">"),"<":o("<"),"=":o("=")}}}),bs=f({"src/traces/contour/empty_pathinfo.js"(t,e){var r=le(),n=_s(),i=ms();e.exports=function(t,e,a){for(var o="constraint"===t.type?n[t._operation](t.value):t,s=o.size,l=[],c=i(o),u=a.trace._carpetTrace,h=u?{xaxis:u.aaxis,yaxis:u.baxis,x:a.a,y:a.b}:{xaxis:e.xaxis,yaxis:e.yaxis,x:a.x,y:a.y},p=o.start;p1e3){r.warn("Too many contours, clipping at 1000",t);break}return l}}}),ws=f({"src/traces/contour/convert_to_constraints.js"(t,e){var r=le();function n(t){return r.extendFlat({},t,{edgepaths:r.extendDeep([],t.edgepaths),paths:r.extendDeep([],t.paths),starts:r.extendDeep([],t.starts)})}e.exports=function(t,e){var i,a,o,s=function(t){return t.reverse()},l=function(t){return t};switch(e){case"=":case"<":return t;case">":for(1!==t.length&&r.warn("Contour data invalid for the specified inequality operation."),a=t[0],i=0;io.level||o.starts.length&&a===o.level)}break;case"constraint":if(n.prefixBoundary=!1,n.edgepaths.length)return;var s=n.x.length,l=n.y.length,c=-1/0,u=1/0;for(r=0;r":f>c&&(n.prefixBoundary=!0);break;case"<":(fc||n.starts.length&&p===u)&&(n.prefixBoundary=!0);break;case"][":h=Math.min(f[0],f[1]),p=Math.max(f[0],f[1]),hc&&(n.prefixBoundary=!0)}}}}}),As=f({"src/traces/contour/plot.js"(t){var e=x(),r=le(),n=Qe(),i=Ze(),a=Se(),o=ir(),s=er(),l=No(),c=vs(),u=xs(),h=bs(),p=ws(),f=Ts(),d=ys(),m=d.LABELOPTIMIZER;function g(t,e){var i,a,o,s,l,c,u,h="",p=0,f=t.edgepaths.map((function(t,e){return e})),d=!0;function m(t){return Math.abs(t[1]-e[2][1])<.01}function g(t){return Math.abs(t[0]-e[0][0])<.01}function y(t){return Math.abs(t[0]-e[2][0])<.01}for(;f.length;){for(c=n.smoothopen(t.edgepaths[p],t.smoothing),h+=d?c:c.replace(/^M/,"L"),f.splice(f.indexOf(p),1),i=t.edgepaths[p][t.edgepaths[p].length-1],s=-1,o=0;o<4;o++){if(!i){r.log("Missing end?",p,t);break}for(u=i,Math.abs(u[1]-e[0][1])<.01&&!y(i)?a=e[1]:g(i)?a=e[0]:m(i)?a=e[3]:y(i)&&(a=e[2]),l=0;l=0&&(a=v,s=l):Math.abs(i[1]-a[1])<.01?Math.abs(i[1]-v[1])<.01&&(v[0]-i[0])*(a[0]-v[0])>=0&&(a=v,s=l):r.log("endpt to newendpt is not vert. or horz.",i,a,v)}if(i=a,s>=0)break;h+="L"+a}if(s===t.edgepaths.length){r.log("unclosed perimeter path");break}p=s,(d=-1===f.indexOf(p))&&(p=f[0],h+="Z")}for(p=0;pi.center?i.right-s:s-i.left)/(u+Math.abs(Math.sin(c)*o)),f=(l>i.middle?i.bottom-l:l-i.top)/(Math.abs(h)+Math.cos(c)*o);if(p<1||f<1)return 1/0;var d=m.EDGECOST*(1/(p-1)+1/(f-1));d+=m.ANGLECOST*c*c;for(var g=s-u,y=l-h,v=s+u,x=l+h,_=0;_2*m.MAXCOST)break;f&&(s/=2),l=(o=c-s/2)+1.5*s}if(p<=m.MAXCOST)return u},t.addLabelData=function(t,e,r,n){var i=e.fontSize,a=e.width+i/3,o=Math.max(0,e.height-i/3),s=t.x,l=t.y,c=t.theta,u=Math.sin(c),h=Math.cos(c),p=function(t,e){return[s+t*h-e*u,l+t*u+e*h]},f=[p(-a/2,-o/2),p(-a/2,o/2),p(a/2,o/2),p(a/2,-o/2)];r.push({text:e.text,x:s,y:l,dy:e.dy,theta:c,level:e.level,width:a,height:o}),n.push(f)},t.drawLabels=function(t,n,i,o,s){var l=t.selectAll("text").data(n,(function(t){return t.text+","+t.x+","+t.y+","+t.theta}));if(l.exit().remove(),l.enter().append("text").attr({"data-notex":1,"text-anchor":"middle"}).each((function(t){var r=t.x+Math.sin(t.theta)*t.dy,n=t.y-Math.cos(t.theta)*t.dy;e.select(this).text(t.text).attr({x:r,y:n,transform:"rotate("+180*t.theta/Math.PI+" "+r+" "+n+")"}).call(a.convertToTspans,i)})),s){for(var c="",u=0;u=v)&&(a<=y&&(a=y),o>=v&&(o=v),l=Math.floor((o-a)/s)+1,c=0),p=0;py&&(m.unshift(y),g.unshift(g[0])),m[m.length-1]2?e.value=e.value.slice(2):0===e.length?e.value=[0,1]:e.length<2?(n=parseFloat(e.value[0]),e.value=[n,n+1]):e.value=[parseFloat(e.value[0]),parseFloat(e.value[1])]:r(e.value)&&(n=parseFloat(e.value),e.value=[n,n+1])):(t("contours.value",0),r(e.value)||(l(e.value)?e.value=parseFloat(e.value[0]):e.value=0))}(i,g),"="===y?f=g.showlines=!0:(f=i("contours.showlines"),m=i("fillcolor",a((t.line||{}).color||h,.5))),f&&(d=i("line.color",m&&o(m)?a(e.fillcolor,1):h),i("line.width",2),i("line.dash")),i("line.smoothing"),n(i,s,d,p)}}}),Ps=f({"src/traces/contour/defaults.js"(t,e){var r=le(),n=wo(),i=Gn(),a=Ls(),o=us(),s=ps(),l=To(),c=ls();e.exports=function(t,e,u,h){function p(n,i){return r.coerce(t,e,c,n,i)}if(n(t,e,p,h)){i(t,e,h,p),p("xhoverformat"),p("yhoverformat"),p("text"),p("hovertext"),p("hoverongaps"),p("hovertemplate");var f="constraint"===p("contours.type");p("connectgaps",r.isArray1D(e.z)),f?a(t,e,p,h,u):(o(t,e,p,(function(n){return r.coerce2(t,e,c,n)})),s(t,e,p,h)),e.contours&&"heatmap"===e.contours.coloring&&l(p,h),p("zorder")}else e.visible=!1}}}),zs=f({"src/traces/contour/index.js"(t,e){e.exports={attributes:ls(),supplyDefaults:Ps(),calc:gs(),plot:As().plot,style:Ms(),colorbar:Ss(),hoverPoints:Es(),moduleType:"trace",name:"contour",basePlotModule:Si(),categories:["cartesian","svg","2dMap","contour","showLegend"],meta:{}}}}),Ds=f({"lib/contour.js"(t,e){e.exports=zs()}}),Os=f({"src/traces/scatterternary/attributes.js"(t,e){var r=Ot().hovertemplateAttrs,n=Ot().texttemplateAttrs,i=wn(),a=Tn(),o=U(),s=Pe(),l=zt().dash,c=R().extendFlat,u=a.marker,h=a.line,p=u.line;e.exports={a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},c:{valType:"data_array",editType:"calc"},sum:{valType:"number",dflt:0,min:0,editType:"calc"},mode:c({},a.mode,{dflt:"markers"}),text:c({},a.text,{}),texttemplate:n({editType:"plot"},{keys:["a","b","c","text"]}),hovertext:c({},a.hovertext,{}),line:{color:h.color,width:h.width,dash:l,backoff:h.backoff,shape:c({},h.shape,{values:["linear","spline"]}),smoothing:h.smoothing,editType:"calc"},connectgaps:a.connectgaps,cliponaxis:a.cliponaxis,fill:c({},a.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:i(),marker:c({symbol:u.symbol,opacity:u.opacity,angle:u.angle,angleref:u.angleref,standoff:u.standoff,maxdisplayed:u.maxdisplayed,size:u.size,sizeref:u.sizeref,sizemin:u.sizemin,sizemode:u.sizemode,line:c({width:p.width,editType:"calc"},s("marker.line")),gradient:u.gradient,editType:"calc"},s("marker")),textfont:a.textfont,textposition:a.textposition,selected:a.selected,unselected:a.unselected,hoverinfo:c({},o.hoverinfo,{flags:["a","b","c","text","name"]}),hoveron:a.hoveron,hovertemplate:r()}}}),Rs=f({"src/traces/scatterternary/defaults.js"(t,e){var r=le(),n=bn(),i=Ye(),a=Zn(),o=Yn(),s=Xn(),l=$n(),c=Kn(),u=Os();e.exports=function(t,e,h,p){function f(n,i){return r.coerce(t,e,u,n,i)}var d,m=f("a"),g=f("b"),y=f("c");if(m?(d=m.length,g?(d=Math.min(d,g.length),y&&(d=Math.min(d,y.length))):d=y?Math.min(d,y.length):0):g&&y&&(d=Math.min(g.length,y.length)),d){e._length=d,f("sum"),f("text"),f("hovertext"),"fills"!==e.hoveron&&f("hovertemplate"),f("mode",d"),o.hovertemplate=p.hovertemplate,a}function x(t,e){y.push(t._hovertitle+": "+e)}}}}),Us=f({"src/traces/scatterternary/event_data.js"(t,e){e.exports=function(t,e,r,n,i){if(e.xa&&(t.xaxis=e.xa),e.ya&&(t.yaxis=e.ya),n[i]){var a=n[i];t.a=a.a,t.b=a.b,t.c=a.c}else t.a=e.a,t.b=e.b,t.c=e.c;return t}}}),Vs=f({"src/plots/ternary/ternary.js"(t,e){var r=x(),n=O(),i=qt(),a=le(),o=a.strTranslate,s=a._,l=H(),c=Qe(),u=er(),h=R().extendFlat,p=Ae(),f=ir(),d=pr(),m=Dr(),g=Or(),y=g.freeMode,v=g.rectMode,_=tr(),b=En().prepSelect,w=En().selectOnClick,T=En().clearOutline,A=En().clearSelectionsCache,k=ve();function M(t,e){this.id=t.id,this.graphDiv=t.graphDiv,this.init(e),this.makeFramework(e),this.updateFx(e),this.aTickLayout=null,this.bTickLayout=null,this.cTickLayout=null}e.exports=M;var S=M.prototype;S.init=function(t){this.container=t._ternarylayer,this.defs=t._defs,this.layoutId=t._uid,this.traceHash={},this.layers={}},S.plot=function(t,e){var r=this,n=e[r.id],i=e._size;r._hasClipOnAxisFalse=!1;for(var a=0;aE*_?i=(a=_)*E:a=(i=x)/E,s=y*i/x,p=v*a/_,r=e.l+e.w*m-i/2,n=e.t+e.h*(1-g)-a/2,f.x0=r,f.y0=n,f.w=i,f.h=a,f.sum=b,f.xaxis={type:"linear",range:[w+2*A-b,b-w-2*T],domain:[m-s/2,m+s/2],_id:"x"},u(f.xaxis,f.graphDiv._fullLayout),f.xaxis.setScale(),f.xaxis.isPtWithinRange=function(t){return t.a>=f.aaxis.range[0]&&t.a<=f.aaxis.range[1]&&t.b>=f.baxis.range[1]&&t.b<=f.baxis.range[0]&&t.c>=f.caxis.range[1]&&t.c<=f.caxis.range[0]},f.yaxis={type:"linear",range:[w,b-T-A],domain:[g-p/2,g+p/2],_id:"y"},u(f.yaxis,f.graphDiv._fullLayout),f.yaxis.setScale(),f.yaxis.isPtWithinRange=function(){return!0};var k=f.yaxis.domain[0],M=f.aaxis=h({},t.aaxis,{range:[w,b-T-A],side:"left",tickangle:(+t.aaxis.tickangle||0)-30,domain:[k,k+p*E],anchor:"free",position:0,_id:"y",_length:i});u(M,f.graphDiv._fullLayout),M.setScale();var S=f.baxis=h({},t.baxis,{range:[b-w-A,T],side:"bottom",domain:f.xaxis.domain,anchor:"free",position:0,_id:"x",_length:i});u(S,f.graphDiv._fullLayout),S.setScale();var C=f.caxis=h({},t.caxis,{range:[b-w-T,A],side:"right",tickangle:(+t.caxis.tickangle||0)+30,domain:[k,k+p*E],anchor:"free",position:0,_id:"y",_length:i});u(C,f.graphDiv._fullLayout),C.setScale();var I="M"+r+","+(n+a)+"h"+i+"l-"+i/2+",-"+a+"Z";f.clipDef.select("path").attr("d",I),f.layers.plotbg.select("path").attr("d",I);var L="M0,"+a+"h"+i+"l-"+i/2+",-"+a+"Z";f.clipDefRelative.select("path").attr("d",L);var P=o(r,n);f.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",P),f.clipDefRelative.select("path").attr("transform",null);var z=o(r-S._offset,n+a);f.layers.baxis.attr("transform",z),f.layers.bgrid.attr("transform",z);var D=o(r+i/2,n)+"rotate(30)"+o(0,-M._offset);f.layers.aaxis.attr("transform",D),f.layers.agrid.attr("transform",D);var O=o(r+i/2,n)+"rotate(-30)"+o(0,-C._offset);f.layers.caxis.attr("transform",O),f.layers.cgrid.attr("transform",O),f.drawAxes(!0),f.layers.aline.select("path").attr("d",M.showline?"M"+r+","+(n+a)+"l"+i/2+",-"+a:"M0,0").call(l.stroke,M.linecolor||"#000").style("stroke-width",(M.linewidth||0)+"px"),f.layers.bline.select("path").attr("d",S.showline?"M"+r+","+(n+a)+"h"+i:"M0,0").call(l.stroke,S.linecolor||"#000").style("stroke-width",(S.linewidth||0)+"px"),f.layers.cline.select("path").attr("d",C.showline?"M"+(r+i/2)+","+n+"l"+i/2+","+a:"M0,0").call(l.stroke,C.linecolor||"#000").style("stroke-width",(C.linewidth||0)+"px"),f.graphDiv._context.staticPlot||f.initInteractions(),c.setClipUrl(f.layers.frontplot,f._hasClipOnAxisFalse?null:f.clipId,f.graphDiv)},S.drawAxes=function(t){var e=this,r=e.graphDiv,n=e.id.substr(7)+"title",i=e.layers,a=e.aaxis,o=e.baxis,l=e.caxis;if(e.drawAx(a),e.drawAx(o),e.drawAx(l),t){var c=Math.max(a.showticklabels?a.tickfont.size/2:0,(l.showticklabels?.75*l.tickfont.size:0)+("outside"===l.ticks?.87*l.ticklen:0)),u=(o.showticklabels?o.tickfont.size:0)+("outside"===o.ticks?o.ticklen:0)+3;i["a-title"]=_.draw(r,"a"+n,{propContainer:a,propName:e.id+".aaxis.title",placeholder:s(r,"Click to enter Component A title"),attributes:{x:e.x0+e.w/2,y:e.y0-a.title.font.size/3-c,"text-anchor":"middle"}}),i["b-title"]=_.draw(r,"b"+n,{propContainer:o,propName:e.id+".baxis.title",placeholder:s(r,"Click to enter Component B title"),attributes:{x:e.x0-u,y:e.y0+e.h+.83*o.title.font.size+u,"text-anchor":"middle"}}),i["c-title"]=_.draw(r,"c"+n,{propContainer:l,propName:e.id+".caxis.title",placeholder:s(r,"Click to enter Component C title"),attributes:{x:e.x0+e.w+u,y:e.y0+e.h+.83*l.title.font.size+u,"text-anchor":"middle"}})}},S.drawAx=function(t){var e=this,r=e.graphDiv,n=t._name,i=n.charAt(0),o=t._id,s=e.layers[n],l=i+"tickLayout",c=function(t){return t.ticks+String(t.ticklen)+String(t.showticklabels)}(t);e[l]!==c&&(s.selectAll("."+o+"tick").remove(),e[l]=c),t.setScale();var u=f.calcTicks(t),h=f.clipEnds(t,u),p=f.makeTransTickFn(t),d=f.getTickSigns(t)[2],m=a.deg2rad(30),g=d*(t.linewidth||1)/2,y=d*t.ticklen,v=e.w,x=e.h,_="b"===i?"M0,"+g+"l"+Math.sin(m)*y+","+Math.cos(m)*y:"M"+g+",0l"+Math.cos(m)*y+","+-Math.sin(m)*y,b={a:"M0,0l"+x+",-"+v/2,b:"M0,0l-"+v/2+",-"+x,c:"M0,0l-"+x+","+v/2}[i];f.drawTicks(r,t,{vals:"inside"===t.ticks?h:u,layer:s,path:_,transFn:p,crisp:!1}),f.drawGrid(r,t,{vals:h,layer:e.layers[i+"grid"],path:b,transFn:p,crisp:!1}),f.drawLabels(r,t,{vals:u,layer:s,transFn:p,labelFns:f.makeLabelFns(t,0,30)})};var C=k.MINZOOM/2+.87,I="m-0.87,.5h"+C+"v3h-"+(C+5.2)+"l"+(C/2+2.6)+",-"+(.87*C+4.5)+"l2.6,1.5l-"+C/2+","+.87*C+"Z",L="m0.87,.5h-"+C+"v3h"+(C+5.2)+"l-"+(C/2+2.6)+",-"+(.87*C+4.5)+"l-2.6,1.5l"+C/2+","+.87*C+"Z",P="m0,1l"+C/2+","+.87*C+"l2.6,-1.5l-"+(C/2+2.6)+",-"+(.87*C+4.5)+"l-"+(C/2+2.6)+","+(.87*C+4.5)+"l2.6,1.5l"+C/2+",-"+.87*C+"Z",z=!0;function D(t){r.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}S.clearOutline=function(){A(this.dragOptions),T(this.dragOptions.gd)},S.initInteractions=function(){var t,e,r,u,h,p,f,g,x,_,T,A,M=this,S=M.layers.plotbg.select("path").node(),C=M.graphDiv,O=C._fullLayout._zoomlayer;function R(t){var e={};return e[M.id+".aaxis.min"]=t.a,e[M.id+".baxis.min"]=t.b,e[M.id+".caxis.min"]=t.c,e}function F(t,e){var r=C._fullLayout.clickmode;D(C),2===t&&(C.emit("plotly_doubleclick",null),i.call("_guiRelayout",C,R({a:0,b:0,c:0}))),r.indexOf("select")>-1&&1===t&&w(e,C,[M.xaxis],[M.yaxis],M.id,M.dragOptions),r.indexOf("event")>-1&&m.click(C,e,M.id)}function B(t,e){return 1-e/M.h}function j(t,e){return 1-(t+(M.h-e)/Math.sqrt(3))/M.w}function N(t,e){return(t-(M.h-e)/Math.sqrt(3))/M.w}function U(n,i){var a=r+n*t,o=u+i*e,s=Math.max(0,Math.min(1,B(0,u),B(0,o))),l=Math.max(0,Math.min(1,j(r,u),j(a,o))),c=Math.max(0,Math.min(1,N(r,u),N(a,o))),d=(s/2+c)*M.w,m=(1-s/2-l)*M.w,y=(d+m)/2,v=m-d,b=(1-s)*M.h,w=b-v/E;v.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),A.transition().style("opacity",1).duration(200),_=!0),C.emit("plotly_relayouting",R(f))}function V(){D(C),f!==h&&(i.call("_guiRelayout",C,R(f)),z&&C.data&&C._context.showTips&&(a.notifier(s(C,"Double-click to zoom back out"),"long"),z=!1))}function q(t,e){var r=t/M.xaxis._m,n=e/M.yaxis._m,i=[(f={a:h.a-n,b:h.b+(r+n)/2,c:h.c-(r-n)/2}).a,f.b,f.c].sort(a.sorterAsc),s=i.indexOf(f.a),l=i.indexOf(f.b),u=i.indexOf(f.c);i[0]<0&&(i[1]+i[0]/2<0?(i[2]+=i[0]+i[1],i[0]=i[1]=0):(i[2]+=i[0]/2,i[1]+=i[0]/2,i[0]=0),f={a:i[s],b:i[l],c:i[u]},e=(h.a-f.a)*M.yaxis._m,t=(h.c-f.c-h.b+f.b)*M.xaxis._m);var p=o(M.x0+t,M.y0+e);M.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",p);var d=o(-t,-e);M.clipDefRelative.select("path").attr("transform",d),M.aaxis.range=[f.a,M.sum-f.b-f.c],M.baxis.range=[M.sum-f.a-f.c,f.b],M.caxis.range=[M.sum-f.a-f.b,f.c],M.drawAxes(!1),M._hasClipOnAxisFalse&&M.plotContainer.select(".scatterlayer").selectAll(".trace").call(c.hideOutsideRangePoints,M),C.emit("plotly_relayouting",R(f))}function H(){i.call("_guiRelayout",C,R(f))}this.dragOptions={element:S,gd:C,plotinfo:{id:M.id,domain:C._fullLayout[M.id].domain,xaxis:M.xaxis,yaxis:M.yaxis},subplot:M.id,prepFn:function(i,s,c){M.dragOptions.xaxes=[M.xaxis],M.dragOptions.yaxes=[M.yaxis],t=C._fullLayout._invScaleX,e=C._fullLayout._invScaleY;var d=M.dragOptions.dragmode=C._fullLayout.dragmode;y(d)?M.dragOptions.minDrag=1:M.dragOptions.minDrag=void 0,"zoom"===d?(M.dragOptions.moveFn=U,M.dragOptions.clickFn=F,M.dragOptions.doneFn=V,function(t,e,i){var s=S.getBoundingClientRect();r=e-s.left,u=i-s.top,C._fullLayout._calcInverseTransform(C);var c=C._fullLayout._invTransform,d=a.apply3DTransform(c)(r,u);r=d[0],u=d[1],h={a:M.aaxis.range[0],b:M.baxis.range[1],c:M.caxis.range[1]},f=h,p=M.aaxis.range[1]-h.a,g=n(M.graphDiv._fullLayout[M.id].bgcolor).getLuminance(),x="M0,"+M.h+"L"+M.w/2+", 0L"+M.w+","+M.h+"Z",_=!1,T=O.append("path").attr("class","zoombox").attr("transform",o(M.x0,M.y0)).style({fill:g>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",x),A=O.append("path").attr("class","zoombox-corners").attr("transform",o(M.x0,M.y0)).style({fill:l.background,stroke:l.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),M.clearOutline(C)}(0,s,c)):"pan"===d?(M.dragOptions.moveFn=q,M.dragOptions.clickFn=F,M.dragOptions.doneFn=H,h={a:M.aaxis.range[0],b:M.baxis.range[1],c:M.caxis.range[1]},f=h,M.clearOutline(C)):(v(d)||y(d))&&b(i,s,c,M.dragOptions,d)}},S.onmousemove=function(t){m.hover(C,t,M.id),C._fullLayout._lasthover=S,C._fullLayout._hoversubplot=M.id},S.onmouseout=function(t){C._dragging||d.unhover(C,t)},d.init(this.dragOptions)}}}),qs=f({"src/plots/ternary/layout_attributes.js"(t,e){var r=q(),n=Aa().attributes,i=Ie(),a=Pt().overrideAll,o=R().extendFlat,s={title:{text:i.title.text,font:i.title.font},color:i.color,tickmode:i.minor.tickmode,nticks:o({},i.nticks,{dflt:6,min:1}),tick0:i.tick0,dtick:i.dtick,tickvals:i.tickvals,ticktext:i.ticktext,ticks:i.ticks,ticklen:i.ticklen,tickwidth:i.tickwidth,tickcolor:i.tickcolor,ticklabelstep:i.ticklabelstep,showticklabels:i.showticklabels,labelalias:i.labelalias,showtickprefix:i.showtickprefix,tickprefix:i.tickprefix,showticksuffix:i.showticksuffix,ticksuffix:i.ticksuffix,showexponent:i.showexponent,exponentformat:i.exponentformat,minexponent:i.minexponent,separatethousands:i.separatethousands,tickfont:i.tickfont,tickangle:i.tickangle,tickformat:i.tickformat,tickformatstops:i.tickformatstops,hoverformat:i.hoverformat,showline:o({},i.showline,{dflt:!0}),linecolor:i.linecolor,linewidth:i.linewidth,showgrid:o({},i.showgrid,{dflt:!0}),gridcolor:i.gridcolor,gridwidth:i.gridwidth,griddash:i.griddash,layer:i.layer,min:{valType:"number",dflt:0,min:0}},l=e.exports=a({domain:n({name:"ternary"}),bgcolor:{valType:"color",dflt:r.background},sum:{valType:"number",dflt:1,min:0},aaxis:s,baxis:s,caxis:s},"plot","from-root");l.uirevision={valType:"any",editType:"none"},l.aaxis.uirevision=l.baxis.uirevision=l.caxis.uirevision={valType:"any",editType:"none"}}}),Hs=f({"src/plots/subplot_defaults.js"(t,e){var r=le(),n=ye(),i=Aa().defaults;e.exports=function(t,e,a,o){var s,l,c=o.type,u=o.attributes,h=o.handleDefaults,p=o.partition||"x",f=e._subplots[c],d=f.length,m=d&&f[0].replace(/\d+$/,"");function g(t,e){return r.coerce(s,l,u,t,e)}for(var y=0;y=s&&(f.min=0,m.min=0,g.min=0,t.aaxis&&delete t.aaxis.min,t.baxis&&delete t.baxis.min,t.caxis&&delete t.caxis.min)}function d(t,e,r,n){var a=h[e._name];function p(r,n){return i.coerce(t,e,a,r,n)}p("uirevision",n.uirevision),e.type="linear";var f=p("color"),d=f!==a.color.dflt?f:r.font.color,m=e._name.charAt(0).toUpperCase(),g="Component "+m,y=p("title.text",g);e._hovertitle=y===g?y:m,i.coerceFont(p,"title.font",r.font,{overrideDflt:{size:i.bigFont(r.font.size),color:d}}),p("min"),c(t,e,p,"linear"),s(t,e,p,"linear"),o(t,e,p,"linear",{noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0}),l(t,e,p,{outerTicks:!0}),p("showticklabels")&&(i.coerceFont(p,"tickfont",r.font,{overrideDflt:{color:d}}),p("tickangle"),p("tickformat")),u(t,e,p,{dfltColor:f,bgColor:r.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:a}),p("hoverformat"),p("layer")}e.exports=function(t,e,r){a(t,e,r,{type:"ternary",attributes:h,handleDefaults:f,font:e.font,paper_bgcolor:e.paper_bgcolor})}}}),Ws=f({"src/plots/ternary/index.js"(t){var e=Vs(),r=we().getSubplotCalcData,n=le().counterRegex,i="ternary";t.name=i;var a=t.attr="subplot";t.idRoot=i,t.idRegex=t.attrRegex=n(i),(t.attributes={})[a]={valType:"subplotid",dflt:"ternary",editType:"calc"},t.layoutAttributes=qs(),t.supplyLayoutDefaults=Gs(),t.plot=function(t){for(var n=t._fullLayout,a=t.calcdata,o=n._subplots[i],s=0;s0){var _,b,w,T,A,k=t.xa,M=t.ya;"h"===d.orientation?(A=e,_="y",w=M,b="x",T=k):(A=s,_="x",w=k,b="y",T=M);var S=f[t.index];if(A>=S.span[0]&&A<=S.span[1]){var E=n.extendFlat({},t),C=T.c2p(A,!0),I=o.getKdeValue(S,d,A),L=o.getPositionOnKdePath(S,d,C),P=w._offset,z=w._length;E[_+"0"]=L[0],E[_+"1"]=L[1],E[b+"0"]=E[b+"1"]=C,E[b+"Label"]=b+": "+i.hoverLabelText(T,A,d[b+"hoverformat"])+", "+f[0].t.labels.kde+" "+I.toFixed(3);for(var D=0,O=0;O path").each((function(t){if(!t.isBlank){var e=s.marker;r.select(this).call(i.fill,t.mc||e.color).call(i.stroke,t.mlc||e.line.color).call(n.dashLine,e.line.dash,t.mlw||e.line.width).style("opacity",s.selectedpoints&&!t.selected?a:1)}})),l(o,s,t),o.selectAll(".regions").each((function(){r.select(this).selectAll("path").style("stroke-width",0).call(i.fill,s.connector.fillcolor)})),o.selectAll(".lines").each((function(){var t=s.connector.line;n.lineGroupStyle(r.select(this).selectAll("path"),t.width,t.color,t.dash)}))}))}}}}),vl=f({"src/traces/funnel/hover.js"(t,e){var r=H().opacity,n=ro().hoverOnBars,i=le().formatPercent;e.exports=function(t,e,a,o,s){var l=n(t,e,a,o,s);if(l){var c=l.cd,u=c[0].trace,h="h"===u.orientation,p=c[l.index];l[(h?"x":"y")+"LabelVal"]=p.s,l.percentInitial=p.begR,l.percentInitialLabel=i(p.begR,1),l.percentPrevious=p.difR,l.percentPreviousLabel=i(p.difR,1),l.percentTotal=p.sumR,l.percentTotalLabel=i(p.sumR,1);var f=p.hi||u.hoverinfo,d=[];if(f&&"none"!==f&&"skip"!==f){var m="all"===f,g=f.split("+"),y=function(t){return m||-1!==g.indexOf(t)};y("percent initial")&&d.push(l.percentInitialLabel+" of initial"),y("percent previous")&&d.push(l.percentPreviousLabel+" of previous"),y("percent total")&&d.push(l.percentTotalLabel+" of total")}return l.extraText=d.join("
"),l.color=function(t,e){var n=t.marker,i=e.mc||n.color,a=e.mlc||n.line.color,o=e.mlw||n.line.width;return r(i)?i:r(a)&&o?a:void 0}(u,p),[l]}}}}),xl=f({"src/traces/funnel/event_data.js"(t,e){e.exports=function(t,e){return t.x="xVal"in e?e.xVal:e.x,t.y="yVal"in e?e.yVal:e.y,"percentInitial"in e&&(t.percentInitial=e.percentInitial),"percentPrevious"in e&&(t.percentPrevious=e.percentPrevious),"percentTotal"in e&&(t.percentTotal=e.percentTotal),e.xa&&(t.xaxis=e.xa),e.ya&&(t.yaxis=e.ya),t}}}),_l=f({"src/traces/funnel/index.js"(t,e){e.exports={attributes:ll(),layoutAttributes:cl(),supplyDefaults:ul().supplyDefaults,crossTraceDefaults:ul().crossTraceDefaults,supplyLayoutDefaults:hl(),calc:fl(),crossTraceCalc:dl(),plot:ml(),style:yl().style,hoverPoints:vl(),eventData:xl(),selectPoints:io(),moduleType:"trace",name:"funnel",basePlotModule:Si(),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}}}),bl=f({"lib/funnel.js"(t,e){e.exports=_l()}}),wl=f({"src/traces/waterfall/constants.js"(t,e){e.exports={eventDataKeys:["initial","delta","final"]}}}),Tl=f({"src/traces/waterfall/attributes.js"(t,e){var r=Ga(),n=Tn().line,i=U(),a=Ce().axisHoverFormat,o=Ot().hovertemplateAttrs,s=Ot().texttemplateAttrs,l=wl(),c=R().extendFlat,u=H();function h(t){return{marker:{color:c({},r.marker.color,{arrayOk:!1,editType:"style"}),line:{color:c({},r.marker.line.color,{arrayOk:!1,editType:"style"}),width:c({},r.marker.line.width,{arrayOk:!1,editType:"style"}),editType:"style"},editType:"style"},editType:"style"}}e.exports={measure:{valType:"data_array",dflt:[],editType:"calc"},base:{valType:"number",dflt:null,arrayOk:!1,editType:"calc"},x:r.x,x0:r.x0,dx:r.dx,y:r.y,y0:r.y0,dy:r.dy,xperiod:r.xperiod,yperiod:r.yperiod,xperiod0:r.xperiod0,yperiod0:r.yperiod0,xperiodalignment:r.xperiodalignment,yperiodalignment:r.yperiodalignment,xhoverformat:a("x"),yhoverformat:a("y"),hovertext:r.hovertext,hovertemplate:o({},{keys:l.eventDataKeys}),hoverinfo:c({},i.hoverinfo,{flags:["name","x","y","text","initial","delta","final"]}),textinfo:{valType:"flaglist",flags:["label","text","initial","delta","final"],extras:["none"],editType:"plot",arrayOk:!1},texttemplate:s({editType:"plot"},{keys:l.eventDataKeys.concat(["label"])}),text:r.text,textposition:r.textposition,insidetextanchor:r.insidetextanchor,textangle:r.textangle,textfont:r.textfont,insidetextfont:r.insidetextfont,outsidetextfont:r.outsidetextfont,constraintext:r.constraintext,cliponaxis:r.cliponaxis,orientation:r.orientation,offset:r.offset,width:r.width,increasing:h(),decreasing:h(),totals:h(),connector:{line:{color:c({},n.color,{dflt:u.defaultLine}),width:c({},n.width,{editType:"plot"}),dash:n.dash,editType:"plot"},mode:{valType:"enumerated",values:["spanning","between"],dflt:"between",editType:"plot"},visible:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},offsetgroup:r.offsetgroup,alignmentgroup:r.alignmentgroup,zorder:r.zorder}}}),Al=f({"src/traces/waterfall/layout_attributes.js"(t,e){e.exports={waterfallmode:{valType:"enumerated",values:["group","overlay"],dflt:"group",editType:"calc"},waterfallgap:{valType:"number",min:0,max:1,editType:"calc"},waterfallgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}}}),kl=f({"src/constants/delta.js"(t,e){e.exports={INCREASING:{COLOR:"#3D9970",SYMBOL:"▲"},DECREASING:{COLOR:"#FF4136",SYMBOL:"▼"}}}}),Ml=f({"src/traces/waterfall/defaults.js"(t,e){var r=le(),n=Qn(),i=Ya().handleText,a=Hn(),o=Gn(),s=Tl(),l=H(),c=kl(),u=c.INCREASING.COLOR,h=c.DECREASING.COLOR;function p(t,e,r){t(e+".marker.color",r),t(e+".marker.line.color",l.defaultLine),t(e+".marker.line.width")}e.exports={supplyDefaults:function(t,e,n,l){function c(n,i){return r.coerce(t,e,s,n,i)}if(a(t,e,l,c)){o(t,e,l,c),c("xhoverformat"),c("yhoverformat"),c("measure"),c("orientation",e.x&&!e.y?"h":"v"),c("base"),c("offset"),c("width"),c("text"),c("hovertext"),c("hovertemplate");var f=c("textposition");i(t,e,l,c,f,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),"none"!==e.textposition&&(c("texttemplate"),e.texttemplate||c("textinfo")),p(c,"increasing",u),p(c,"decreasing",h),p(c,"totals","#4499FF"),c("connector.visible")&&(c("connector.mode"),c("connector.line.width")&&(c("connector.line.color"),c("connector.line.dash"))),c("zorder")}else e.visible=!1},crossTraceDefaults:function(t,e){var i,a;function o(t){return r.coerce(a._input,a,s,t)}if("group"===e.waterfallmode)for(var l=0;l0&&(g+=p?"M"+h[0]+","+d[1]+"V"+d[0]:"M"+h[1]+","+d[0]+"H"+h[0]),"between"!==f&&(o.isSum||s path").each((function(t){if(!t.isBlank){var e=s[t.dir].marker;r.select(this).call(i.fill,e.color).call(i.stroke,e.line.color).call(n.dashLine,e.line.dash,e.line.width).style("opacity",s.selectedpoints&&!t.selected?a:1)}})),l(o,s,t),o.selectAll(".lines").each((function(){var t=s.connector.line;n.lineGroupStyle(r.select(this).selectAll("path"),t.width,t.color,t.dash)}))}))}}}}),Pl=f({"src/traces/waterfall/hover.js"(t,e){var r=ir().hoverLabelText,n=H().opacity,i=ro().hoverOnBars,a=kl(),o=a.INCREASING.SYMBOL,s=a.DECREASING.SYMBOL;e.exports=function(t,e,a,l,c){var u=i(t,e,a,l,c);if(u){var h=u.cd,p=h[0].trace,f="h"===p.orientation,d=f?"x":"y",m=f?t.xa:t.ya,g=h[u.index],y=g.isSum?g.b+g.s:g.rawS;u.initial=g.b+g.s-y,u.delta=y,u.final=u.initial+u.delta;var v=A(Math.abs(u.delta));u.deltaLabel=y<0?"("+v+")":v,u.finalLabel=A(u.final),u.initialLabel=A(u.initial);var x=g.hi||p.hoverinfo,_=[];if(x&&"none"!==x&&"skip"!==x){var b="all"===x,w=x.split("+"),T=function(t){return b||-1!==w.indexOf(t)};g.isSum||(T("final")&&(f?!T("x"):!T("y"))&&_.push(u.finalLabel),T("delta")&&(y<0?_.push(u.deltaLabel+" "+s):_.push(u.deltaLabel+" "+o)),T("initial")&&_.push("Initial: "+u.initialLabel))}return _.length&&(u.extraText=_.join("
")),u.color=function(t,e){var r=t[e.dir].marker,i=r.color,a=r.line.color,o=r.line.width;return n(i)?i:n(a)&&o?a:void 0}(p,g),[u]}function A(t){return r(m,t,p[d+"hoverformat"])}}}}),zl=f({"src/traces/waterfall/event_data.js"(t,e){e.exports=function(t,e){return t.x="xVal"in e?e.xVal:e.x,t.y="yVal"in e?e.yVal:e.y,"initial"in e&&(t.initial=e.initial),"delta"in e&&(t.delta=e.delta),"final"in e&&(t.final=e.final),e.xa&&(t.xaxis=e.xa),e.ya&&(t.yaxis=e.ya),t}}}),Dl=f({"src/traces/waterfall/index.js"(t,e){e.exports={attributes:Tl(),layoutAttributes:Al(),supplyDefaults:Ml().supplyDefaults,crossTraceDefaults:Ml().crossTraceDefaults,supplyLayoutDefaults:Sl(),calc:El(),crossTraceCalc:Cl(),plot:Il(),style:Ll().style,hoverPoints:Pl(),eventData:zl(),selectPoints:io(),moduleType:"trace",name:"waterfall",basePlotModule:Si(),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}}}),Ol=f({"lib/waterfall.js"(t,e){e.exports=Dl()}}),Rl=f({"src/traces/image/constants.js"(t,e){e.exports={colormodel:{rgb:{min:[0,0,0],max:[255,255,255],fmt:function(t){return t.slice(0,3)},suffix:["","",""]},rgba:{min:[0,0,0,0],max:[255,255,255,1],fmt:function(t){return t.slice(0,4)},suffix:["","","",""]},rgba256:{colormodel:"rgba",zminDflt:[0,0,0,0],zmaxDflt:[255,255,255,255],min:[0,0,0,0],max:[255,255,255,1],fmt:function(t){return t.slice(0,4)},suffix:["","","",""]},hsl:{min:[0,0,0],max:[360,100,100],fmt:function(t){var e=t.slice(0,3);return e[1]=e[1]+"%",e[2]=e[2]+"%",e},suffix:["°","%","%"]},hsla:{min:[0,0,0,0],max:[360,100,100,1],fmt:function(t){var e=t.slice(0,4);return e[1]=e[1]+"%",e[2]=e[2]+"%",e},suffix:["°","%","%",""]}}}}}),Fl=f({"src/traces/image/attributes.js"(t,e){var r,n,i=U(),a=Tn().zorder,o=Ot().hovertemplateAttrs,s=R().extendFlat,l=Rl().colormodel,c=["rgb","rgba","rgba256","hsl","hsla"],u=[],h=[];for(n=0;n0?s-4:s;for(r=0;r>16&255,c[u++]=e>>8&255,c[u++]=255&e;return 2===l&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,c[u++]=255&e),1===l&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,c[u++]=e>>8&255,c[u++]=255&e),c},t.fromByteArray=function(t){for(var e,n=t.length,i=n%3,a=[],o=16383,s=0,c=n-i;sc?c:s+o));return 1===i?(e=t[n-1],a.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],a.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),a.join("")};var e,r=[],n=[],i=typeof Uint8Array<"u"?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(e=0;e<64;++e)r[e]=a[e],n[a.charCodeAt(e)]=e;function o(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function s(t){return r[t>>18&63]+r[t>>12&63]+r[t>>6&63]+r[63&t]}function l(t,e,r){for(var n,i=[],a=e;a>1,u=-7,h=r?i-1:0,p=r?-1:1,f=t[e+h];for(h+=p,a=f&(1<<-u)-1,f>>=-u,u+=s;u>0;a=256*a+t[e+h],h+=p,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=n;u>0;o=256*o+t[e+h],h+=p,u-=8);if(0===a)a=1-c;else{if(a===l)return o?NaN:1/0*(f?-1:1);o+=Math.pow(2,n),a-=c}return(f?-1:1)*o*Math.pow(2,a-n)},t.write=function(t,e,r,n,i,a){var o,s,l,c=8*a-i-1,u=(1<>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:a-1,d=n?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=u):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),(e+=o+h>=1?p/l:p*Math.pow(2,1-h))*l>=2&&(o++,l/=2),o+h>=u?(s=0,o=u):o+h>=1?(s=(e*l-1)*Math.pow(2,i),o+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;t[r+f]=255&s,f+=d,s/=256,i-=8);for(o=o<0;t[r+f]=255&o,f+=d,o/=256,c-=8);t[r+f-d]|=128*m}}}),ql=f({"node_modules/buffer/index.js"(t){var e=Ul(),r=Vl(),n="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=o,t.SlowBuffer=function(t){return+t!=t&&(t=0),o.alloc(+t)},t.INSPECT_MAX_BYTES=50;var i=2147483647;function a(t){if(t>i)throw new RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,o.prototype),e}function o(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return c(t)}return s(t,e,r)}function s(t,e,r){if("string"==typeof t)return function(t,e){if(("string"!=typeof e||""===e)&&(e="utf8"),!o.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let r=0|f(t,e),n=a(r),i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(Z(t,Uint8Array)){let e=new Uint8Array(t);return h(e.buffer,e.byteOffset,e.byteLength)}return u(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(Z(t,ArrayBuffer)||t&&Z(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Z(t,SharedArrayBuffer)||t&&Z(t.buffer,SharedArrayBuffer)))return h(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');let n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return o.from(n,e,r);let i=function(t){if(o.isBuffer(t)){let e=0|p(t.length),r=a(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||Y(t.length)?a(0):u(t):"Buffer"===t.type&&Array.isArray(t.data)?u(t.data):void 0}(t);if(i)return i;if(typeof Symbol<"u"&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return o.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function l(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function c(t){return l(t),a(t<0?0:0|p(t))}function u(t){let e=t.length<0?0:0|p(t.length),r=a(e);for(let n=0;n=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return 0|t}function f(t,e){if(o.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||Z(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);let r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return H(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return G(t).length;default:if(i)return n?-1:H(t).length;e=(""+e).toLowerCase(),i=!0}}function d(t,e,r){let n=!1;if((void 0===e||e<0)&&(e=0),e>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0)||(r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return E(this,e,r);case"utf8":case"utf-8":return A(this,e,r);case"ascii":return M(this,e,r);case"latin1":case"binary":return S(this,e,r);case"base64":return T(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function m(t,e,r){let n=t[e];t[e]=t[r],t[r]=n}function g(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Y(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=o.from(e,n)),o.isBuffer(e))return 0===e.length?-1:y(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):y(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function y(t,e,r,n,i){let a,o=1,s=t.length,l=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;o=2,s/=2,l/=2,r/=2}function c(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(i){let n=-1;for(a=r;as&&(r=s-l),a=r;a>=0;a--){let r=!0;for(let n=0;ni&&(n=i):n=i;let a,o=e.length;for(n>o/2&&(n=o/2),a=0;a>8,i=r%256,a.push(i),a.push(n);return a}(e,t.length-r),t,r,n)}function T(t,r,n){return 0===r&&n===t.length?e.fromByteArray(t):e.fromByteArray(t.slice(r,n))}function A(t,e,r){r=Math.min(t.length,r);let n=[],i=e;for(;i239?4:e>223?3:e>191?2:1;if(i+o<=r){let r,n,s,l;switch(o){case 1:e<128&&(a=e);break;case 2:r=t[i+1],128==(192&r)&&(l=(31&e)<<6|63&r,l>127&&(a=l));break;case 3:r=t[i+1],n=t[i+2],128==(192&r)&&128==(192&n)&&(l=(15&e)<<12|(63&r)<<6|63&n,l>2047&&(l<55296||l>57343)&&(a=l));break;case 4:r=t[i+1],n=t[i+2],s=t[i+3],128==(192&r)&&128==(192&n)&&128==(192&s)&&(l=(15&e)<<18|(63&r)<<12|(63&n)<<6|63&s,l>65535&&l<1114112&&(a=l))}}null===a?(a=65533,o=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|1023&a),n.push(a),i+=o}return function(t){let e=t.length;if(e<=k)return String.fromCharCode.apply(String,t);let r="",n=0;for(;nn.length?(o.isBuffer(e)||(e=o.from(e)),e.copy(n,i)):Uint8Array.prototype.set.call(n,e,i);else{if(!o.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(n,i)}i+=e.length}return n},o.byteLength=f,o.prototype._isBuffer=!0,o.prototype.swap16=function(){let t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;er&&(e+=" ... "),""},n&&(o.prototype[n]=o.prototype.inspect),o.prototype.compare=function(t,e,r,n,i){if(Z(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),!o.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;let a=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0),l=Math.min(a,s),c=this.slice(n,i),u=t.slice(e,r);for(let t=0;t>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}let i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let a=!1;for(;;)switch(n){case"hex":return v(this,t,e,r);case"utf8":case"utf-8":return x(this,t,e,r);case"ascii":case"latin1":case"binary":return _(this,t,e,r);case"base64":return b(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w(this,t,e,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var k=4096;function M(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;in)&&(r=n);let i="";for(let n=e;nr)throw new RangeError("Trying to access beyond buffer length")}function L(t,e,r,n,i,a){if(!o.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function P(t,e,r,n,i){N(e,n,i,t,r,7);let a=Number(e&BigInt(4294967295));t[r++]=a,a>>=8,t[r++]=a,a>>=8,t[r++]=a,a>>=8,t[r++]=a;let o=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,r}function z(t,e,r,n,i){N(e,n,i,t,r,7);let a=Number(e&BigInt(4294967295));t[r+7]=a,a>>=8,t[r+6]=a,a>>=8,t[r+5]=a,a>>=8,t[r+4]=a;let o=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=o,o>>=8,t[r+2]=o,o>>=8,t[r+1]=o,o>>=8,t[r]=o,r+8}function D(t,e,r,n,i,a){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function O(t,e,n,i,a){return e=+e,n>>>=0,a||D(t,0,n,4),r.write(t,e,n,i,23,4),n+4}function R(t,e,n,i,a){return e=+e,n>>>=0,a||D(t,0,n,8),r.write(t,e,n,i,52,8),n+8}o.prototype.slice=function(t,e){let r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||I(t,e,this.length);let n=this[t],i=1,a=0;for(;++a>>=0,e>>>=0,r||I(t,e,this.length);let n=this[t+--e],i=1;for(;e>0&&(i*=256);)n+=this[t+--e]*i;return n},o.prototype.readUint8=o.prototype.readUInt8=function(t,e){return t>>>=0,e||I(t,1,this.length),this[t]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(t,e){return t>>>=0,e||I(t,2,this.length),this[t]|this[t+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(t,e){return t>>>=0,e||I(t,2,this.length),this[t]<<8|this[t+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(t,e){return t>>>=0,e||I(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(t,e){return t>>>=0,e||I(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},o.prototype.readBigUInt64LE=$((function(t){U(t>>>=0,"offset");let e=this[t],r=this[t+7];(void 0===e||void 0===r)&&V(t,this.length-8);let n=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,i=this[++t]+256*this[++t]+65536*this[++t]+r*2**24;return BigInt(n)+(BigInt(i)<>>=0,"offset");let e=this[t],r=this[t+7];(void 0===e||void 0===r)&&V(t,this.length-8);let n=e*2**24+65536*this[++t]+256*this[++t]+this[++t],i=this[++t]*2**24+65536*this[++t]+256*this[++t]+r;return(BigInt(n)<>>=0,e>>>=0,r||I(t,e,this.length);let n=this[t],i=1,a=0;for(;++a=i&&(n-=Math.pow(2,8*e)),n},o.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||I(t,e,this.length);let n=e,i=1,a=this[t+--n];for(;n>0&&(i*=256);)a+=this[t+--n]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*e)),a},o.prototype.readInt8=function(t,e){return t>>>=0,e||I(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},o.prototype.readInt16LE=function(t,e){t>>>=0,e||I(t,2,this.length);let r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt16BE=function(t,e){t>>>=0,e||I(t,2,this.length);let r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt32LE=function(t,e){return t>>>=0,e||I(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},o.prototype.readInt32BE=function(t,e){return t>>>=0,e||I(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},o.prototype.readBigInt64LE=$((function(t){U(t>>>=0,"offset");let e=this[t],r=this[t+7];(void 0===e||void 0===r)&&V(t,this.length-8);let n=this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24);return(BigInt(n)<>>=0,"offset");let e=this[t],r=this[t+7];(void 0===e||void 0===r)&&V(t,this.length-8);let n=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(n)<>>=0,e||I(t,4,this.length),r.read(this,t,!0,23,4)},o.prototype.readFloatBE=function(t,e){return t>>>=0,e||I(t,4,this.length),r.read(this,t,!1,23,4)},o.prototype.readDoubleLE=function(t,e){return t>>>=0,e||I(t,8,this.length),r.read(this,t,!0,52,8)},o.prototype.readDoubleBE=function(t,e){return t>>>=0,e||I(t,8,this.length),r.read(this,t,!1,52,8)},o.prototype.writeUintLE=o.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||L(this,t,e,r,Math.pow(2,8*r)-1,0);let i=1,a=0;for(this[e]=255&t;++a>>=0,r>>>=0,n||L(this,t,e,r,Math.pow(2,8*r)-1,0);let i=r-1,a=1;for(this[e+i]=255&t;--i>=0&&(a*=256);)this[e+i]=t/a&255;return e+r},o.prototype.writeUint8=o.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,1,255,0),this[e]=255&t,e+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},o.prototype.writeBigUInt64LE=$((function(t,e=0){return P(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),o.prototype.writeBigUInt64BE=$((function(t,e=0){return z(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),o.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){let n=Math.pow(2,8*r-1);L(this,t,e,r,n-1,-n)}let i=0,a=1,o=0;for(this[e]=255&t;++i>>=0,!n){let n=Math.pow(2,8*r-1);L(this,t,e,r,n-1,-n)}let i=r-1,a=1,o=0;for(this[e+i]=255&t;--i>=0&&(a*=256);)t<0&&0===o&&0!==this[e+i+1]&&(o=1),this[e+i]=(t/a|0)-o&255;return e+r},o.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},o.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},o.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},o.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},o.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},o.prototype.writeBigInt64LE=$((function(t,e=0){return P(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),o.prototype.writeBigInt64BE=$((function(t,e=0){return z(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),o.prototype.writeFloatLE=function(t,e,r){return O(this,t,e,!0,r)},o.prototype.writeFloatBE=function(t,e,r){return O(this,t,e,!1,r)},o.prototype.writeDoubleLE=function(t,e,r){return R(this,t,e,!0,r)},o.prototype.writeDoubleBE=function(t,e,r){return R(this,t,e,!1,r)},o.prototype.copy=function(t,e,r,n){if(!o.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),!n&&0!==n&&(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function N(t,e,r,n,i,a){if(t>r||t3?0===e||e===BigInt(0)?`>= 0${i} and < 2${i} ** ${8*(a+1)}${i}`:`>= -(2${i} ** ${8*(a+1)-1}${i}) and < 2 ** ${8*(a+1)-1}${i}`:`>= ${e}${i} and <= ${r}${i}`,new F.ERR_OUT_OF_RANGE("value",n,t)}!function(t,e,r){U(e,"offset"),(void 0===t[e]||void 0===t[e+r])&&V(e,t.length-(r+1))}(n,i,a)}function U(t,e){if("number"!=typeof t)throw new F.ERR_INVALID_ARG_TYPE(e,"number",t)}function V(t,e,r){throw Math.floor(t)!==t?(U(t,r),new F.ERR_OUT_OF_RANGE(r||"offset","an integer",t)):e<0?new F.ERR_BUFFER_OUT_OF_BOUNDS:new F.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}B("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),B("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),B("ERR_OUT_OF_RANGE",(function(t,e,r){let n=`The value of "${t}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=j(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=j(i)),i+="n"),n+=` It must be ${e}. Received ${i}`,n}),RangeError);var q=/[^+/0-9A-Za-z-_]/g;function H(t,e){e=e||1/0;let r,n=t.length,i=null,a=[];for(let o=0;o55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(e-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;a.push(r)}else if(r<2048){if((e-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function G(t){return e.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(q,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function W(t,e,r,n){let i;for(i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function Z(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function Y(t){return t!=t}var X=function(){let t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){let n=16*r;for(let i=0;i<16;++i)e[n+i]=t[r]+t[i]}return e}();function $(t){return typeof BigInt>"u"?K:t}function K(){throw new Error("BigInt not supported")}}}),Hl=f({"node_modules/has-symbols/shams.js"(t,e){e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e||"[object Symbol]"!==Object.prototype.toString.call(e)||"[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length||"function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(t,e);if(42!==i.value||!0!==i.enumerable)return!1}return!0}}}),Gl=f({"node_modules/has-tostringtag/shams.js"(t,e){var r=Hl();e.exports=function(){return r()&&!!Symbol.toStringTag}}}),Wl=f({"node_modules/es-errors/index.js"(t,e){e.exports=Error}}),Zl=f({"node_modules/es-errors/eval.js"(t,e){e.exports=EvalError}}),Yl=f({"node_modules/es-errors/range.js"(t,e){e.exports=RangeError}}),Xl=f({"node_modules/es-errors/ref.js"(t,e){e.exports=ReferenceError}}),$l=f({"node_modules/es-errors/syntax.js"(t,e){e.exports=SyntaxError}}),Kl=f({"node_modules/es-errors/type.js"(t,e){e.exports=TypeError}}),Jl=f({"node_modules/es-errors/uri.js"(t,e){e.exports=URIError}}),Ql=f({"node_modules/has-symbols/index.js"(t,e){var r=typeof Symbol<"u"&&Symbol,n=Hl();e.exports=function(){return"function"==typeof r&&"function"==typeof Symbol&&"symbol"==typeof r("foo")&&"symbol"==typeof Symbol("bar")&&n()}}}),tc=f({"node_modules/has-proto/index.js"(t,e){var r={foo:{}},n=Object;e.exports=function(){return{__proto__:r}.foo===r.foo&&!({__proto__:null}instanceof n)}}}),ec=f({"node_modules/function-bind/implementation.js"(t,e){var r=Object.prototype.toString,n=Math.max,i=function(t,e){for(var r=[],n=0;n"u"||!y?r:y(Uint8Array),_={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?r:ArrayBuffer,"%ArrayIteratorPrototype%":m&&y?y([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":v,"%AsyncGenerator%":v,"%AsyncGeneratorFunction%":v,"%AsyncIteratorPrototype%":v,"%Atomics%":typeof Atomics>"u"?r:Atomics,"%BigInt%":typeof BigInt>"u"?r:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?r:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?r:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":n,"%eval%":eval,"%EvalError%":i,"%Float32Array%":typeof Float32Array>"u"?r:Float32Array,"%Float64Array%":typeof Float64Array>"u"?r:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?r:FinalizationRegistry,"%Function%":u,"%GeneratorFunction%":v,"%Int8Array%":typeof Int8Array>"u"?r:Int8Array,"%Int16Array%":typeof Int16Array>"u"?r:Int16Array,"%Int32Array%":typeof Int32Array>"u"?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":m&&y?y(y([][Symbol.iterator]())):r,"%JSON%":"object"==typeof JSON?JSON:r,"%Map%":typeof Map>"u"?r:Map,"%MapIteratorPrototype%":typeof Map>"u"||!m||!y?r:y((new Map)[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?r:Promise,"%Proxy%":typeof Proxy>"u"?r:Proxy,"%RangeError%":a,"%ReferenceError%":o,"%Reflect%":typeof Reflect>"u"?r:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?r:Set,"%SetIteratorPrototype%":typeof Set>"u"||!m||!y?r:y((new Set)[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":m&&y?y(""[Symbol.iterator]()):r,"%Symbol%":m?Symbol:r,"%SyntaxError%":s,"%ThrowTypeError%":d,"%TypedArray%":x,"%TypeError%":l,"%Uint8Array%":typeof Uint8Array>"u"?r:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?r:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?r:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?r:Uint32Array,"%URIError%":c,"%WeakMap%":typeof WeakMap>"u"?r:WeakMap,"%WeakRef%":typeof WeakRef>"u"?r:WeakRef,"%WeakSet%":typeof WeakSet>"u"?r:WeakSet};if(y)try{null.error}catch(t){b=y(y(t)),_["%Error.prototype%"]=b}var b,w=function t(e){var r;if("%AsyncFunction%"===e)r=h("async function () {}");else if("%GeneratorFunction%"===e)r=h("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=h("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var i=t("%AsyncGenerator%");i&&y&&(r=y(i.prototype))}return _[e]=r,r},T={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},A=rc(),k=nc(),M=A.call(Function.call,Array.prototype.concat),S=A.call(Function.apply,Array.prototype.splice),E=A.call(Function.call,String.prototype.replace),C=A.call(Function.call,String.prototype.slice),I=A.call(Function.call,RegExp.prototype.exec),L=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,P=/\\(\\)?/g,z=function(t,e){var r,n=t;if(k(T,n)&&(n="%"+(r=T[n])[0]+"%"),k(_,n)){var i=_[n];if(i===v&&(i=w(n)),typeof i>"u"&&!e)throw new l("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:i}}throw new s("intrinsic "+t+" does not exist!")};e.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new l("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new l('"allowMissing" argument must be a boolean');if(null===I(/^%?[^%]*%?$/,t))throw new s("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(t){var e=C(t,0,1),r=C(t,-1);if("%"===e&&"%"!==r)throw new s("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new s("invalid intrinsic syntax, expected opening `%`");var n=[];return E(t,L,(function(t,e,r,i){n[n.length]=r?E(i,P,"$1"):e||t})),n}(t),n=r.length>0?r[0]:"",i=z("%"+n+"%",e),a=i.name,o=i.value,c=!1,u=i.alias;u&&(n=u[0],S(r,M([0,1],u)));for(var h=1,f=!0;h=r.length){var y=p(o,d);o=(f=!!y)&&"get"in y&&!("originalValue"in y.get)?y.get:o[d]}else f=k(o,d),o=o[d];f&&!c&&(_[a]=o)}}return o}}}),ac=f({"node_modules/es-define-property/index.js"(t,e){var r=ic()("%Object.defineProperty%",!0)||!1;if(r)try{r({},"a",{value:1})}catch{r=!1}e.exports=r}}),oc=f({"node_modules/gopd/index.js"(t,e){var r=ic()("%Object.getOwnPropertyDescriptor%",!0);if(r)try{r([],"length")}catch{r=null}e.exports=r}}),sc=f({"node_modules/define-data-property/index.js"(t,e){var r=ac(),n=$l(),i=Kl(),a=oc();e.exports=function(t,e,o){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`obj` must be an object or a function`");if("string"!=typeof e&&"symbol"!=typeof e)throw new i("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new i("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new i("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new i("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new i("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,l=arguments.length>4?arguments[4]:null,c=arguments.length>5?arguments[5]:null,u=arguments.length>6&&arguments[6],h=!!a&&a(t,e);if(r)r(t,e,{configurable:null===c&&h?h.configurable:!c,enumerable:null===s&&h?h.enumerable:!s,value:o,writable:null===l&&h?h.writable:!l});else{if(!u&&(s||l||c))throw new n("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");t[e]=o}}}}),lc=f({"node_modules/has-property-descriptors/index.js"(t,e){var r=ac(),n=function(){return!!r};n.hasArrayLengthDefineBug=function(){if(!r)return null;try{return 1!==r([],"length",{value:1}).length}catch{return!0}},e.exports=n}}),cc=f({"node_modules/set-function-length/index.js"(t,e){var r=ic(),n=sc(),i=lc()(),a=oc(),o=Kl(),s=r("%Math.floor%");e.exports=function(t,e){if("function"!=typeof t)throw new o("`fn` is not a function");if("number"!=typeof e||e<0||e>4294967295||s(e)!==e)throw new o("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],l=!0,c=!0;if("length"in t&&a){var u=a(t,"length");u&&!u.configurable&&(l=!1),u&&!u.writable&&(c=!1)}return(l||c||!r)&&(i?n(t,"length",e,!0,!0):n(t,"length",e)),t}}}),uc=f({"node_modules/call-bind/index.js"(t,e){var r=rc(),n=ic(),i=cc(),a=Kl(),o=n("%Function.prototype.apply%"),s=n("%Function.prototype.call%"),l=n("%Reflect.apply%",!0)||r.call(s,o),c=ac(),u=n("%Math.max%");e.exports=function(t){if("function"!=typeof t)throw new a("a function is required");var e=l(r,s,arguments);return i(e,1+u(0,t.length-(arguments.length-1)),!0)};var h=function(){return l(r,o,arguments)};c?c(e.exports,"apply",{value:h}):e.exports.apply=h}}),hc=f({"node_modules/call-bind/callBound.js"(t,e){var r=ic(),n=uc(),i=n(r("String.prototype.indexOf"));e.exports=function(t,e){var a=r(t,!!e);return"function"==typeof a&&i(t,".prototype.")>-1?n(a):a}}}),pc=f({"node_modules/is-arguments/index.js"(t,e){var r=Gl()(),n=hc()("Object.prototype.toString"),i=function(t){return!(r&&t&&"object"==typeof t&&Symbol.toStringTag in t)&&"[object Arguments]"===n(t)},a=function(t){return!!i(t)||null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Array]"!==n(t)&&"[object Function]"===n(t.callee)},o=function(){return i(arguments)}();i.isLegacyArguments=a,e.exports=o?i:a}}),fc=f({"node_modules/is-generator-function/index.js"(t,e){var r,n=Object.prototype.toString,i=Function.prototype.toString,a=/^\s*(?:function)?\*/,o=Gl()(),s=Object.getPrototypeOf;e.exports=function(t){if("function"!=typeof t)return!1;if(a.test(i.call(t)))return!0;if(!o)return"[object GeneratorFunction]"===n.call(t);if(!s)return!1;if(typeof r>"u"){var e=function(){if(!o)return!1;try{return Function("return function*() {}")()}catch{}}();r=!!e&&s(e)}return s(t)===r}}}),dc=f({"node_modules/is-callable/index.js"(t,e){var r,n,i=Function.prototype.toString,a="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof a&&"function"==typeof Object.defineProperty)try{r=Object.defineProperty({},"length",{get:function(){throw n}}),n={},a((function(){throw 42}),null,r)}catch(t){t!==n&&(a=null)}else a=null;var o,s=/^\s*class\b/,l=function(t){try{var e=i.call(t);return s.test(e)}catch{return!1}},c=function(t){try{return!l(t)&&(i.call(t),!0)}catch{return!1}},u=Object.prototype.toString,h="function"==typeof Symbol&&!!Symbol.toStringTag,p=!(0 in[,]),f=function(){return!1};"object"==typeof document&&(o=document.all,u.call(o)===u.call(document.all)&&(f=function(t){if((p||!t)&&(typeof t>"u"||"object"==typeof t))try{var e=u.call(t);return("[object HTMLAllCollection]"===e||"[object HTML document.all class]"===e||"[object HTMLCollection]"===e||"[object Object]"===e)&&null==t("")}catch{}return!1})),e.exports=a?function(t){if(f(t))return!0;if(!t||"function"!=typeof t&&"object"!=typeof t)return!1;try{a(t,null,r)}catch(t){if(t!==n)return!1}return!l(t)&&c(t)}:function(t){if(f(t))return!0;if(!t||"function"!=typeof t&&"object"!=typeof t)return!1;if(h)return c(t);if(l(t))return!1;var e=u.call(t);return!("[object Function]"!==e&&"[object GeneratorFunction]"!==e&&!/^\[object HTML/.test(e))&&c(t)}}}),mc=f({"node_modules/for-each/index.js"(t,e){var r=dc(),n=Object.prototype.toString,i=Object.prototype.hasOwnProperty;e.exports=function(t,e,a){if(!r(e))throw new TypeError("iterator must be a function");var o;arguments.length>=3&&(o=a),"[object Array]"===n.call(t)?function(t,e,r){for(var n=0,a=t.length;n"u"?window:globalThis;e.exports=function(){for(var t=[],e=0;e"u"?window:globalThis,u=n(),h=a("String.prototype.slice"),p=Object.getPrototypeOf,f=a("Array.prototype.indexOf",!0)||function(t,e){for(var r=0;r-1?e:"Object"===e&&function(t){var e=!1;return r(d,(function(r,n){if(!e)try{r(t),e=h(n,1)}catch{}})),e}(t)}return o?function(t){var e=!1;return r(d,(function(r,n){if(!e)try{"$"+r(t)===n&&(e=h(n,1))}catch{}})),e}(t):null}}}),vc=f({"node_modules/is-typed-array/index.js"(t,e){var r=mc(),n=gc(),i=hc(),a=i("Object.prototype.toString"),o=Gl()(),s=oc(),l=typeof globalThis>"u"?window:globalThis,c=n(),u=i("Array.prototype.indexOf",!0)||function(t,e){for(var r=0;r-1}return!!s&&function(t){var e=!1;return r(p,(function(r,n){if(!e)try{e=r.call(t)===n}catch{}})),e}(t)}}}),xc=f({"node_modules/util/support/types.js"(t){var e=pc(),r=fc(),n=yc(),i=vc();function a(t){return t.call.bind(t)}var o,s,l=typeof BigInt<"u",c=typeof Symbol<"u",u=a(Object.prototype.toString),h=a(Number.prototype.valueOf),p=a(String.prototype.valueOf),f=a(Boolean.prototype.valueOf);function d(t,e){if("object"!=typeof t)return!1;try{return e(t),!0}catch{return!1}}function m(t){return"[object Map]"===u(t)}function g(t){return"[object Set]"===u(t)}function y(t){return"[object WeakMap]"===u(t)}function v(t){return"[object WeakSet]"===u(t)}function x(t){return"[object ArrayBuffer]"===u(t)}function _(t){return!(typeof ArrayBuffer>"u")&&(x.working?x(t):t instanceof ArrayBuffer)}function b(t){return"[object DataView]"===u(t)}function w(t){return!(typeof DataView>"u")&&(b.working?b(t):t instanceof DataView)}l&&(o=a(BigInt.prototype.valueOf)),c&&(s=a(Symbol.prototype.valueOf)),t.isArgumentsObject=e,t.isGeneratorFunction=r,t.isTypedArray=i,t.isPromise=function(t){return typeof Promise<"u"&&t instanceof Promise||null!==t&&"object"==typeof t&&"function"==typeof t.then&&"function"==typeof t.catch},t.isArrayBufferView=function(t){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(t):i(t)||w(t)},t.isUint8Array=function(t){return"Uint8Array"===n(t)},t.isUint8ClampedArray=function(t){return"Uint8ClampedArray"===n(t)},t.isUint16Array=function(t){return"Uint16Array"===n(t)},t.isUint32Array=function(t){return"Uint32Array"===n(t)},t.isInt8Array=function(t){return"Int8Array"===n(t)},t.isInt16Array=function(t){return"Int16Array"===n(t)},t.isInt32Array=function(t){return"Int32Array"===n(t)},t.isFloat32Array=function(t){return"Float32Array"===n(t)},t.isFloat64Array=function(t){return"Float64Array"===n(t)},t.isBigInt64Array=function(t){return"BigInt64Array"===n(t)},t.isBigUint64Array=function(t){return"BigUint64Array"===n(t)},m.working=typeof Map<"u"&&m(new Map),t.isMap=function(t){return!(typeof Map>"u")&&(m.working?m(t):t instanceof Map)},g.working=typeof Set<"u"&&g(new Set),t.isSet=function(t){return!(typeof Set>"u")&&(g.working?g(t):t instanceof Set)},y.working=typeof WeakMap<"u"&&y(new WeakMap),t.isWeakMap=function(t){return!(typeof WeakMap>"u")&&(y.working?y(t):t instanceof WeakMap)},v.working=typeof WeakSet<"u"&&v(new WeakSet),t.isWeakSet=function(t){return v(t)},x.working=typeof ArrayBuffer<"u"&&x(new ArrayBuffer),t.isArrayBuffer=_,b.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&b(new DataView(new ArrayBuffer(1),0,1)),t.isDataView=w;var T=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function A(t){return"[object SharedArrayBuffer]"===u(t)}function k(t){return!(typeof T>"u")&&(typeof A.working>"u"&&(A.working=A(new T)),A.working?A(t):t instanceof T)}function M(t){return d(t,h)}function S(t){return d(t,p)}function E(t){return d(t,f)}function C(t){return l&&d(t,o)}function I(t){return c&&d(t,s)}t.isSharedArrayBuffer=k,t.isAsyncFunction=function(t){return"[object AsyncFunction]"===u(t)},t.isMapIterator=function(t){return"[object Map Iterator]"===u(t)},t.isSetIterator=function(t){return"[object Set Iterator]"===u(t)},t.isGeneratorObject=function(t){return"[object Generator]"===u(t)},t.isWebAssemblyCompiledModule=function(t){return"[object WebAssembly.Module]"===u(t)},t.isNumberObject=M,t.isStringObject=S,t.isBooleanObject=E,t.isBigIntObject=C,t.isSymbolObject=I,t.isBoxedPrimitive=function(t){return M(t)||S(t)||E(t)||C(t)||I(t)},t.isAnyArrayBuffer=function(t){return typeof Uint8Array<"u"&&(_(t)||k(t))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(e){Object.defineProperty(t,e,{enumerable:!1,value:function(){throw new Error(e+" is not supported in userland")}})}))}}),_c=f({"node_modules/util/support/isBufferBrowser.js"(t,e){e.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}}}),bc=f({"(disabled):node_modules/util/util.js"(t){var e=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),r={},n=0;n=a)return t;switch(t){case"%s":return String(i[n++]);case"%d":return Number(i[n++]);case"%j":try{return JSON.stringify(i[n++])}catch{return"[Circular]"}default:return t}})),l=i[n];n"u")return function(){return t.deprecate(e,r).apply(this,arguments)};var n=!1;return function(){if(!n){if(c.throwDeprecation)throw new Error(r);c.traceDeprecation?console.trace(r):console.error(r),n=!0}return e.apply(this,arguments)}};var n,i={},a=/^$/;function o(e,r){var n={seen:[],stylize:l};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),d(r)?n.showHidden=r:r&&t._extend(n,r),v(n.showHidden)&&(n.showHidden=!1),v(n.depth)&&(n.depth=2),v(n.colors)&&(n.colors=!1),v(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=s),u(n,e,n.depth)}function s(t,e){var r=o.styles[e];return r?"["+o.colors[r][0]+"m"+t+"["+o.colors[r][1]+"m":t}function l(t,e){return t}function u(e,r,n){if(e.customInspect&&r&&T(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,e);return y(i)||(i=u(e,i,n)),i}var a=function(t,e){if(v(e))return t.stylize("undefined","undefined");if(y(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return g(e)?t.stylize(""+e,"number"):d(e)?t.stylize(""+e,"boolean"):m(e)?t.stylize("null","null"):void 0}(e,r);if(a)return a;var o=Object.keys(r),s=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(r)),w(r)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return h(r);if(0===o.length){if(T(r)){var l=r.name?": "+r.name:"";return e.stylize("[Function"+l+"]","special")}if(x(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(b(r))return e.stylize(Date.prototype.toString.call(r),"date");if(w(r))return h(r)}var c,_="",A=!1,k=["{","}"];return f(r)&&(A=!0,k=["[","]"]),T(r)&&(_=" [Function"+(r.name?": "+r.name:"")+"]"),x(r)&&(_=" "+RegExp.prototype.toString.call(r)),b(r)&&(_=" "+Date.prototype.toUTCString.call(r)),w(r)&&(_=" "+h(r)),0!==o.length||A&&0!=r.length?n<0?x(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),c=A?function(t,e,r,n,i){for(var a=[],o=0,s=e.length;o60?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}(c,_,k)):k[0]+_+k[1]}function h(t){return"["+Error.prototype.toString.call(t)+"]"}function p(t,e,r,n,i,a){var o,s,l;if((l=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?s=l.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):l.set&&(s=t.stylize("[Setter]","special")),S(n,i)||(o="["+i+"]"),s||(t.seen.indexOf(l.value)<0?(s=m(r)?u(t,l.value,null):u(t,l.value,r-1)).indexOf("\n")>-1&&(s=a?s.split("\n").map((function(t){return" "+t})).join("\n").slice(2):"\n"+s.split("\n").map((function(t){return" "+t})).join("\n")):s=t.stylize("[Circular]","special")),v(o)){if(a&&i.match(/^\d+$/))return s;(o=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.slice(1,-1),o=t.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=t.stylize(o,"string"))}return o+": "+s}function f(t){return Array.isArray(t)}function d(t){return"boolean"==typeof t}function m(t){return null===t}function g(t){return"number"==typeof t}function y(t){return"string"==typeof t}function v(t){return void 0===t}function x(t){return _(t)&&"[object RegExp]"===A(t)}function _(t){return"object"==typeof t&&null!==t}function b(t){return _(t)&&"[object Date]"===A(t)}function w(t){return _(t)&&("[object Error]"===A(t)||t instanceof Error)}function T(t){return"function"==typeof t}function A(t){return Object.prototype.toString.call(t)}function k(t){return t<10?"0"+t.toString(10):t.toString(10)}n=(n="false").replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),a=new RegExp("^"+n+"$","i"),t.debuglog=function(e){if(e=e.toUpperCase(),!i[e])if(a.test(e)){var r=c.pid;i[e]=function(){var n=t.format.apply(t,arguments);console.error("%s %d: %s",e,r,n)}}else i[e]=function(){};return i[e]},t.inspect=o,o.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},o.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.types=xc(),t.isArray=f,t.isBoolean=d,t.isNull=m,t.isNullOrUndefined=function(t){return null==t},t.isNumber=g,t.isString=y,t.isSymbol=function(t){return"symbol"==typeof t},t.isUndefined=v,t.isRegExp=x,t.types.isRegExp=x,t.isObject=_,t.isDate=b,t.types.isDate=b,t.isError=w,t.types.isNativeError=w,t.isFunction=T,t.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||typeof t>"u"},t.isBuffer=_c();var M=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function S(t,e){return Object.prototype.hasOwnProperty.call(t,e)}t.log=function(){var e,r;console.log("%s - %s",(r=[k((e=new Date).getHours()),k(e.getMinutes()),k(e.getSeconds())].join(":"),[e.getDate(),M[e.getMonth()],r].join(" ")),t.format.apply(t,arguments))},t.inherits=jl(),t._extend=function(t,e){if(!e||!_(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t};var E=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;function C(t,e){if(!t){var r=new Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}t.promisify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');if(E&&t[E]){var r;if("function"!=typeof(r=t[E]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(r,E,{value:r,enumerable:!1,writable:!1,configurable:!0}),r}function r(){for(var e,r,n=new Promise((function(t,n){e=t,r=n})),i=[],a=0;a0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r}},{key:"concat",value:function(t){if(0===this.length)return a.alloc(0);for(var e=a.allocUnsafe(t>>>0),r=this.head,n=0;r;)l(r.data,e,n),n+=r.data.length,r=r.next;return e}},{key:"consume",value:function(t,e){var r;return ti.length?i.length:t;if(a===i.length?n+=i:n+=i.slice(0,t),0==(t-=a)){a===i.length?(++r,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=i.slice(a));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(t){var e=a.allocUnsafe(t),r=this.head,n=1;for(r.data.copy(e),t-=r.data.length;r=r.next;){var i=r.data,o=t>i.length?i.length:t;if(i.copy(e,e.length-t,0,o),0==(t-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,e}},{key:s,value:function(t,e){return o(this,function(t){for(var e=1;e2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}n("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),n("ERR_INVALID_ARG_TYPE",(function(t,e,r){var n,a;if("string"==typeof e&&function(t,e){return t.substr(0,4)===e}(e,"not ")?(n="must not be",e=e.replace(/^not /,"")):n="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-9,r)===e}(t," argument"))a="The ".concat(t," ").concat(n," ").concat(i(e,"type"));else{var o=function(t,e,r){return"number"!=typeof r&&(r=0),!(r+1>t.length)&&-1!==t.indexOf(".",r)}(t)?"property":"argument";a='The "'.concat(t,'" ').concat(o," ").concat(n," ").concat(i(e,"type"))}return a+". Received type ".concat(typeof r)}),TypeError),n("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),n("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),n("ERR_STREAM_PREMATURE_CLOSE","Premature close"),n("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),n("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),n("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),n("ERR_STREAM_WRITE_AFTER_END","write after end"),n("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),n("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),n("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=r}}),kc=f({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/state.js"(t,e){var r=Ac().codes.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(t,e,n,i){var a=function(t,e,r){return null!=t.highWaterMark?t.highWaterMark:e?t[r]:null}(e,i,n);if(null!=a){if(!isFinite(a)||Math.floor(a)!==a||a<0)throw new r(i?n:"highWaterMark",a);return Math.floor(a)}return t.objectMode?16:16384}}}}),Mc=f({"node_modules/util-deprecate/browser.js"(t,e){function r(t){try{if(!window.localStorage)return!1}catch{return!1}var e=window.localStorage[t];return null!=e&&"true"===String(e).toLowerCase()}e.exports=function(t,e){if(r("noDeprecation"))return t;var n=!1;return function(){if(!n){if(r("throwDeprecation"))throw new Error(e);r("traceDeprecation")?console.trace(e):console.warn(e),n=!0}return t.apply(this,arguments)}}}}),Sc=f({"node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_writable.js"(t,e){function r(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e){var r=t.entry;for(t.entry=null;r;){var n=r.callback;e.pendingcb--,n(undefined),r=r.next}e.corkedRequestsFree.next=t}(e,t)}}var n;e.exports=A,A.WritableState=T;var i,a={deprecate:Mc()},o=Nl(),s=ql().Buffer,l=window.Uint8Array||function(){},u=Tc(),h=kc().getHighWaterMark,p=Ac().codes,f=p.ERR_INVALID_ARG_TYPE,d=p.ERR_METHOD_NOT_IMPLEMENTED,m=p.ERR_MULTIPLE_CALLBACK,g=p.ERR_STREAM_CANNOT_PIPE,y=p.ERR_STREAM_DESTROYED,v=p.ERR_STREAM_NULL_VALUES,x=p.ERR_STREAM_WRITE_AFTER_END,_=p.ERR_UNKNOWN_ENCODING,b=u.errorOrDestroy;function w(){}function T(t,e,i){n=n||Ec(),t=t||{},"boolean"!=typeof i&&(i=e instanceof n),this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=h(this,t,"writableHighWaterMark",i),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===t.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var r=t._writableState,n=r.sync,i=r.writecb;if("function"!=typeof i)throw new m;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(r),e)!function(t,e,r,n,i){--e.pendingcb,r?(c.nextTick(i,n),c.nextTick(I,t,e),t._writableState.errorEmitted=!0,b(t,n)):(i(n),t._writableState.errorEmitted=!0,b(t,n),I(t,e))}(t,r,n,e,i);else{var a=E(r)||t.destroyed;!a&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&S(t,r),n?c.nextTick(M,t,r,a,i):M(t,r,a,i)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new r(this)}function A(t){var e=this instanceof(n=n||Ec());if(!e&&!i.call(A,this))return new A(t);this._writableState=new T(t,this,e),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),o.call(this)}function k(t,e,r,n,i,a,o){e.writelen=n,e.writecb=o,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new y("write")):r?t._writev(i,e.onwrite):t._write(i,a,e.onwrite),e.sync=!1}function M(t,e,r,n){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,n(),I(t,e)}function S(t,e){e.bufferProcessing=!0;var n=e.bufferedRequest;if(t._writev&&n&&n.next){var i=e.bufferedRequestCount,a=new Array(i),o=e.corkedRequestsFree;o.entry=n;for(var s=0,l=!0;n;)a[s]=n,n.isBuf||(l=!1),n=n.next,s+=1;a.allBuffers=l,k(t,e,!0,e.length,a,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new r(e),e.bufferedRequestCount=0}else{for(;n;){var c=n.chunk,u=n.encoding,h=n.callback;if(k(t,e,!1,e.objectMode?1:c.length,c,u,h),n=n.next,e.bufferedRequestCount--,e.writing)break}null===n&&(e.lastBufferedRequest=null)}e.bufferedRequest=n,e.bufferProcessing=!1}function E(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function C(t,e){t._final((function(r){e.pendingcb--,r&&b(t,r),e.prefinished=!0,t.emit("prefinish"),I(t,e)}))}function I(t,e){var r=E(e);if(r&&(function(t,e){!e.prefinished&&!e.finalCalled&&("function"!=typeof t._final||e.destroyed?(e.prefinished=!0,t.emit("prefinish")):(e.pendingcb++,e.finalCalled=!0,c.nextTick(C,t,e)))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var n=t._readableState;(!n||n.autoDestroy&&n.endEmitted)&&t.destroy()}return r}jl()(A,o),T.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(T.prototype,"buffer",{get:a.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(i=Function.prototype[Symbol.hasInstance],Object.defineProperty(A,Symbol.hasInstance,{value:function(t){return!!i.call(this,t)||this===A&&t&&t._writableState instanceof T}})):i=function(t){return t instanceof this},A.prototype.pipe=function(){b(this,new g)},A.prototype.write=function(t,e,r){var n=this._writableState,i=!1,a=!n.objectMode&&function(t){return s.isBuffer(t)||t instanceof l}(t);return a&&!s.isBuffer(t)&&(t=function(t){return s.from(t)}(t)),"function"==typeof e&&(r=e,e=null),a?e="buffer":e||(e=n.defaultEncoding),"function"!=typeof r&&(r=w),n.ending?function(t,e){var r=new x;b(t,r),c.nextTick(e,r)}(this,r):(a||function(t,e,r,n){var i;return null===r?i=new v:"string"!=typeof r&&!e.objectMode&&(i=new f("chunk",["string","Buffer"],r)),!i||(b(t,i),c.nextTick(n,i),!1)}(this,n,t,r))&&(n.pendingcb++,i=function(t,e,r,n,i,a){if(!r){var o=function(t,e,r){return!t.objectMode&&!1!==t.decodeStrings&&"string"==typeof e&&(e=s.from(e,r)),e}(e,n,i);n!==o&&(r=!0,i="buffer",n=o)}var l=e.objectMode?1:n.length;e.length+=l;var c=e.length-1))throw new _(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(A.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(A.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),A.prototype._write=function(t,e,r){r(new d("_write()"))},A.prototype._writev=null,A.prototype.end=function(t,e,r){var n=this._writableState;return"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||function(t,e,r){e.ending=!0,I(t,e),r&&(e.finished?c.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}(this,n,r),this},Object.defineProperty(A.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),A.prototype.destroy=u.destroy,A.prototype._undestroy=u.undestroy,A.prototype._destroy=function(t,e){e(t)}}}),Ec=f({"node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_duplex.js"(t,e){var r=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};e.exports=l;var n,i,a,o=Dc(),s=Sc();for(jl()(l,o),n=r(s.prototype),a=0;a>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function a(t){var e=this.lastTotal-this.lastNeed,r=function(t,e){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function o(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function s(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function l(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function c(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function u(t){return t.toString(this.encoding)}function h(t){return t&&t.length?this.write(t):""}t.StringDecoder=n,n.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0?(a>0&&(t.lastNeed=a-1),a):--n=0?(a>0&&(t.lastNeed=a-2),a):--n=0?(a>0&&(2===a?a=0:t.lastNeed=a-3),a):0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)},n.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}}}),Lc=f({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/end-of-stream.js"(t,e){var r=Ac().codes.ERR_STREAM_PREMATURE_CLOSE;function n(){}e.exports=function t(e,i,a){if("function"==typeof i)return t(e,null,i);i||(i={}),a=function(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,n=new Array(r),i=0;i0)if("string"!=typeof e&&!c.objectMode&&Object.getPrototypeOf(e)!==o.prototype&&(e=function(t){return o.from(t)}(e)),i)c.endEmitted?b(t,new _):M(t,c,e,!0);else if(c.ended)b(t,new v);else{if(c.destroyed)return!1;c.reading=!1,c.decoder&&!r?(e=c.decoder.write(e),c.objectMode||0!==e.length?M(t,c,e,!1):L(t,c)):M(t,c,e,!1)}else i||(c.reading=!1,L(t,c));return!c.ended&&(c.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=S?t=S:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function C(t){var e=t._readableState;n("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(n("emitReadable",e.flowing),e.emittedReadable=!0,c.nextTick(I,t))}function I(t){var e=t._readableState;n("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,R(t)}function L(t,e){e.readingMore||(e.readingMore=!0,c.nextTick(P,t,e))}function P(t,e){for(;!e.reading&&!e.ended&&(e.length0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function D(t){n("readable nexttick read 0"),t.read(0)}function O(t,e){n("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),R(t),e.flowing&&!e.reading&&t.read(0)}function R(t){var e=t._readableState;for(n("flow",e.flowing);e.flowing&&null!==t.read(););}function F(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r);var r}function B(t){var e=t._readableState;n("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,c.nextTick(j,e,t))}function j(t,e){if(n("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function N(t,e){for(var r=0,n=t.length;r=e.highWaterMark:e.length>0)||e.ended))return n("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?B(this):C(this),null;if(0===(t=E(t,e))&&e.ended)return 0===e.length&&B(this),null;var i,a=e.needReadable;return n("need readable",a),(0===e.length||e.length-t0?F(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&B(this)),null!==i&&this.emit("data",i),i},A.prototype._read=function(t){b(this,new x("_read()"))},A.prototype.pipe=function(t,e){var r=this,a=this._readableState;switch(a.pipesCount){case 0:a.pipes=t;break;case 1:a.pipes=[a.pipes,t];break;default:a.pipes.push(t)}a.pipesCount+=1,n("pipe count=%d opts=%j",a.pipesCount,e);var o=e&&!1===e.end||t===c.stdout||t===c.stderr?m:s;function s(){n("onend"),t.end()}a.endEmitted?c.nextTick(o):r.once("end",o),t.on("unpipe",(function e(i,o){n("onunpipe"),i===r&&o&&!1===o.hasUnpiped&&(o.hasUnpiped=!0,n("cleanup"),t.removeListener("close",f),t.removeListener("finish",d),t.removeListener("drain",l),t.removeListener("error",p),t.removeListener("unpipe",e),r.removeListener("end",s),r.removeListener("end",m),r.removeListener("data",h),u=!0,a.awaitDrain&&(!t._writableState||t._writableState.needDrain)&&l())}));var l=function(t){return function(){var e=t._readableState;n("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&i(t,"data")&&(e.flowing=!0,R(t))}}(r);t.on("drain",l);var u=!1;function h(e){n("ondata");var i=t.write(e);n("dest.write",i),!1===i&&((1===a.pipesCount&&a.pipes===t||a.pipesCount>1&&-1!==N(a.pipes,t))&&!u&&(n("false write response, pause",a.awaitDrain),a.awaitDrain++),r.pause())}function p(e){n("onerror",e),m(),t.removeListener("error",p),0===i(t,"error")&&b(t,e)}function f(){t.removeListener("finish",d),m()}function d(){n("onfinish"),t.removeListener("close",f),m()}function m(){n("unpipe"),r.unpipe(t)}return r.on("data",h),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",p),t.once("close",f),t.once("finish",d),t.emit("pipe",r),a.flowing||(n("pipe resume"),r.resume()),t},A.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var a=0;a0,!1!==i.flowing&&this.resume()):"readable"===t&&!i.endEmitted&&!i.readableListening&&(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,n("on readable",i.length,i.reading),i.length?C(this):i.reading||c.nextTick(D,this)),r},A.prototype.addListener=A.prototype.on,A.prototype.removeListener=function(t,e){var r=a.prototype.removeListener.call(this,t,e);return"readable"===t&&c.nextTick(z,this),r},A.prototype.removeAllListeners=function(t){var e=a.prototype.removeAllListeners.apply(this,arguments);return("readable"===t||void 0===t)&&c.nextTick(z,this),e},A.prototype.resume=function(){var t=this._readableState;return t.flowing||(n("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,c.nextTick(O,t,e))}(this,t)),t.paused=!1,this},A.prototype.pause=function(){return n("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(n("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},A.prototype.wrap=function(t){var e=this,r=this._readableState,i=!1;for(var a in t.on("end",(function(){if(n("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(a){n("wrapped data"),r.decoder&&(a=r.decoder.write(a)),r.objectMode&&null==a||!(r.objectMode||a&&a.length)||e.push(a)||(i=!0,t.pause())})),t)void 0===this[a]&&"function"==typeof t[a]&&(this[a]=function(e){return function(){return t[e].apply(t,arguments)}}(a));for(var o=0;o0,(function(t){u||(u=t),t&&h.forEach(s),!i&&(h.forEach(s),c(u))}))}));return e.reduce(l)}}}),Bc=f({"node_modules/stream-browserify/index.js"(t,e){e.exports=n;var r=pe().EventEmitter;function n(){r.call(this)}jl()(n,r),n.Readable=Dc(),n.Writable=Sc(),n.Duplex=Ec(),n.Transform=Oc(),n.PassThrough=Rc(),n.finished=Lc(),n.pipeline=Fc(),n.Stream=n,n.prototype.pipe=function(t,e){var n=this;function i(e){t.writable&&!1===t.write(e)&&n.pause&&n.pause()}function a(){n.readable&&n.resume&&n.resume()}n.on("data",i),t.on("drain",a),!t._isStdio&&(!e||!1!==e.end)&&(n.on("end",s),n.on("close",l));var o=!1;function s(){o||(o=!0,t.end())}function l(){o||(o=!0,"function"==typeof t.destroy&&t.destroy())}function c(t){if(u(),0===r.listenerCount(this,"error"))throw t}function u(){n.removeListener("data",i),t.removeListener("drain",a),n.removeListener("end",s),n.removeListener("close",l),n.removeListener("error",c),t.removeListener("error",c),n.removeListener("end",u),n.removeListener("close",u),t.removeListener("close",u)}return n.on("error",c),t.on("error",c),n.on("end",u),n.on("close",u),t.on("close",u),t.emit("pipe",n),t}}}),jc=f({"node_modules/util/util.js"(t){var e=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),r={},n=0;n=a)return t;switch(t){case"%s":return String(i[n++]);case"%d":return Number(i[n++]);case"%j":try{return JSON.stringify(i[n++])}catch{return"[Circular]"}default:return t}})),l=i[n];n"u")return function(){return t.deprecate(e,r).apply(this,arguments)};var n=!1;return function(){if(!n){if(c.throwDeprecation)throw new Error(r);c.traceDeprecation?console.trace(r):console.error(r),n=!0}return e.apply(this,arguments)}};var n,i={},a=/^$/;function o(e,r){var n={seen:[],stylize:l};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),d(r)?n.showHidden=r:r&&t._extend(n,r),v(n.showHidden)&&(n.showHidden=!1),v(n.depth)&&(n.depth=2),v(n.colors)&&(n.colors=!1),v(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=s),u(n,e,n.depth)}function s(t,e){var r=o.styles[e];return r?"["+o.colors[r][0]+"m"+t+"["+o.colors[r][1]+"m":t}function l(t,e){return t}function u(e,r,n){if(e.customInspect&&r&&T(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,e);return y(i)||(i=u(e,i,n)),i}var a=function(t,e){if(v(e))return t.stylize("undefined","undefined");if(y(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return g(e)?t.stylize(""+e,"number"):d(e)?t.stylize(""+e,"boolean"):m(e)?t.stylize("null","null"):void 0}(e,r);if(a)return a;var o=Object.keys(r),s=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(r)),w(r)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return h(r);if(0===o.length){if(T(r)){var l=r.name?": "+r.name:"";return e.stylize("[Function"+l+"]","special")}if(x(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(b(r))return e.stylize(Date.prototype.toString.call(r),"date");if(w(r))return h(r)}var c,_="",A=!1,k=["{","}"];return f(r)&&(A=!0,k=["[","]"]),T(r)&&(_=" [Function"+(r.name?": "+r.name:"")+"]"),x(r)&&(_=" "+RegExp.prototype.toString.call(r)),b(r)&&(_=" "+Date.prototype.toUTCString.call(r)),w(r)&&(_=" "+h(r)),0!==o.length||A&&0!=r.length?n<0?x(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),c=A?function(t,e,r,n,i){for(var a=[],o=0,s=e.length;o60?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}(c,_,k)):k[0]+_+k[1]}function h(t){return"["+Error.prototype.toString.call(t)+"]"}function p(t,e,r,n,i,a){var o,s,l;if((l=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?s=l.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):l.set&&(s=t.stylize("[Setter]","special")),S(n,i)||(o="["+i+"]"),s||(t.seen.indexOf(l.value)<0?(s=m(r)?u(t,l.value,null):u(t,l.value,r-1)).indexOf("\n")>-1&&(s=a?s.split("\n").map((function(t){return" "+t})).join("\n").slice(2):"\n"+s.split("\n").map((function(t){return" "+t})).join("\n")):s=t.stylize("[Circular]","special")),v(o)){if(a&&i.match(/^\d+$/))return s;(o=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.slice(1,-1),o=t.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=t.stylize(o,"string"))}return o+": "+s}function f(t){return Array.isArray(t)}function d(t){return"boolean"==typeof t}function m(t){return null===t}function g(t){return"number"==typeof t}function y(t){return"string"==typeof t}function v(t){return void 0===t}function x(t){return _(t)&&"[object RegExp]"===A(t)}function _(t){return"object"==typeof t&&null!==t}function b(t){return _(t)&&"[object Date]"===A(t)}function w(t){return _(t)&&("[object Error]"===A(t)||t instanceof Error)}function T(t){return"function"==typeof t}function A(t){return Object.prototype.toString.call(t)}function k(t){return t<10?"0"+t.toString(10):t.toString(10)}n=(n="false").replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),a=new RegExp("^"+n+"$","i"),t.debuglog=function(e){if(e=e.toUpperCase(),!i[e])if(a.test(e)){var r=c.pid;i[e]=function(){var n=t.format.apply(t,arguments);console.error("%s %d: %s",e,r,n)}}else i[e]=function(){};return i[e]},t.inspect=o,o.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},o.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.types=xc(),t.isArray=f,t.isBoolean=d,t.isNull=m,t.isNullOrUndefined=function(t){return null==t},t.isNumber=g,t.isString=y,t.isSymbol=function(t){return"symbol"==typeof t},t.isUndefined=v,t.isRegExp=x,t.types.isRegExp=x,t.isObject=_,t.isDate=b,t.types.isDate=b,t.isError=w,t.types.isNativeError=w,t.isFunction=T,t.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||typeof t>"u"},t.isBuffer=_c();var M=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function S(t,e){return Object.prototype.hasOwnProperty.call(t,e)}t.log=function(){var e,r;console.log("%s - %s",(r=[k((e=new Date).getHours()),k(e.getMinutes()),k(e.getSeconds())].join(":"),[e.getDate(),M[e.getMonth()],r].join(" ")),t.format.apply(t,arguments))},t.inherits=jl(),t._extend=function(t,e){if(!e||!_(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t};var E=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;function C(t,e){if(!t){var r=new Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}t.promisify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');if(E&&t[E]){var r;if("function"!=typeof(r=t[E]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(r,E,{value:r,enumerable:!1,writable:!1,configurable:!0}),r}function r(){for(var e,r,n=new Promise((function(t,n){e=t,r=n})),i=[],a=0;a"u"||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}}();return function(){var n,a=i(t);if(e){var o=i(this).constructor;n=Reflect.construct(a,arguments,o)}else n=a.apply(this,arguments);return function(t,e){if(e&&("object"===r(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)}(this,n)}}(s);function s(r,n,i){var a;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s),a=o.call(this,function(t,r,n){return"string"==typeof e?e:e(t,r,n)}(r,n,i)),a.code=t,a}return function(t){return Object.defineProperty(t,"prototype",{writable:!1}),t}(s)}(a);s[t]=o}function c(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map((function(t){return String(t)})),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}l("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),l("ERR_INVALID_ARG_TYPE",(function(t,e,n){var i,o;if(void 0===a&&(a=nu()),a("string"==typeof t,"'name' must be a string"),"string"==typeof e&&function(t,e){return t.substr(0,4)===e}(e,"not ")?(i="must not be",e=e.replace(/^not /,"")):i="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-9,r)===e}(t," argument"))o="The ".concat(t," ").concat(i," ").concat(c(e,"type"));else{var s=function(t,e,r){return"number"!=typeof r&&(r=0),!(r+1>t.length)&&-1!==t.indexOf(".",r)}(t)?"property":"argument";o='The "'.concat(t,'" ').concat(s," ").concat(i," ").concat(c(e,"type"))}return o+". Received type ".concat(r(n))}),TypeError),l("ERR_INVALID_ARG_VALUE",(function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===o&&(o=jc());var n=o.inspect(e);return n.length>128&&(n="".concat(n.slice(0,128),"...")),"The argument '".concat(t,"' ").concat(r,". Received ").concat(n)}),TypeError,RangeError),l("ERR_INVALID_RETURN_VALUE",(function(t,e,n){var i;return i=n&&n.constructor&&n.constructor.name?"instance of ".concat(n.constructor.name):"type ".concat(r(n)),"Expected ".concat(t,' to be returned from the "').concat(e,'"')+" function but got ".concat(i,".")}),TypeError),l("ERR_MISSING_ARGS",(function(){for(var t=arguments.length,e=new Array(t),r=0;r0,"At least one arg needs to be specified");var n="The ",i=e.length;switch(e=e.map((function(t){return'"'.concat(t,'"')})),i){case 1:n+="".concat(e[0]," argument");break;case 2:n+="".concat(e[0]," and ").concat(e[1]," arguments");break;default:n+=e.slice(0,i-1).join(", "),n+=", and ".concat(e[i-1]," arguments")}return"".concat(n," must be specified")}),TypeError),e.exports.codes=s}}),Uc=f({"node_modules/assert/build/internal/assert/assertion_error.js"(t,e){function r(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function n(t){for(var e=1;e"u"||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}}function f(t,e){return(f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function d(t){return(d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function m(t){return(m="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)}var g=jc().inspect,y=Nc().codes.ERR_INVALID_ARG_TYPE;function v(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}var x="",_="",b="",w="",T={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function A(t){var e=Object.keys(t),r=Object.create(Object.getPrototypeOf(t));return e.forEach((function(e){r[e]=t[e]})),Object.defineProperty(r,"message",{value:t.message}),r}function k(t){return g(t,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}var M=function(t,e){!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&&f(t,e)}(i,t);var r=function(t){var e=p();return function(){var r,n=d(t);if(e){var i=d(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return s(this,r)}}(i);function i(t){var e;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),"object"!==m(t)||null===t)throw new y("options","Object",t);var n=t.message,a=t.operator,o=t.stackStartFn,u=t.actual,h=t.expected,p=Error.stackTraceLimit;if(Error.stackTraceLimit=0,null!=n)e=r.call(this,String(n));else if(c.stderr&&c.stderr.isTTY&&(c.stderr&&c.stderr.getColorDepth&&1!==c.stderr.getColorDepth()?(x="",_="",w="",b=""):(x="",_="",w="",b="")),"object"===m(u)&&null!==u&&"object"===m(h)&&null!==h&&"stack"in u&&u instanceof Error&&"stack"in h&&h instanceof Error&&(u=A(u),h=A(h)),"deepStrictEqual"===a||"strictEqual"===a)e=r.call(this,function(t,e,r){var n="",i="",a=0,o="",s=!1,l=k(t),u=l.split("\n"),h=k(e).split("\n"),p=0,f="";if("strictEqual"===r&&"object"===m(t)&&"object"===m(e)&&null!==t&&null!==e&&(r="strictEqualObject"),1===u.length&&1===h.length&&u[0]!==h[0]){var d=u[0].length+h[0].length;if(d<=10){if(!("object"===m(t)&&null!==t||"object"===m(e)&&null!==e||0===t&&0===e))return"".concat(T[r],"\n\n")+"".concat(u[0]," !== ").concat(h[0],"\n")}else if("strictEqualObject"!==r&&d<(c.stderr&&c.stderr.isTTY?c.stderr.columns:80)){for(;u[0][p]===h[0][p];)p++;p>2&&(f="\n ".concat(function(t,e){if(e=Math.floor(e),0==t.length||0==e)return"";var r=t.length*e;for(e=Math.floor(Math.log(e)/Math.log(2));e;)t+=t,e--;return t+t.substring(0,r-t.length)}(" ",p),"^"),p=0)}}for(var g=u[u.length-1],y=h[h.length-1];g===y&&(p++<2?o="\n ".concat(g).concat(o):n=g,u.pop(),h.pop(),0!==u.length&&0!==h.length);)g=u[u.length-1],y=h[h.length-1];var A=Math.max(u.length,h.length);if(0===A){var M=l.split("\n");if(M.length>30)for(M[26]="".concat(x,"...").concat(w);M.length>27;)M.pop();return"".concat(T.notIdentical,"\n\n").concat(M.join("\n"),"\n")}p>3&&(o="\n".concat(x,"...").concat(w).concat(o),s=!0),""!==n&&(o="\n ".concat(n).concat(o),n="");var S=0,E=T[r]+"\n".concat(_,"+ actual").concat(w," ").concat(b,"- expected").concat(w),C=" ".concat(x,"...").concat(w," Lines skipped");for(p=0;p1&&p>2&&(I>4?(i+="\n".concat(x,"...").concat(w),s=!0):I>3&&(i+="\n ".concat(h[p-2]),S++),i+="\n ".concat(h[p-1]),S++),a=p,n+="\n".concat(b,"-").concat(w," ").concat(h[p]),S++;else if(h.length1&&p>2&&(I>4?(i+="\n".concat(x,"...").concat(w),s=!0):I>3&&(i+="\n ".concat(u[p-2]),S++),i+="\n ".concat(u[p-1]),S++),a=p,i+="\n".concat(_,"+").concat(w," ").concat(u[p]),S++;else{var L=h[p],P=u[p],z=P!==L&&(!v(P,",")||P.slice(0,-1)!==L);z&&v(L,",")&&L.slice(0,-1)===P&&(z=!1,P+=","),z?(I>1&&p>2&&(I>4?(i+="\n".concat(x,"...").concat(w),s=!0):I>3&&(i+="\n ".concat(u[p-2]),S++),i+="\n ".concat(u[p-1]),S++),a=p,i+="\n".concat(_,"+").concat(w," ").concat(P),n+="\n".concat(b,"-").concat(w," ").concat(L),S+=2):(i+=n,n="",(1===I||0===p)&&(i+="\n ".concat(P),S++))}if(S>20&&p30)for(d[26]="".concat(x,"...").concat(w);d.length>27;)d.pop();e=1===d.length?r.call(this,"".concat(f," ").concat(d[0])):r.call(this,"".concat(f,"\n\n").concat(d.join("\n"),"\n"))}else{var g=k(u),M="",S=T[a];"notDeepEqual"===a||"notEqual"===a?(g="".concat(T[a],"\n\n").concat(g)).length>1024&&(g="".concat(g.slice(0,1021),"...")):(M="".concat(k(h)),g.length>512&&(g="".concat(g.slice(0,509),"...")),M.length>512&&(M="".concat(M.slice(0,509),"...")),"deepEqual"===a||"equal"===a?g="".concat(S,"\n\n").concat(g,"\n\nshould equal\n\n"):M=" ".concat(a," ").concat(M)),e=r.call(this,"".concat(g).concat(M))}return Error.stackTraceLimit=p,e.generatedMessage=!n,Object.defineProperty(l(e),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),e.code="ERR_ASSERTION",e.actual=u,e.expected=h,e.operator=a,Error.captureStackTrace&&Error.captureStackTrace(l(e),o),e.stack,e.name="AssertionError",s(e)}return function(t,e){e&&a(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1})}(i,[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:e,value:function(t,e){return g(this,n(n({},e),{},{customInspect:!1,depth:0}))}}]),i}(u(Error),g.custom);e.exports=M}}),Vc=f({"node_modules/object-keys/isArguments.js"(t,e){var r=Object.prototype.toString;e.exports=function(t){var e=r.call(t),n="[object Arguments]"===e;return n||(n="[object Array]"!==e&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===r.call(t.callee)),n}}}),qc=f({"node_modules/object-keys/implementation.js"(t,e){var r,n,i,a,o,s,l,c,u,h,p,f;Object.keys||(n=Object.prototype.hasOwnProperty,i=Object.prototype.toString,a=Vc(),o=Object.prototype.propertyIsEnumerable,s=!o.call({toString:null},"toString"),l=o.call((function(){}),"prototype"),c=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],u=function(t){var e=t.constructor;return e&&e.prototype===t},h={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},p=function(){if(typeof window>"u")return!1;for(var t in window)try{if(!h["$"+t]&&n.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{u(window[t])}catch{return!0}}catch{return!0}return!1}(),f=function(t){if(typeof window>"u"||!p)return u(t);try{return u(t)}catch{return!1}},r=function(t){var e=null!==t&&"object"==typeof t,r="[object Function]"===i.call(t),o=a(t),u=e&&"[object String]"===i.call(t),h=[];if(!e&&!r&&!o)throw new TypeError("Object.keys called on a non-object");var p=l&&r;if(u&&t.length>0&&!n.call(t,0))for(var d=0;d0)for(var m=0;m2?arguments[2]:{},o=r(e);n&&(o=a.call(o,Object.getOwnPropertySymbols(e)));for(var s=0;st.length)&&(e=t.length);for(var r=0,n=new Array(e);r10)return!0;for(var e=0;e57)return!0}return 10===t.length&&t>=Math.pow(2,32)}function P(t){return Object.keys(t).filter(L).concat(c(t).filter(Object.prototype.propertyIsEnumerable.bind(t)))}function z(t,e){if(t===e)return 0;for(var r=t.length,n=e.length,i=0,a=Math.min(r,n);i1?r-1:0),i=1;i1?r-1:0),i=1;i1?r-1:0),i=1;i1?r-1:0),i=1;i0)return function(t){if(!((t=String(t)).length>100)){var e=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(t);if(e){var o=parseFloat(e[1]);switch((e[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*o;case"days":case"day":case"d":return o*a;case"hours":case"hour":case"hrs":case"hr":case"h":return o*i;case"minutes":case"minute":case"mins":case"min":case"m":return o*n;case"seconds":case"second":case"secs":case"sec":case"s":return o*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return o;default:return}}}}(t);if("number"===s&&!1===isNaN(t))return e.long?function(t){return o(t,a,"day")||o(t,i,"hour")||o(t,n,"minute")||o(t,r,"second")||t+" ms"}(t):function(t){return t>=a?Math.round(t/a)+"d":t>=i?Math.round(t/i)+"h":t>=n?Math.round(t/n)+"m":t>=r?Math.round(t/r)+"s":t+"ms"}(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}}}),au=f({"node_modules/stream-parser/node_modules/debug/src/debug.js"(t,e){var r;function n(e){function n(){if(n.enabled){var e=n,i=+new Date,a=i-(r||i);e.diff=a,e.prev=r,e.curr=i,r=i;for(var o=new Array(arguments.length),s=0;s=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=typeof chrome<"u"&&typeof chrome.storage<"u"?chrome.storage.local:function(){try{return window.localStorage}catch{}}(),t.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],t.formatters.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}},t.enable(r())}}),su=f({"node_modules/stream-parser/index.js"(t,e){var r=nu(),n=ou()("stream-parser");function i(t){n("initializing parser stream"),t._parserBytesLeft=0,t._parserBuffers=[],t._parserBuffered=0,t._parserState=-1,t._parserCallback=null,"function"==typeof t.push&&(t._parserOutput=t.push.bind(t)),t._parserInit=!0}function a(t,e){r(!this._parserCallback,'there is already a "callback" set!'),r(isFinite(t)&&t>0,'can only buffer a finite number of bytes > 0, got "'+t+'"'),this._parserInit||i(this),n("buffering %o bytes",t),this._parserBytesLeft=t,this._parserCallback=e,this._parserState=0}function o(t,e){r(!this._parserCallback,'there is already a "callback" set!'),r(t>0,'can only skip > 0 bytes, got "'+t+'"'),this._parserInit||i(this),n("skipping %o bytes",t),this._parserBytesLeft=t,this._parserCallback=e,this._parserState=1}function s(t,e){r(!this._parserCallback,'There is already a "callback" set!'),r(t>0,'can only pass through > 0 bytes, got "'+t+'"'),this._parserInit||i(this),n("passing through %o bytes",t),this._parserBytesLeft=t,this._parserCallback=e,this._parserState=2}function l(t,e,r){this._parserInit||i(this),n("write(%o bytes)",t.length),"function"==typeof e&&(r=e),h(this,t,null,r)}function c(t,e,r){this._parserInit||i(this),n("transform(%o bytes)",t.length),"function"!=typeof e&&(e=this._parserOutput),h(this,t,e,r)}function u(t,e,r,i){if(t._parserBytesLeft-=e.length,n("%o bytes left for stream piece",t._parserBytesLeft),0===t._parserState?(t._parserBuffers.push(e),t._parserBuffered+=e.length):2===t._parserState&&r(e),0!==t._parserBytesLeft)return i;var a=t._parserCallback;if(a&&0===t._parserState&&t._parserBuffers.length>1&&(e=Buffer.concat(t._parserBuffers,t._parserBuffered)),0!==t._parserState&&(e=null),t._parserCallback=null,t._parserBuffered=0,t._parserState=-1,t._parserBuffers.splice(0),a){var o=[];e&&o.push(e),r&&o.push(r);var s=a.length>o.length;s&&o.push(p(i));var l=a.apply(t,o);if(!s||i===l)return i}}e.exports=function(t){var e=t&&"function"==typeof t._transform,r=t&&"function"==typeof t._write;if(!e&&!r)throw new Error("must pass a Writable or Transform stream in");n("extending Parser into stream"),t._bytes=a,t._skipBytes=o,e&&(t._passthrough=s),e?t._transform=c:t._write=l};var h=p((function t(e,r,n,i){return e._parserBytesLeft<=0?i(new Error("got data but not currently parsing anything")):r.length<=e._parserBytesLeft?function(){return u(e,r,n,i)}:function(){var a=r.slice(0,e._parserBytesLeft);return u(e,a,n,(function(o){return o?i(o):r.length>a.length?function(){return t(e,r.slice(a.length),n,i)}:void 0}))}}));function p(t){return function(){for(var e=t.apply(this,arguments);"function"==typeof e;)e=e();return e}}}}),lu=f({"node_modules/probe-image-size/lib/common.js"(t){var e=Bc().Transform,r=su();function n(){e.call(this,{readableObjectMode:!0})}function i(t,e,r){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||"",this.name=this.constructor.name,this.message=t,e&&(this.code=e),r&&(this.statusCode=r)}n.prototype=Object.create(e.prototype),n.prototype.constructor=n,r(n.prototype),t.ParserStream=n,t.sliceEq=function(t,e,r){for(var n=e,i=0;i>4&15,i=15&t[4],a=t[5]>>4&15,s=r(t,6),l=8,c=0;ce.width||t.width===e.width&&t.height>e.height?t:e})),r=t.reduce((function(t,e){return t.height>e.height||t.height===e.height&&t.width>e.width?t:e}));return e.width>r.height||e.width===r.height&&e.height>r.width?e:r}(e.sizes),n=1;e.transforms.forEach((function(t){var e={1:6,2:5,3:8,4:7,5:4,6:3,7:2,8:1},r={1:4,2:3,3:2,4:1,5:6,6:5,7:8,8:7};if("imir"===t.type&&(n=0===t.value?r[n]:e[n=e[n=r[n]]]),"irot"===t.type)for(var i=0;i0&&!this.aborted;){var r=this.ifds_to_read.shift();r.offset&&this.scan_ifd(r.id,r.offset,t)}},i.prototype.read_uint16=function(t){var e=this.input;if(t+2>e.length)throw r("unexpected EOF","EBADDATA");return this.big_endian?256*e[t]+e[t+1]:e[t]+256*e[t+1]},i.prototype.read_uint32=function(t){var e=this.input;if(t+4>e.length)throw r("unexpected EOF","EBADDATA");return this.big_endian?16777216*e[t]+65536*e[t+1]+256*e[t+2]+e[t+3]:e[t]+256*e[t+1]+65536*e[t+2]+16777216*e[t+3]},i.prototype.is_subifd_link=function(t,e){return 0===t&&34665===e||0===t&&34853===e||34665===t&&40965===e},i.prototype.exif_format_length=function(t){switch(t){case 1:case 2:case 6:case 7:return 1;case 3:case 8:return 2;case 4:case 9:case 11:return 4;case 5:case 10:case 12:return 8;default:return 0}},i.prototype.exif_format_read=function(t,e){var r;switch(t){case 1:case 2:return this.input[e];case 6:return(r=this.input[e])|33554430*(128&r);case 3:return this.read_uint16(e);case 8:return(r=this.read_uint16(e))|131070*(32768&r);case 4:return this.read_uint32(e);case 9:return 0|this.read_uint32(e);default:return null}},i.prototype.scan_ifd=function(t,e,i){var a=this.read_uint16(e);e+=2;for(var o=0;othis.input.length)throw r("unexpected EOF","EBADDATA");for(var d=[],m=p,g=0;g0&&(this.ifds_to_read.push({id:s,offset:d[0]}),f=!0),!1===i({is_big_endian:this.big_endian,ifd:t,tag:s,format:l,count:c,entry_offset:e+this.start,data_length:h,data_offset:p+this.start,value:d,is_subifd_link:f}))return void(this.aborted=!0);e+=12}0===t&&this.ifds_to_read.push({id:1,offset:this.read_uint32(e)})},e.exports.ExifParser=i,e.exports.get_orientation=function(t){var e=0;try{return new i(t,0,t.length).each((function(t){if(0===t.ifd&&274===t.tag&&Array.isArray(t.value))return e=t.value[0],!1})),e}catch{return-1}}}}),hu=f({"node_modules/probe-image-size/lib/parse_sync/avif.js"(t,e){var r=lu().str2arr,n=lu().sliceEq,i=lu().readUInt32BE,a=cu(),o=uu(),s=r("ftyp");e.exports=function(t){if(n(t,4,s)){var e=a.unbox(t,0);if(e){var r=a.getMimeType(e.data);if(r){for(var l,c=e.end;;){var u=a.unbox(t,c);if(!u)break;if(c=u.end,"mdat"===u.boxtype)return;if("meta"===u.boxtype){l=u.data;break}}if(l){var h=a.readSizeFromMeta(l);if(h){var p={width:h.width,height:h.height,type:r.type,mime:r.mime,wUnits:"px",hUnits:"px"};if(h.variants.length>1&&(p.variants=h.variants),h.orientation&&(p.orientation=h.orientation),h.exif_location&&h.exif_location.offset+h.exif_location.length<=t.length){var f=i(t,h.exif_location.offset),d=t.slice(h.exif_location.offset+f+4,h.exif_location.offset+h.exif_location.length),m=o.get_orientation(d);m>0&&(p.orientation=m)}return p}}}}}}}}),pu=f({"node_modules/probe-image-size/lib/parse_sync/bmp.js"(t,e){var r=lu().str2arr,n=lu().sliceEq,i=lu().readUInt16LE,a=r("BM");e.exports=function(t){if(!(t.length<26)&&n(t,0,a))return{width:i(t,18),height:i(t,22),type:"bmp",mime:"image/bmp",wUnits:"px",hUnits:"px"}}}}),fu=f({"node_modules/probe-image-size/lib/parse_sync/gif.js"(t,e){var r=lu().str2arr,n=lu().sliceEq,i=lu().readUInt16LE,a=r("GIF87a"),o=r("GIF89a");e.exports=function(t){if(!(t.length<10)&&(n(t,0,a)||n(t,0,o)))return{width:i(t,6),height:i(t,8),type:"gif",mime:"image/gif",wUnits:"px",hUnits:"px"}}}}),du=f({"node_modules/probe-image-size/lib/parse_sync/ico.js"(t,e){var r=lu().readUInt16LE;e.exports=function(t){var e=r(t,0),n=r(t,2),i=r(t,4);if(0===e&&1===n&&i){for(var a=[],o={width:0,height:0},s=0;so.width||c>o.height)&&(o=u)}return{width:o.width,height:o.height,variants:a,type:"ico",mime:"image/x-icon",wUnits:"px",hUnits:"px"}}}}}),mu=f({"node_modules/probe-image-size/lib/parse_sync/jpeg.js"(t,e){var r=lu().readUInt16BE,n=lu().str2arr,i=lu().sliceEq,a=uu(),o=n("Exif\0\0");e.exports=function(t){if(!(t.length<2)&&255===t[0]&&216===t[1]&&255===t[2])for(var e=2;;){for(;;){if(t.length-e<2)return;if(255===t[e++])break}for(var n,s=t[e++];255===s;)s=t[e++];if(208<=s&&s<=217||1===s)n=0;else{if(!(192<=s&&s<=254))return;if(t.length-e<2)return;n=r(t,e)-2,e+=2}if(217===s||218===s)return;var l;if(225===s&&n>=10&&i(t,e,o)&&(l=a.get_orientation(t.slice(e+6,e+n))),n>=5&&192<=s&&s<=207&&196!==s&&200!==s&&204!==s){if(t.length-e0&&(c.orientation=l),c}e+=n}}}}),gu=f({"node_modules/probe-image-size/lib/parse_sync/png.js"(t,e){var r=lu().str2arr,n=lu().sliceEq,i=lu().readUInt32BE,a=r("‰PNG\r\n\n"),o=r("IHDR");e.exports=function(t){if(!(t.length<24)&&n(t,0,a)&&n(t,12,o))return{width:i(t,16),height:i(t,20),type:"png",mime:"image/png",wUnits:"px",hUnits:"px"}}}}),yu=f({"node_modules/probe-image-size/lib/parse_sync/psd.js"(t,e){var r=lu().str2arr,n=lu().sliceEq,i=lu().readUInt32BE,a=r("8BPS\0");e.exports=function(t){if(!(t.length<22)&&n(t,0,a))return{width:i(t,18),height:i(t,14),type:"psd",mime:"image/vnd.adobe.photoshop",wUnits:"px",hUnits:"px"}}}}),vu=f({"node_modules/probe-image-size/lib/parse_sync/svg.js"(t,e){function r(t){return 32===t||9===t||13===t||10===t}function n(t){return"number"==typeof t&&isFinite(t)&&t>0}var i=/<[-_.:a-zA-Z0-9][^>]*>/,a=/^<([-_.:a-zA-Z0-9]+:)?svg\s/,o=/[^-]\bwidth="([^%]+?)"|[^-]\bwidth='([^%]+?)'/,s=/\bheight="([^%]+?)"|\bheight='([^%]+?)'/,l=/\bview[bB]ox="(.+?)"|\bview[bB]ox='(.+?)'/,c=/in$|mm$|cm$|pt$|pc$|px$|em$|ex$/;function u(t){return c.test(t)?t.match(c)[0]:"px"}e.exports=function(t){if(function(t){var e=0,n=t.length;for(239===t[0]&&187===t[1]&&191===t[2]&&(e=3);e>14&16383),type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}}function h(t,e){return{width:1+(t[e+6]<<16|t[e+5]<<8|t[e+4]),height:1+(t[e+9]<t.length)){for(;e+8=10?r=r||c(t,e+8):"VP8L"===f&&d>=9?r=r||u(t,e+8):"VP8X"===f&&d>=10?r=r||h(t,e+8):"EXIF"===f&&(i=o.get_orientation(t.slice(e+8,e+8+d)),e=1/0),e+=8+d}else e++;if(r)return i>0&&(r.orientation=i),r}}}}}),bu=f({"node_modules/probe-image-size/lib/parsers_sync.js"(t,e){e.exports={avif:hu(),bmp:pu(),gif:fu(),ico:du(),jpeg:mu(),png:gu(),psd:yu(),svg:vu(),tiff:xu(),webp:_u()}}}),wu=f({"node_modules/probe-image-size/sync.js"(t,e){var r=bu();e.exports=function(t){return function(t){for(var e=Object.keys(r),n=0;n0;)g=h.c2p(w+_*M),_--;for(_=0;void 0===v&&_0;)x=p.c2p(T+_*S),_--;if(gz[0];if(D||O){var R=m+E/2,F=v+C/2;L+="transform:"+i(R+"px",F+"px")+"scale("+(D?-1:1)+","+(O?-1:1)+")"+i(-R+"px",-F+"px")+";"}}I.attr("style",L);var B=new Promise((function(t){if(u._hasZ)t();else if(u._hasSource)if(u._canvas&&u._canvas.el.width===A&&u._canvas.el.height===k&&u._canvas.source===u.source)t();else{var e=document.createElement("canvas");e.width=A,e.height=k;var r=e.getContext("2d",{willReadFrequently:!0});u._image=u._image||new Image;var n=u._image;n.onload=function(){r.drawImage(n,0,0),u._canvas={el:e,source:u.source},t()},n.setAttribute("src",u.source)}})).then((function(){var t;if(u._hasZ)t=j((function(t,e){var r=b[e][t];return n.isTypedArray(r)&&(r=Array.from(r)),r})).toDataURL("image/png");else if(u._hasSource)if(d)t=u.source;else{var e=u._canvas.el.getContext("2d",{willReadFrequently:!0}).getImageData(0,0,A,k).data;t=j((function(t,r){var n=4*(r*A+t);return[e[n],e[n+1],e[n+2],e[n+3]]})).toDataURL("image/png")}I.attr({"xlink:href":t,height:C,width:E,x:m,y:v})}));t._promises.push(B)}function j(t){var e=document.createElement("canvas");e.width=E,e.height=C;var r,i=e.getContext("2d",{willReadFrequently:!0}),a=function(t){return n.constrain(Math.round(h.c2p(w+t*M)-m),0,E)},s=function(t){return n.constrain(Math.round(p.c2p(T+t*S)-v),0,C)},l=o.colormodel[u.colormodel],f=l.colormodel||u.colormodel,d=l.fmt;for(_=0;_0||r.inbox(o-s.y0,o-(s.y0+s.h*l.dy),0)>0)){var h,p=Math.floor((e-s.x0)/l.dx),f=Math.floor(Math.abs(o-s.y0)/l.dy);if(l._hasZ?h=s.z[f][p]:l._hasSource&&(h=l._canvas.el.getContext("2d",{willReadFrequently:!0}).getImageData(p,f,1,1).data),h){var d,m=s.hi||l.hoverinfo;if(m){var g=m.split("+");-1!==g.indexOf("all")&&(g=["color"]),-1!==g.indexOf("color")&&(d=!0)}var y,v=a.colormodel[l.colormodel],x=v.colormodel||l.colormodel,_=x.length,b=l._scaler(h),w=v.suffix,T=[];(l.hovertemplate||d)&&(T.push("["+[b[0]+w[0],b[1]+w[1],b[2]+w[2]].join(", ")),4===_&&T.push(", "+b[3]+w[3]),T.push("]"),T=T.join(""),t.extraText=x.toUpperCase()+": "+T),i(l.hovertext)&&i(l.hovertext[f])?y=l.hovertext[f][p]:i(l.text)&&i(l.text[f])&&(y=l.text[f][p]);var A=u.c2p(s.y0+(f+.5)*l.dy),k=s.x0+(p+.5)*l.dx,M=s.y0+(f+.5)*l.dy,S="["+h.slice(0,l.colormodel.length).join(", ")+"]";return[n.extendFlat(t,{index:[f,p],x0:c.c2p(s.x0+p*l.dx),x1:c.c2p(s.x0+(p+1)*l.dx),y0:A,y1:A,color:b,xVal:k,xLabelVal:k,yVal:M,yLabelVal:M,zLabelVal:S,text:y,hovertemplateLabels:{zLabel:S,colorLabel:T,"color[0]Label":b[0]+w[0],"color[1]Label":b[1]+w[1],"color[2]Label":b[2]+w[2],"color[3]Label":b[3]+w[3]}})]}}}}}),Eu=f({"src/traces/image/event_data.js"(t,e){e.exports=function(t,e){return"xVal"in e&&(t.x=e.xVal),"yVal"in e&&(t.y=e.yVal),e.xa&&(t.xaxis=e.xa),e.ya&&(t.yaxis=e.ya),t.color=e.color,t.colormodel=e.trace.colormodel,t.z||(t.z=e.color),t}}}),Cu=f({"src/traces/image/index.js"(t,e){e.exports={attributes:Fl(),supplyDefaults:Bl(),calc:Au(),plot:ku(),style:Mu(),hoverPoints:Su(),eventData:Eu(),moduleType:"trace",name:"image",basePlotModule:Si(),categories:["cartesian","svg","2dMap","noSortingByValue"],animatable:!1,meta:{}}}}),Iu=f({"lib/image.js"(t,e){e.exports=Cu()}}),Lu=f({"src/traces/pie/attributes.js"(t,e){var r=U(),n=Aa().attributes,i=F(),a=q(),o=Ot().hovertemplateAttrs,s=Ot().texttemplateAttrs,l=R().extendFlat,c=zt().pattern,u=i({editType:"plot",arrayOk:!0,colorEditType:"plot"});e.exports={labels:{valType:"data_array",editType:"calc"},label0:{valType:"number",dflt:0,editType:"calc"},dlabel:{valType:"number",dflt:1,editType:"calc"},values:{valType:"data_array",editType:"calc"},marker:{colors:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:a.defaultLine,arrayOk:!0,editType:"style"},width:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"style"},editType:"calc"},pattern:c,editType:"calc"},text:{valType:"data_array",editType:"plot"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},scalegroup:{valType:"string",dflt:"",editType:"calc"},textinfo:{valType:"flaglist",flags:["label","text","value","percent"],extras:["none"],editType:"calc"},hoverinfo:l({},r.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:o({},{keys:["label","color","value","percent","text"]}),texttemplate:s({editType:"plot"},{keys:["label","color","value","percent","text"]}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"plot"},textfont:l({},u,{}),insidetextorientation:{valType:"enumerated",values:["horizontal","radial","tangential","auto"],dflt:"auto",editType:"plot"},insidetextfont:l({},u,{}),outsidetextfont:l({},u,{}),automargin:{valType:"boolean",dflt:!1,editType:"plot"},title:{text:{valType:"string",dflt:"",editType:"plot"},font:l({},u,{}),position:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"plot"},editType:"plot"},domain:n({name:"pie",trace:!0,editType:"calc"}),hole:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},sort:{valType:"boolean",dflt:!0,editType:"calc"},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"angle",dflt:0,editType:"calc"},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0,editType:"calc"}}}}),Pu=f({"src/traces/pie/defaults.js"(t,e){var r=A(),n=le(),i=Lu(),a=Aa().defaults,o=Ya().handleText,s=le().coercePattern;function l(t,e){var i=n.isArrayOrTypedArray(t),a=n.isArrayOrTypedArray(e),o=Math.min(i?t.length:1/0,a?e.length:1/0);if(isFinite(o)||(o=0),o&&a){for(var s,l=0;l0){s=!0;break}}s||(o=0)}return{hasLabels:i,hasValues:a,len:o}}function c(t,e,r,n,i){n("marker.line.width")&&n("marker.line.color",i?void 0:r.paper_bgcolor);var a=n("marker.colors");s(n,"marker.pattern",a),t.marker&&!e.marker.pattern.fgcolor&&(e.marker.pattern.fgcolor=t.marker.colors),e.marker.pattern.bgcolor||(e.marker.pattern.bgcolor=r.paper_bgcolor)}e.exports={handleLabelsAndValues:l,handleMarkerDefaults:c,supplyDefaults:function(t,e,r,s){function u(r,a){return n.coerce(t,e,i,r,a)}var h=l(u("labels"),u("values")),p=h.len;if(e._hasLabels=h.hasLabels,e._hasValues=h.hasValues,!e._hasLabels&&e._hasValues&&(u("label0"),u("dlabel")),p){e._length=p,c(t,e,s,u,!0),u("scalegroup");var f,d=u("text"),m=u("texttemplate");if(m||(f=u("textinfo",n.isArrayOrTypedArray(d)?"text+percent":"percent")),u("hovertext"),u("hovertemplate"),m||f&&"none"!==f){var g=u("textposition");o(t,e,s,u,g,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),(Array.isArray(g)||"auto"===g||"outside"===g)&&u("automargin"),("inside"===g||"auto"===g||Array.isArray(g))&&u("insidetextorientation")}else"none"===f&&u("textposition","none");a(e,s,u);var y=u("hole");if(u("title.text")){var v=u("title.position",y?"middle center":"top center");!y&&"middle center"===v&&(e.title.position="top center"),n.coerceFont(u,"title.font",s.font)}u("sort"),u("direction"),u("rotation"),u("pull")}else e.visible=!1}}}}),zu=f({"src/traces/pie/layout_attributes.js"(t,e){e.exports={hiddenlabels:{valType:"data_array",editType:"calc"},piecolorway:{valType:"colorlist",editType:"calc"},extendpiecolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),Du=f({"src/traces/pie/layout_defaults.js"(t,e){var r=le(),n=zu();e.exports=function(t,e){function i(i,a){return r.coerce(t,e,n,i,a)}i("hiddenlabels"),i("piecolorway",e.colorway),i("extendpiecolors")}}}),Ou=f({"src/traces/pie/calc.js"(t,e){var r=A(),n=O(),i=H(),a={};function o(t){return function(e,r){return!(!e||(e=n(e),!e.isValid()))&&(e=i.addOpacity(e,e.getAlpha()),t[r]||(t[r]=e),e)}}function s(t,e){var r,i=JSON.stringify(t),a=e[i];if(!a){for(a=t.slice(),r=0;r=0})),("funnelarea"===e.type?y:e.sort)&&a.sort((function(t,e){return e.v-t.v})),a[0]&&(a[0].vTotal=g),a},crossTraceCalc:function(t,e){var r=(e||{}).type;r||(r="pie");var n=t._fullLayout,i=t.calcdata,o=n[r+"colorway"],l=n["_"+r+"colormap"];n["extend"+r+"colors"]&&(o=s(o,a));for(var c=0,u=0;u"),name:h.hovertemplate||-1!==p.indexOf("name")?h.name:void 0,idealAlign:t.pxmid[0]<0?"left":"right",color:m.castOption(b.bgcolor,t.pts)||t.color,borderColor:m.castOption(b.bordercolor,t.pts),fontFamily:m.castOption(w.family,t.pts),fontSize:m.castOption(w.size,t.pts),fontColor:m.castOption(w.color,t.pts),nameLength:m.castOption(b.namelength,t.pts),textAlign:m.castOption(b.align,t.pts),hovertemplate:m.castOption(h.hovertemplate,t.pts),hovertemplateLabels:t,eventData:[g(t,h)]},{container:n._hoverlayer.node(),outerContainer:n._paper.node(),gd:e,inOut_bbox:T}),t.bbox=T[0],c._hasHoverLabel=!0}c._hasHoverEvent=!0,e.emit("plotly_hover",{points:[g(t,h)],event:r.event})}})),t.on("mouseout",(function(t){var n=e._fullLayout,a=e._fullData[c.index],o=r.select(this).datum();c._hasHoverEvent&&(t.originalEvent=r.event,e.emit("plotly_unhover",{points:[g(o,a)],event:r.event}),c._hasHoverEvent=!1),c._hasHoverLabel&&(i.loneUnhover(n._hoverlayer.node()),c._hasHoverLabel=!1)})),t.on("click",(function(t){var n=e._fullLayout,a=e._fullData[c.index];e._dragging||!1===n.hovermode||(e._hoverdata=[g(t,a)],i.click(e,r.event))}))}function _(t,e,r){var n=m.castOption(t.insidetextfont.color,e.pts);!n&&t._input.textfont&&(n=m.castOption(t._input.textfont.color,e.pts));var i=m.castOption(t.insidetextfont.family,e.pts)||m.castOption(t.textfont.family,e.pts)||r.family,o=m.castOption(t.insidetextfont.size,e.pts)||m.castOption(t.textfont.size,e.pts)||r.size,s=m.castOption(t.insidetextfont.weight,e.pts)||m.castOption(t.textfont.weight,e.pts)||r.weight,l=m.castOption(t.insidetextfont.style,e.pts)||m.castOption(t.textfont.style,e.pts)||r.style,c=m.castOption(t.insidetextfont.variant,e.pts)||m.castOption(t.textfont.variant,e.pts)||r.variant,u=m.castOption(t.insidetextfont.textcase,e.pts)||m.castOption(t.textfont.textcase,e.pts)||r.textcase,h=m.castOption(t.insidetextfont.lineposition,e.pts)||m.castOption(t.textfont.lineposition,e.pts)||r.lineposition,p=m.castOption(t.insidetextfont.shadow,e.pts)||m.castOption(t.textfont.shadow,e.pts)||r.shadow;return{color:n||a.contrast(e.color),family:i,size:o,weight:s,style:l,variant:c,textcase:u,lineposition:h,shadow:p}}function b(t,e){for(var r,n,i=0;ie&&e>n||r=-4;g-=2)y(Math.PI*g,"tan");for(g=4;g>=-4;g-=2)y(Math.PI*(g+1),"tan")}if(h||f){for(g=4;g>=-4;g-=2)y(Math.PI*(g+1.5),"rad");for(g=4;g>=-4;g-=2)y(Math.PI*(g+.5),"rad")}}if(s||d||h){var v=Math.sqrt(t.width*t.width+t.height*t.height);if((a={scale:i*n*2/v,rCenter:1-i,rotate:0}).textPosAngle=(e.startangle+e.stopangle)/2,a.scale>=1)return a;m.push(a)}(d||f)&&((a=T(t,n,o,l,c)).textPosAngle=(e.startangle+e.stopangle)/2,m.push(a)),(d||p)&&((a=A(t,n,o,l,c)).textPosAngle=(e.startangle+e.stopangle)/2,m.push(a));for(var x=0,_=0,b=0;b=1)break}return m[x]}function T(t,e,r,n,i){e=Math.max(0,e-2*d);var a=t.width/t.height,o=S(a,n,e,r);return{scale:2*o/t.height,rCenter:k(a,o/e),rotate:M(i)}}function A(t,e,r,n,i){e=Math.max(0,e-2*d);var a=t.height/t.width,o=S(a,n,e,r);return{scale:2*o/t.width,rCenter:k(a,o/e),rotate:M(i+Math.PI/2)}}function k(t,e){return Math.cos(e)-t*e}function M(t){return(180/Math.PI*t+720)%180-90}function S(t,e,r,n){var i=t+1/(2*Math.tan(e));return r*Math.min(1/(Math.sqrt(i*i+.5)+i),n/(Math.sqrt(t*t+n/2)+t))}function E(t,e){return t.v!==e.vTotal||e.trace.hole?Math.min(1/(1+1/Math.sin(t.halfangle)),t.ring/2):1}function C(t,e){var r=e.pxmid[0],n=e.pxmid[1],i=t.width/2,a=t.height/2;return r<0&&(i*=-1),n<0&&(a*=-1),{scale:1,rCenter:1,rotate:0,x:i+Math.abs(a)*(i>0?1:-1)/2,y:a/(1+r*r/(n*n)),outside:!0}}function I(t,e){var r,n,i,a=t.trace,o={x:t.cx,y:t.cy},s={tx:0,ty:0};s.ty+=a.title.font.size,i=P(a),-1!==a.title.position.indexOf("top")?(o.y-=(1+i)*t.r,s.ty-=t.titleBox.height):-1!==a.title.position.indexOf("bottom")&&(o.y+=(1+i)*t.r);var l=function(t,e){return t/(void 0===e?1:e)}(t.r,t.trace.aspectratio),c=e.w*(a.domain.x[1]-a.domain.x[0])/2;return-1!==a.title.position.indexOf("left")?(c+=l,o.x-=(1+i)*l,s.tx+=t.titleBox.width/2):-1!==a.title.position.indexOf("center")?c*=2:-1!==a.title.position.indexOf("right")&&(c+=l,o.x+=(1+i)*l,s.tx-=t.titleBox.width/2),r=c/t.titleBox.width,n=L(t,e)/t.titleBox.height,{x:o.x,y:o.y,scale:Math.min(r,n),tx:s.tx,ty:s.ty}}function L(t,e){var r=t.trace,n=e.h*(r.domain.y[1]-r.domain.y[0]);return Math.min(t.titleBox.height,n/2)}function P(t){var e,r=t.pull;if(!r)return 0;if(s.isArrayOrTypedArray(r))for(r=0,e=0;er&&(r=t.pull[e]);return r}function z(t,e){for(var r=[],n=0;n1?u=(c=r.r)/i.aspectratio:c=(u=r.r)*i.aspectratio,l=(c*=(1+i.baseratio)/2)*u}o=Math.min(o,l/r.vTotal)}for(n=0;n")}if(o){var _=s.castOption(a,e.i,"texttemplate");if(_){var b={label:(n=e).label,value:n.v,valueLabel:m.formatPieValue(n.v,i.separators),percent:n.v/r.vTotal,percentLabel:m.formatPiePercent(n.v/r.vTotal,i.separators),color:n.color,text:n.text,customdata:s.castOption(a,n.i,"customdata")},w=m.getFirstFilled(a.text,e.pts);(y(w)||""===w)&&(b.text=w),e.text=s.texttemplateString(_,b,t._fullLayout._d3locale,b,a._meta||{})}else e.text=""}}function R(t,e){var r=t.rotate*Math.PI/180,n=Math.cos(r),i=Math.sin(r),a=(e.left+e.right)/2,o=(e.top+e.bottom)/2;t.textX=a*n-o*i,t.textY=a*i+o*n,t.noCenter=!0}e.exports={plot:function(t,e){var i=t._context.staticPlot,h=t._fullLayout,d=h._size;f("pie",h),b(e,t),z(e,d);var g=s.makeTraceGroups(h._pielayer,e,"trace").each((function(e){var f=r.select(this),g=e[0],y=g.trace;(function(t){var e,r,n,i=t[0],a=i.r,o=i.trace,s=m.getRotationAngle(o.rotation),l=2*Math.PI/i.vTotal,c="px0",u="px1";if("counterclockwise"===o.direction){for(e=0;ei.vTotal/2?1:0,r.halfangle=Math.PI*Math.min(r.v/i.vTotal,.5),r.ring=1-o.hole,r.rInscribed=E(r,i))})(e),f.attr("stroke-linejoin","round"),f.each((function(){var x=r.select(this).selectAll("g.slice").data(e);x.enter().append("g").classed("slice",!0),x.exit().remove();var b=[[[],[]],[[],[]]],T=!1;x.each((function(n,a){if(n.hidden)r.select(this).selectAll("path,g").remove();else{n.pointNumber=n.i,n.curveNumber=y.index,b[n.pxmid[1]<0?0:1][n.pxmid[0]<0?0:1].push(n);var l=g.cx,c=g.cy,f=r.select(this),d=f.selectAll("path.surface").data([n]);if(d.enter().append("path").classed("surface",!0).style({"pointer-events":i?"none":"all"}),f.call(v,t,e),y.pull){var x=+m.castOption(y.pull,n.pts)||0;x>0&&(l+=x*n.pxmid[0],c+=x*n.pxmid[1])}n.cxFinal=l,n.cyFinal=c;var A=y.hole;if(n.v===g.vTotal){var k="M"+(l+n.px0[0])+","+(c+n.px0[1])+L(n.px0,n.pxmid,!0,1)+L(n.pxmid,n.px0,!0,1)+"Z";A?d.attr("d","M"+(l+A*n.px0[0])+","+(c+A*n.px0[1])+L(n.px0,n.pxmid,!1,A)+L(n.pxmid,n.px0,!1,A)+"Z"+k):d.attr("d",k)}else{var M=L(n.px0,n.px1,!0,1);if(A){var S=1-A;d.attr("d","M"+(l+A*n.px1[0])+","+(c+A*n.px1[1])+L(n.px1,n.px0,!1,A)+"l"+S*n.px0[0]+","+S*n.px0[1]+M+"Z")}else d.attr("d","M"+l+","+c+"l"+n.px0[0]+","+n.px0[1]+M+"Z")}O(t,n,g);var E=m.castOption(y.textposition,n.pts),I=f.selectAll("g.slicetext").data(n.text&&"none"!==E?[0]:[]);I.enter().append("g").classed("slicetext",!0),I.exit().remove(),I.each((function(){var i=s.ensureSingle(r.select(this),"text","",(function(t){t.attr("data-notex",1)})),f=s.ensureUniformFontSize(t,"outside"===E?function(t,e,r){return{color:m.castOption(t.outsidetextfont.color,e.pts)||m.castOption(t.textfont.color,e.pts)||r.color,family:m.castOption(t.outsidetextfont.family,e.pts)||m.castOption(t.textfont.family,e.pts)||r.family,size:m.castOption(t.outsidetextfont.size,e.pts)||m.castOption(t.textfont.size,e.pts)||r.size,weight:m.castOption(t.outsidetextfont.weight,e.pts)||m.castOption(t.textfont.weight,e.pts)||r.weight,style:m.castOption(t.outsidetextfont.style,e.pts)||m.castOption(t.textfont.style,e.pts)||r.style,variant:m.castOption(t.outsidetextfont.variant,e.pts)||m.castOption(t.textfont.variant,e.pts)||r.variant,textcase:m.castOption(t.outsidetextfont.textcase,e.pts)||m.castOption(t.textfont.textcase,e.pts)||r.textcase,lineposition:m.castOption(t.outsidetextfont.lineposition,e.pts)||m.castOption(t.textfont.lineposition,e.pts)||r.lineposition,shadow:m.castOption(t.outsidetextfont.shadow,e.pts)||m.castOption(t.textfont.shadow,e.pts)||r.shadow}}(y,n,h.font):_(y,n,h.font));i.text(n.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(o.font,f).call(u.convertToTspans,t);var d,v=o.bBox(i.node());if("outside"===E)d=C(v,n);else if(d=w(v,n,g),"auto"===E&&d.scale<1){var x=s.ensureUniformFontSize(t,y.outsidetextfont);i.call(o.font,x),d=C(v=o.bBox(i.node()),n)}var b=d.textPosAngle,A=void 0===b?n.pxmid:D(g.r,b);if(d.targetX=l+A[0]*d.rCenter+(d.x||0),d.targetY=c+A[1]*d.rCenter+(d.y||0),R(d,v),d.outside){var k=d.targetY;n.yLabelMin=k-v.height/2,n.yLabelMid=k,n.yLabelMax=k+v.height/2,n.labelExtraX=0,n.labelExtraY=0,T=!0}d.fontSize=f.size,p(y.type,d,h),e[a].transform=d,s.setTransormAndDisplay(i,d)}))}function L(t,e,r,i){var a=i*(e[0]-t[0]),o=i*(e[1]-t[1]);return"a"+i*g.r+","+i*g.r+" 0 "+n.largeArc+(r?" 1 ":" 0 ")+a+","+o}}));var A=r.select(this).selectAll("g.titletext").data(y.title.text?[0]:[]);if(A.enter().append("g").classed("titletext",!0),A.exit().remove(),A.each((function(){var e,n=s.ensureSingle(r.select(this),"text","",(function(t){t.attr("data-notex",1)})),i=y.title.text;y._meta&&(i=s.templateString(i,y._meta)),n.text(i).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(o.font,y.title.font).call(u.convertToTspans,t),e="middle center"===y.title.position?function(t){var e=Math.sqrt(t.titleBox.width*t.titleBox.width+t.titleBox.height*t.titleBox.height);return{x:t.cx,y:t.cy,scale:t.trace.hole*t.r*2/e,tx:0,ty:-t.titleBox.height/2+t.trace.title.font.size}}(g):I(g,d),n.attr("transform",c(e.x,e.y)+l(Math.min(1,e.scale))+c(e.tx,e.ty))})),T&&function(t,e){var r,n,i,a,o,l,c,u,h,p,f,d,g;function y(t,e){return t.pxmid[1]-e.pxmid[1]}function v(t,e){return e.pxmid[1]-t.pxmid[1]}function x(t,r){r||(r={});var i,u,h,f,d=r.labelExtraY+(n?r.yLabelMax:r.yLabelMin),g=n?t.yLabelMin:t.yLabelMax,y=n?t.yLabelMax:t.yLabelMin,v=t.cyFinal+o(t.px0[1],t.px1[1]),x=d-g;if(x*c>0&&(t.labelExtraY=x),s.isArrayOrTypedArray(e.pull))for(u=0;u=(m.castOption(e.pull,h.pts)||0))&&((t.pxmid[1]-h.pxmid[1])*c>0?(x=h.cyFinal+o(h.px0[1],h.px1[1])-g-t.labelExtraY)*c>0&&(t.labelExtraY+=x):(y+t.labelExtraY-v)*c>0&&(i=3*l*Math.abs(u-p.indexOf(t)),(f=h.cxFinal+a(h.px0[0],h.px1[0])+i-(t.cxFinal+t.pxmid[0])-t.labelExtraX)*l>0&&(t.labelExtraX+=f)))}for(n=0;n<2;n++)for(i=n?y:v,o=n?Math.max:Math.min,c=n?1:-1,r=0;r<2;r++){for(a=r?Math.max:Math.min,l=r?1:-1,(u=t[n][r]).sort(i),h=t[1-n][r],p=h.concat(u),d=[],f=0;fMath.abs(h)?l+="l"+h*t.pxmid[0]/t.pxmid[1]+","+h+"H"+(o+t.labelExtraX+c):l+="l"+t.labelExtraX+","+u+"v"+(h-u)+"h"+c}else l+="V"+(t.yLabelMid+t.labelExtraY)+"h"+c;s.ensureSingle(n,"path","textline").call(a.stroke,e.outsidetextfont.color).attr({"stroke-width":Math.min(2,e.outsidetextfont.size/8),d:l,fill:"none"})}else n.select("path.textline").remove()}))}(x,y),T&&y.automargin){var k=o.bBox(f.node()),M=y.domain,S=d.w*(M.x[1]-M.x[0]),E=d.h*(M.y[1]-M.y[0]),L=(.5*S-g.r)/d.w,P=(.5*E-g.r)/d.h;n.autoMargin(t,"pie."+y.uid+".automargin",{xl:M.x[0]-L,xr:M.x[1]+L,yb:M.y[0]-P,yt:M.y[1]+P,l:Math.max(g.cx-g.r-k.left,0),r:Math.max(k.right-(g.cx+g.r),0),b:Math.max(k.bottom-(g.cy+g.r),0),t:Math.max(g.cy-g.r-k.top,0),pad:5})}}))}));setTimeout((function(){g.selectAll("tspan").each((function(){var t=r.select(this);t.attr("dy")&&t.attr("dy",t.attr("dy"))}))}),0)},formatSliceLabel:O,transformInsideText:w,determineInsideTextFont:_,positionTitleOutside:I,prerenderTitles:b,layoutAreas:z,attachFxHandlers:v,computeTransform:R}}}),Bu=f({"src/traces/pie/style.js"(t,e){var r=x(),n=Tr(),i=Ja().resizeText;e.exports=function(t){var e=t._fullLayout._pielayer.selectAll(".trace");i(t,e,"pie"),e.each((function(e){var i=e[0].trace,a=r.select(this);a.style({opacity:i.opacity}),a.selectAll("path.surface").each((function(e){r.select(this).call(n,e,i,t)}))}))}}}),ju=f({"src/traces/pie/base_plot.js"(t){var e=Ae();t.name="pie",t.plot=function(r,n,i,a){e.plotBasePlot(t.name,r,n,i,a)},t.clean=function(r,n,i,a){e.cleanBasePlot(t.name,r,n,i,a)}}}),Nu=f({"src/traces/pie/index.js"(t,e){e.exports={attributes:Lu(),supplyDefaults:Pu().supplyDefaults,supplyLayoutDefaults:Du(),layoutAttributes:zu(),calc:Ou().calc,crossTraceCalc:Ou().crossTraceCalc,plot:Fu().plot,style:Bu(),styleOne:Tr(),moduleType:"trace",name:"pie",basePlotModule:ju(),categories:["pie-like","pie","showLegend"],meta:{}}}}),Uu=f({"lib/pie.js"(t,e){e.exports=Nu()}}),Vu=f({"src/traces/sunburst/base_plot.js"(t){var e=Ae();t.name="sunburst",t.plot=function(r,n,i,a){e.plotBasePlot(t.name,r,n,i,a)},t.clean=function(r,n,i,a){e.cleanBasePlot(t.name,r,n,i,a)}}}),qu=f({"src/traces/sunburst/constants.js"(t,e){e.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"linear",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"]}}}),Hu=f({"src/traces/sunburst/attributes.js"(t,e){var r=U(),n=Ot().hovertemplateAttrs,i=Ot().texttemplateAttrs,a=Pe(),o=Aa().attributes,s=Lu(),l=qu(),c=R().extendFlat,u=zt().pattern;e.exports={labels:{valType:"data_array",editType:"calc"},parents:{valType:"data_array",editType:"calc"},values:{valType:"data_array",editType:"calc"},branchvalues:{valType:"enumerated",values:["remainder","total"],dflt:"remainder",editType:"calc"},count:{valType:"flaglist",flags:["branches","leaves"],dflt:"leaves",editType:"calc"},level:{valType:"any",editType:"plot",anim:!0},maxdepth:{valType:"integer",editType:"plot",dflt:-1},marker:c({colors:{valType:"data_array",editType:"calc"},line:{color:c({},s.marker.line.color,{dflt:null}),width:c({},s.marker.line.width,{dflt:1}),editType:"calc"},pattern:u,editType:"calc"},a("marker",{colorAttr:"colors",anim:!1})),leaf:{opacity:{valType:"number",editType:"style",min:0,max:1},editType:"plot"},text:s.text,textinfo:{valType:"flaglist",flags:["label","text","value","current path","percent root","percent entry","percent parent"],extras:["none"],editType:"plot"},texttemplate:i({editType:"plot"},{keys:l.eventDataKeys.concat(["label","value"])}),hovertext:s.hovertext,hoverinfo:c({},r.hoverinfo,{flags:["label","text","value","name","current path","percent root","percent entry","percent parent"],dflt:"label+text+value+name"}),hovertemplate:n({},{keys:l.eventDataKeys}),textfont:s.textfont,insidetextorientation:s.insidetextorientation,insidetextfont:s.insidetextfont,outsidetextfont:c({},s.outsidetextfont,{}),rotation:{valType:"angle",dflt:0,editType:"plot"},sort:s.sort,root:{color:{valType:"color",editType:"calc",dflt:"rgba(0,0,0,0)"},editType:"calc"},domain:o({name:"sunburst",trace:!0,editType:"calc"})}}}),Gu=f({"src/traces/sunburst/layout_attributes.js"(t,e){e.exports={sunburstcolorway:{valType:"colorlist",editType:"calc"},extendsunburstcolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),Wu=f({"src/traces/sunburst/defaults.js"(t,e){var r=le(),n=Hu(),i=Aa().defaults,a=Ya().handleText,o=Pu().handleMarkerDefaults,s=Ze(),l=s.hasColorscale,c=s.handleDefaults;e.exports=function(t,e,s,u){function h(i,a){return r.coerce(t,e,n,i,a)}var p=h("labels"),f=h("parents");if(p&&p.length&&f&&f.length){var d=h("values");d&&d.length?h("branchvalues"):h("count"),h("level"),h("maxdepth"),o(t,e,u,h);var m=e._hasColorscale=l(t,"marker","colors")||(t.marker||{}).coloraxis;m&&c(t,e,u,h,{prefix:"marker.",cLetter:"c"}),h("leaf.opacity",m?1:.7);var g=h("text");h("texttemplate"),e.texttemplate||h("textinfo",r.isArrayOrTypedArray(g)?"text+label":"label"),h("hovertext"),h("hovertemplate"),a(t,e,u,h,"auto",{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),h("insidetextorientation"),h("sort"),h("rotation"),h("root.color"),i(e,u,h),e._length=null}else e.visible=!1}}}),Zu=f({"src/traces/sunburst/layout_defaults.js"(t,e){var r=le(),n=Gu();e.exports=function(t,e){function i(i,a){return r.coerce(t,e,n,i,a)}i("sunburstcolorway",e.colorway),i("extendsunburstcolors")}}}),Yu=f({"node_modules/d3-hierarchy/dist/d3-hierarchy.js"(t,e){var r,n;r=t,n=function(t){function e(t,e){return t.parent===e.parent?1:2}function r(t,e){return t+e.x}function n(t,e){return Math.max(t,e.y)}function i(t){var e=0,r=t.children,n=r&&r.length;if(n)for(;--n>=0;)e+=r[n].value;else e=1;t.value=e}function a(t,e){var r,n,i,a,s,u=new c(t),h=+t.value&&(u.value=t.value),p=[u];for(null==e&&(e=o);r=p.pop();)if(h&&(r.value=+r.data.value),(i=e(r.data))&&(s=i.length))for(r.children=new Array(s),a=s-1;a>=0;--a)p.push(n=r.children[a]=new c(i[a])),n.parent=r,n.depth=r.depth+1;return u.eachBefore(l)}function o(t){return t.children}function s(t){t.data=t.data.data}function l(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function c(t){this.data=t,this.depth=this.height=0,this.parent=null}c.prototype=a.prototype={constructor:c,count:function(){return this.eachAfter(i)},each:function(t){var e,r,n,i,a=this,o=[a];do{for(e=o.reverse(),o=[];a=e.pop();)if(t(a),r=a.children)for(n=0,i=r.length;n=0;--r)i.push(e[r]);return this},sum:function(t){return this.eachAfter((function(e){for(var r=+t(e.data)||0,n=e.children,i=n&&n.length;--i>=0;)r+=n[i].value;e.value=r}))},sort:function(t){return this.eachBefore((function(e){e.children&&e.children.sort(t)}))},path:function(t){for(var e=this,r=function(t,e){if(t===e)return t;var r=t.ancestors(),n=e.ancestors(),i=null;for(t=r.pop(),e=n.pop();t===e;)i=t,t=r.pop(),e=n.pop();return i}(e,t),n=[e];e!==r;)e=e.parent,n.push(e);for(var i=n.length;t!==r;)n.splice(i,0,t),t=t.parent;return n},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){var t=[];return this.each((function(e){t.push(e)})),t},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(r){r!==t&&e.push({source:r.parent,target:r})})),e},copy:function(){return a(this).eachBefore(s)}};var u=Array.prototype.slice;function h(t){for(var e,r,n=0,i=(t=function(t){for(var e,r,n=t.length;n;)r=Math.random()*n--|0,e=t[n],t[n]=t[r],t[r]=e;return t}(u.call(t))).length,a=[];n0&&r*r>n*n+i*i}function m(t,e){for(var r=0;r(o*=o)?(n=(c+o-i)/(2*c),a=Math.sqrt(Math.max(0,o/c-n*n)),r.x=t.x-n*s-a*l,r.y=t.y-n*l+a*s):(n=(c+i-o)/(2*c),a=Math.sqrt(Math.max(0,i/c-n*n)),r.x=e.x+n*s-a*l,r.y=e.y+n*l+a*s)):(r.x=e.x+r.r,r.y=e.y)}function _(t,e){var r=t.r+e.r-1e-6,n=e.x-t.x,i=e.y-t.y;return r>0&&r*r>n*n+i*i}function b(t){var e=t._,r=t.next._,n=e.r+r.r,i=(e.x*r.r+r.x*e.r)/n,a=(e.y*r.r+r.y*e.r)/n;return i*i+a*a}function w(t){this._=t,this.next=null,this.previous=null}function T(t){if(!(i=t.length))return 0;var e,r,n,i,a,o,s,l,c,u,p;if((e=t[0]).x=0,e.y=0,!(i>1))return e.r;if(r=t[1],e.x=-r.r,r.x=e.r,r.y=0,!(i>2))return e.r+r.r;x(r,e,n=t[2]),e=new w(e),r=new w(r),n=new w(n),e.next=n.previous=r,r.next=e.previous=n,n.next=r.previous=e;t:for(s=3;sp&&(p=s),g=u*u*m,(f=Math.max(p/g,g/h))>d){u-=s;break}d=f}y.push(o={value:u,dice:l1?e:1)},r}(H),Z=function t(e){function r(t,r,n,i,a){if((o=t._squarify)&&o.ratio===e)for(var o,s,l,c,u,h=-1,p=o.length,f=t.value;++h1?e:1)},r}(H);t.cluster=function(){var t=e,i=1,a=1,o=!1;function s(e){var s,l=0;e.eachAfter((function(e){var i=e.children;i?(e.x=function(t){return t.reduce(r,0)/t.length}(i),e.y=function(t){return 1+t.reduce(n,0)}(i)):(e.x=s?l+=t(e,s):0,e.y=0,s=e)}));var c=function(t){for(var e;e=t.children;)t=e[0];return t}(e),u=function(t){for(var e;e=t.children;)t=e[e.length-1];return t}(e),h=c.x-t(c,u)/2,p=u.x+t(u,c)/2;return e.eachAfter(o?function(t){t.x=(t.x-e.x)*i,t.y=(e.y-t.y)*a}:function(t){t.x=(t.x-h)/(p-h)*i,t.y=(1-(e.y?t.y/e.y:1))*a})}return s.separation=function(e){return arguments.length?(t=e,s):t},s.size=function(t){return arguments.length?(o=!1,i=+t[0],a=+t[1],s):o?null:[i,a]},s.nodeSize=function(t){return arguments.length?(o=!0,i=+t[0],a=+t[1],s):o?[i,a]:null},s},t.hierarchy=a,t.pack=function(){var t=null,e=1,r=1,n=k;function i(i){return i.x=e/2,i.y=r/2,t?i.eachBefore(E(t)).eachAfter(C(n,.5)).eachBefore(I(1)):i.eachBefore(E(S)).eachAfter(C(k,1)).eachAfter(C(n,i.r/Math.min(e,r))).eachBefore(I(Math.min(e,r)/(2*i.r))),i}return i.radius=function(e){return arguments.length?(t=function(t){return null==t?null:A(t)}(e),i):t},i.size=function(t){return arguments.length?(e=+t[0],r=+t[1],i):[e,r]},i.padding=function(t){return arguments.length?(n="function"==typeof t?t:M(+t),i):n},i},t.packEnclose=h,t.packSiblings=function(t){return T(t),t},t.partition=function(){var t=1,e=1,r=0,n=!1;function i(i){var a=i.height+1;return i.x0=i.y0=r,i.x1=t,i.y1=e/a,i.eachBefore(function(t,e){return function(n){n.children&&P(n,n.x0,t*(n.depth+1)/e,n.x1,t*(n.depth+2)/e);var i=n.x0,a=n.y0,o=n.x1-r,s=n.y1-r;o0)throw new Error("cycle");return a}return r.id=function(e){return arguments.length?(t=A(e),r):t},r.parentId=function(t){return arguments.length?(e=A(t),r):e},r},t.tree=function(){var t=F,e=1,r=1,n=null;function i(i){var l=function(t){for(var e,r,n,i,a,o=new V(t,0),s=[o];e=s.pop();)if(n=e._.children)for(e.children=new Array(a=n.length),i=a-1;i>=0;--i)s.push(r=e.children[i]=new V(n[i],i)),r.parent=e;return(o.parent=new V(null,0)).children=[o],o}(i);if(l.eachAfter(a),l.parent.m=-l.z,l.eachBefore(o),n)i.eachBefore(s);else{var c=i,u=i,h=i;i.eachBefore((function(t){t.xu.x&&(u=t),t.depth>h.depth&&(h=t)}));var p=c===u?1:t(c,u)/2,f=p-c.x,d=e/(u.x+p+f),m=r/(h.depth||1);i.eachBefore((function(t){t.x=(t.x+f)*d,t.y=t.depth*m}))}return i}function a(e){var r=e.children,n=e.parent.children,i=e.i?n[e.i-1]:null;if(r){!function(t){for(var e,r=0,n=0,i=t.children,a=i.length;--a>=0;)(e=i[a]).z+=r,e.m+=r,r+=e.s+(n+=e.c)}(e);var a=(r[0].z+r[r.length-1].z)/2;i?(e.z=i.z+t(e._,i._),e.m=e.z-a):e.z=a}else i&&(e.z=i.z+t(e._,i._));e.parent.A=function(e,r,n){if(r){for(var i,a=e,o=e,s=r,l=a.parent.children[0],c=a.m,u=o.m,h=s.m,p=l.m;s=j(s),a=B(a),s&&a;)l=B(l),(o=j(o)).a=e,(i=s.z+h-a.z-c+t(s._,a._))>0&&(N(U(s,e,n),e,i),c+=i,u+=i),h+=s.m,c+=a.m,p+=l.m,u+=o.m;s&&!j(o)&&(o.t=s,o.m+=h-u),a&&!B(l)&&(l.t=a,l.m+=c-p,n=e)}return n}(e,i,e.parent.A||n[0])}function o(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function s(t){t.x*=e,t.y=t.depth*r}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(t){return arguments.length?(n=!1,e=+t[0],r=+t[1],i):n?null:[e,r]},i.nodeSize=function(t){return arguments.length?(n=!0,e=+t[0],r=+t[1],i):n?[e,r]:null},i},t.treemap=function(){var t=W,e=!1,r=1,n=1,i=[0],a=k,o=k,s=k,l=k,c=k;function u(t){return t.x0=t.y0=0,t.x1=r,t.y1=n,t.eachBefore(h),i=[0],e&&t.eachBefore(L),t}function h(e){var r=i[e.depth],n=e.x0+r,u=e.y0+r,h=e.x1-r,p=e.y1-r;h=r-1){var u=s[e];return u.x0=i,u.y0=a,u.x1=o,void(u.y1=l)}for(var h=c[e],p=n/2+h,f=e+1,d=r-1;f>>1;c[m]l-a){var v=(i*y+o*g)/n;t(e,f,g,i,a,v,l),t(f,r,y,v,a,o,l)}else{var x=(a*y+l*g)/n;t(e,f,g,i,a,o,x),t(f,r,y,i,x,o,l)}}(0,l,t.value,e,r,n,i)},t.treemapDice=P,t.treemapResquarify=Z,t.treemapSlice=q,t.treemapSliceDice=function(t,e,r,n,i){(1&t.depth?q:P)(t,e,r,n,i)},t.treemapSquarify=W,Object.defineProperty(t,"__esModule",{value:!0})},n("object"==typeof t&&typeof e<"u"?t:(r=r||self).d3=r.d3||{})}}),Xu=f({"src/traces/sunburst/calc.js"(t){var e=Yu(),r=A(),n=le(),i=Ze().makeColorScaleFuncFromTrace,a=Ou().makePullColorFn,o=Ou().generateExtendedColors,s=Ze().calc,l=k().ALMOST_EQUAL,c={},u={},h={};function p(t,e,r){var n=0,i=t.children;if(i){for(var a=i.length,o=0;o=0};v?(c=Math.min(y.length,_.length),u=function(t){return M(y[t])&&S(t)},h=function(t){return String(y[t])}):(c=Math.min(x.length,_.length),u=function(t){return M(x[t])&&S(t)},h=function(t){return String(x[t])}),w&&(c=Math.min(c,b.length));for(var E=0;E1){for(var P=n.randstr(),z=0;z>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===r?oh(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===r?oh(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=Ch.exec(t))?new ch(e[1],e[2],e[3],1):(e=Ih.exec(t))?new ch(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Lh.exec(t))?oh(e[1],e[2],e[3],e[4]):(e=Ph.exec(t))?oh(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=zh.exec(t))?gh(e[1],e[2]/100,e[3]/100,1):(e=Dh.exec(t))?gh(e[1],e[2]/100,e[3]/100,e[4]):Oh.hasOwnProperty(t)?ah(Oh[t]):"transparent"===t?new ch(NaN,NaN,NaN,0):null}function ah(t){return new ch(t>>16&255,t>>8&255,255&t,1)}function oh(t,e,r,n){return n<=0&&(t=e=r=NaN),new ch(t,e,r,n)}function sh(t){return t instanceof Qu||(t=ih(t)),t?new ch((t=t.rgb()).r,t.g,t.b,t.opacity):new ch}function lh(t,e,r,n){return 1===arguments.length?sh(t):new ch(t,e,r,n??1)}function ch(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}function uh(){return`#${mh(this.r)}${mh(this.g)}${mh(this.b)}`}function hh(){return`#${mh(this.r)}${mh(this.g)}${mh(this.b)}${mh(255*(isNaN(this.opacity)?1:this.opacity))}`}function ph(){let t=fh(this.opacity);return`${1===t?"rgb(":"rgba("}${dh(this.r)}, ${dh(this.g)}, ${dh(this.b)}${1===t?")":`, ${t})`}`}function fh(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function dh(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function mh(t){return((t=dh(t))<16?"0":"")+t.toString(16)}function gh(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new xh(t,e,r,n)}function yh(t){if(t instanceof xh)return new xh(t.h,t.s,t.l,t.opacity);if(t instanceof Qu||(t=ih(t)),!t)return new xh;if(t instanceof xh)return t;var e=(t=t.rgb()).r/255,r=t.g/255,n=t.b/255,i=Math.min(e,r,n),a=Math.max(e,r,n),o=NaN,s=a-i,l=(a+i)/2;return s?(o=e===a?(r-n)/s+6*(r0&&l<1?0:o,new xh(o,s,l,t.opacity)}function vh(t,e,r,n){return 1===arguments.length?yh(t):new xh(t,e,r,n??1)}function xh(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}function _h(t){return(t=(t||0)%360)<0?t+360:t}function bh(t){return Math.max(0,Math.min(1,t||0))}function wh(t,e,r){return 255*(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)}var Th,Ah,kh,Mh,Sh,Eh,Ch,Ih,Lh,Ph,zh,Dh,Oh,Rh,Fh,Bh=p({"node_modules/d3-color/src/color.js"(){Ju(),Ah=1/(Th=.7),kh="\\s*([+-]?\\d+)\\s*",Mh="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Sh="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Eh=/^#([0-9a-f]{3,8})$/,Ch=new RegExp(`^rgb\\(${kh},${kh},${kh}\\)$`),Ih=new RegExp(`^rgb\\(${Sh},${Sh},${Sh}\\)$`),Lh=new RegExp(`^rgba\\(${kh},${kh},${kh},${Mh}\\)$`),Ph=new RegExp(`^rgba\\(${Sh},${Sh},${Sh},${Mh}\\)$`),zh=new RegExp(`^hsl\\(${Mh},${Sh},${Sh}\\)$`),Dh=new RegExp(`^hsla\\(${Mh},${Sh},${Sh},${Mh}\\)$`),Oh={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},$u(Qu,ih,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:th,formatHex:th,formatHex8:eh,formatHsl:rh,formatRgb:nh,toString:nh}),$u(ch,lh,Ku(Qu,{brighter(t){return t=null==t?Ah:Math.pow(Ah,t),new ch(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?Th:Math.pow(Th,t),new ch(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new ch(dh(this.r),dh(this.g),dh(this.b),fh(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:uh,formatHex:uh,formatHex8:hh,formatRgb:ph,toString:ph})),$u(xh,vh,Ku(Qu,{brighter(t){return t=null==t?Ah:Math.pow(Ah,t),new xh(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?Th:Math.pow(Th,t),new xh(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,i=2*r-n;return new ch(wh(t>=240?t-240:t+120,i,n),wh(t,i,n),wh(t<120?t+240:t-120,i,n),this.opacity)},clamp(){return new xh(_h(this.h),bh(this.s),bh(this.l),fh(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(){let t=fh(this.opacity);return`${1===t?"hsl(":"hsla("}${_h(this.h)}, ${100*bh(this.s)}%, ${100*bh(this.l)}%${1===t?")":`, ${t})`}`}}))}}),jh=p({"node_modules/d3-color/src/math.js"(){Rh=Math.PI/180,Fh=180/Math.PI}});function Nh(t){if(t instanceof Vh)return new Vh(t.l,t.a,t.b,t.opacity);if(t instanceof Yh)return Xh(t);t instanceof ch||(t=sh(t));var e,r,n=Wh(t.r),i=Wh(t.g),a=Wh(t.b),o=qh((.2225045*n+.7168786*i+.0606169*a)/Kh);return n===i&&i===a?e=r=o:(e=qh((.4360747*n+.3850649*i+.1430804*a)/$h),r=qh((.0139322*n+.0971045*i+.7141733*a)/Jh)),new Vh(116*o-16,500*(e-o),200*(o-r),t.opacity)}function Uh(t,e,r,n){return 1===arguments.length?Nh(t):new Vh(t,e,r,n??1)}function Vh(t,e,r,n){this.l=+t,this.a=+e,this.b=+r,this.opacity=+n}function qh(t){return t>rp?Math.pow(t,.3333333333333333):t/ep+Qh}function Hh(t){return t>tp?t*t*t:ep*(t-Qh)}function Gh(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,.4166666666666667)-.055)}function Wh(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Zh(t,e,r,n){return 1===arguments.length?function(t){if(t instanceof Yh)return new Yh(t.h,t.c,t.l,t.opacity);if(t instanceof Vh||(t=Nh(t)),0===t.a&&0===t.b)return new Yh(NaN,0=1?(r=1,e-1):Math.floor(r*e),i=t[n],a=t[n+1],o=n>0?t[n-1]:2*i-a,s=n()=>t}});function wp(t,e){return function(r){return t+r*e}}function Tp(t,e){var r=e-t;return r?wp(t,r>180||r<-180?r-360*Math.round(r/360):r):xp(isNaN(t)?e:t)}function Ap(t,e){var r=e-t;return r?wp(t,r):xp(isNaN(t)?e:t)}var kp=p({"node_modules/d3-interpolate/src/color.js"(){bp()}});function Mp(t){return function(e){var r,n,i=e.length,a=new Array(i),o=new Array(i),s=new Array(i);for(r=0;ra&&(i=e.slice(a,i),s[o]?s[o]+=i:s[++o]=i),(r=r[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,l.push({i:o,x:jp(r,n)})),a=Gp.lastIndex;return a180?e+=360:e-t>180&&(t+=360),a.push({i:r.push(i(r)+"rotate(",null,n)-2,x:jp(t,e)})):e&&r.push(i(r)+"rotate("+e+n)}(a.rotate,o.rotate,s,l),function(t,e,r,a){t!==e?a.push({i:r.push(i(r)+"skewX(",null,n)-2,x:jp(t,e)}):e&&r.push(i(r)+"skewX("+e+n)}(a.skewX,o.skewX,s,l),function(t,e,r,n,a,o){if(t!==r||e!==n){var s=a.push(i(a)+"scale(",null,",",null,")");o.push({i:s-4,x:jp(t,r)},{i:s-2,x:jp(e,n)})}else(1!==r||1!==n)&&a.push(i(a)+"scale("+r+","+n+")")}(a.scaleX,a.scaleY,o.scaleX,o.scaleY,s,l),a=o=null,function(t){for(var e,r=-1,n=l.length;++rZp,interpolateArray:()=>Dp,interpolateBasis:()=>gp,interpolateBasisClosed:()=>vp,interpolateCubehelix:()=>Ef,interpolateCubehelixLong:()=>Cf,interpolateDate:()=>Fp,interpolateDiscrete:()=>Xp,interpolateHcl:()=>Af,interpolateHclLong:()=>kf,interpolateHsl:()=>vf,interpolateHslLong:()=>xf,interpolateHue:()=>Kp,interpolateLab:()=>bf,interpolateNumber:()=>jp,interpolateNumberArray:()=>Lp,interpolateObject:()=>Up,interpolateRgb:()=>Sp,interpolateRgbBasis:()=>Ep,interpolateRgbBasisClosed:()=>Cp,interpolateRound:()=>Qp,interpolateString:()=>qp,interpolateTransformCss:()=>hf,interpolateTransformSvg:()=>pf,interpolateZoom:()=>mf,piecewise:()=>Lf,quantize:()=>zf});var Rf=p({"node_modules/d3-interpolate/src/index.js"(){Yp(),Rp(),yp(),_p(),Bp(),$p(),Jp(),Np(),zp(),Vp(),tf(),Wp(),ff(),gf(),Ip(),_f(),wf(),Mf(),If(),Pf(),Df()}}),Ff=f({"src/traces/sunburst/fill_one.js"(t,e){var r=Qe(),n=H();e.exports=function(t,e,i,a,o){var s=e.data.data,l=s.i,c=o||s.color;if(l>=0){e.i=s.i;var u=i.marker;u.pattern?(!u.colors||!u.pattern.shape)&&(u.color=c,e.color=c):(u.color=c,e.color=c),r.pointStyle(t,i,a,e)}else n.fill(t,c)}}}),Bf=f({"src/traces/sunburst/style.js"(t,e){var r=x(),n=H(),i=le(),a=Ja().resizeText,o=Ff();function s(t,e,r,a){var s=e.data.data,l=!e.children,c=s.i,u=i.castOption(r,c,"marker.line.color")||n.defaultLine,h=i.castOption(r,c,"marker.line.width")||0;t.call(o,e,r,a).style("stroke-width",h).call(n.stroke,u).style("opacity",l?r.leaf.opacity:null)}e.exports={style:function(t){var e=t._fullLayout._sunburstlayer.selectAll(".trace");a(t,e,"sunburst"),e.each((function(e){var n=r.select(this),i=e[0].trace;n.style("opacity",i.opacity),n.selectAll("path.surface").each((function(e){r.select(this).call(s,e,i,t)}))}))},styleOne:s}}}),jf=f({"src/traces/sunburst/helpers.js"(t){var e=le(),r=H(),n=fr(),i=br();function a(t){return t.data.data.pid}t.findEntryWithLevel=function(e,r){var n;return r&&e.eachAfter((function(e){if(t.getPtId(e)===r)return n=e.copy()})),n||e},t.findEntryWithChild=function(e,r){var n;return e.eachAfter((function(e){for(var i=e.children||[],a=0;a0)},t.getMaxDepth=function(t){return t.maxdepth>=0?t.maxdepth:1/0},t.isHeader=function(e,r){return!(t.isLeaf(e)||e.depth===r._maxDepth-1)},t.getParent=function(e,r){return t.findEntryWithLevel(e,a(r))},t.listPath=function(e,r){var n=e.parent;if(!n)return[];var i=r?[n.data[r]]:[n];return t.listPath(n,r).concat(i)},t.getPath=function(e){return t.listPath(e,"label").join("/")+"/"},t.formatValue=i.formatPieValue,t.formatPercent=function(t,r){var n=e.formatPercent(t,0);return"0%"===n&&(n=i.formatPiePercent(t,r)),n}}}),Nf=f({"src/traces/sunburst/fx.js"(t,e){var r=x(),n=qt(),i=$e().appendArrayPointValue,a=Dr(),o=le(),s=fe(),l=jf(),c=br().formatPieValue;function u(t,e,r){for(var n=t.data.data,a={curveNumber:e.index,pointNumber:n.i,data:e._input,fullData:e},o=0;o"),name:k||z("name")?v.name:void 0,color:A("hoverlabel.bgcolor")||x.color,borderColor:A("hoverlabel.bordercolor"),fontFamily:A("hoverlabel.font.family"),fontSize:A("hoverlabel.font.size"),fontColor:A("hoverlabel.font.color"),fontWeight:A("hoverlabel.font.weight"),fontStyle:A("hoverlabel.font.style"),fontVariant:A("hoverlabel.font.variant"),nameLength:A("hoverlabel.namelength"),textAlign:A("hoverlabel.align"),hovertemplate:k,hovertemplateLabels:I,eventData:h};g&&(F.x0=E-n.rInscribed*n.rpx1,F.x1=E+n.rInscribed*n.rpx1,F.idealAlign=n.pxmid[0]<0?"left":"right"),y&&(F.x=E,F.idealAlign=E<0?"left":"right");var B=[];a.loneHover(F,{container:s._hoverlayer.node(),outerContainer:s._paper.node(),gd:i,inOut_bbox:B}),h[0].bbox=B[0],d._hasHoverLabel=!0}if(y){var j=t.select("path.surface");p.styleOne(j,n,v,i,{hovered:!0})}d._hasHoverEvent=!0,i.emit("plotly_hover",{points:h||[u(n,v,p.eventDataKeys)],event:r.event})}})),t.on("mouseout",(function(e){var n=i._fullLayout,o=i._fullData[d.index],s=r.select(this).datum();if(d._hasHoverEvent&&(e.originalEvent=r.event,i.emit("plotly_unhover",{points:[u(s,o,p.eventDataKeys)],event:r.event}),d._hasHoverEvent=!1),d._hasHoverLabel&&(a.loneUnhover(n._hoverlayer.node()),d._hasHoverLabel=!1),y){var l=t.select("path.surface");p.styleOne(l,s,o,i,{hovered:!1})}})),t.on("click",(function(t){var e=i._fullLayout,o=i._fullData[d.index],c=g&&(l.isHierarchyRoot(t)||l.isLeaf(t)),h=l.getPtId(t),f=l.isEntry(t)?l.findEntryWithChild(m,h):l.findEntryWithLevel(m,h),y=l.getPtId(f),v={points:[u(t,o,p.eventDataKeys)],event:r.event};c||(v.nextLevel=y);var x=s.triggerHandler(i,"plotly_"+d.type+"click",v);if(!1!==x&&e.hovermode&&(i._hoverdata=[u(t,o,p.eventDataKeys)],a.click(i,r.event)),!c&&!1!==x&&!i._dragging&&!i._transitioning){n.call("_storeDirectGUIEdit",o,e._tracePreGUI[o.uid],{level:o.level});var _={data:[{level:y}],traces:[d.index]},b={frame:{redraw:!1,duration:p.transitionTime},transition:{duration:p.transitionTime,easing:p.transitionEasing},mode:"immediate",fromcurrent:!0};a.loneUnhover(e._hoverlayer.node()),n.call("animate",i,_,b)}}))}}}),Uf=f({"src/traces/sunburst/plot.js"(t){var e=x(),r=Yu(),n=(Rf(),g(Of)).interpolate,i=Qe(),a=le(),o=Se(),s=Ja(),l=s.recordMinTextSize,c=s.clearMinTextSize,u=Fu(),h=br().getRotationAngle,p=u.computeTransform,f=u.transformInsideText,d=Bf().styleOne,m=to().resizeText,y=Nf(),v=qu(),_=jf();function b(s,c,u,m){var g=s._context.staticPlot,x=s._fullLayout,b=!x.uniformtext.mode&&_.hasTransition(m),T=e.select(u).selectAll("g.slice"),A=c[0],k=A.trace,M=A.hierarchy,S=_.findEntryWithLevel(M,k.level),E=_.getMaxDepth(k),C=x._size,I=k.domain,L=C.w*(I.x[1]-I.x[0]),P=C.h*(I.y[1]-I.y[0]),z=.5*Math.min(L,P),D=A.cx=C.l+C.w*(I.x[1]+I.x[0])/2,O=A.cy=C.t+C.h*(1-I.y[0])-P/2;if(!S)return T.remove();var R=null,F={};b&&T.each((function(t){F[_.getPtId(t)]={rpx0:t.rpx0,rpx1:t.rpx1,x0:t.x0,x1:t.x1,transform:t.transform},!R&&_.isEntry(t)&&(R=t)}));var B=function(t){return r.partition().size([2*Math.PI,t.height+1])(t)}(S).descendants(),j=S.height+1,N=0,U=E;A.hasMultipleRoots&&_.isHierarchyRoot(S)&&(B=B.slice(1),j-=1,N=1,U+=1),B=B.filter((function(t){return t.y1<=U}));var V=h(k.rotation);V&&B.forEach((function(t){t.x0+=V,t.x1+=V}));var q=Math.min(j,E),H=function(t){return(t-N)/q*z},G=function(t,e){return[t*Math.cos(e),-t*Math.sin(e)]},W=function(t){return a.pathAnnulus(t.rpx0,t.rpx1,t.x0,t.x1,D,O)},Z=function(t){return D+w(t)[0]*(t.transform.rCenter||0)+(t.transform.x||0)},Y=function(t){return O+w(t)[1]*(t.transform.rCenter||0)+(t.transform.y||0)};(T=T.data(B,_.getPtId)).enter().append("g").classed("slice",!0),b?T.exit().transition().each((function(){var t=e.select(this);t.select("path.surface").transition().attrTween("d",(function(t){var e=function(t){var e,r=_.getPtId(t),i=F[r],a=F[_.getPtId(S)];if(a){var o=(t.x1>a.x1?2*Math.PI:0)+V;e=t.rpx1X?2*Math.PI:0)+V;e={x0:o,x1:o}}else e={rpx0:z,rpx1:z},a.extendFlat(e,J(t));else e={rpx0:0,rpx1:0};else e={x0:V,x1:V};return n(e,i)}(t);return function(t){return W(e(t))}})):h.attr("d",W),u.call(y,S,s,c,{eventDataKeys:v.eventDataKeys,transitionTime:v.CLICK_TRANSITION_TIME,transitionEasing:v.CLICK_TRANSITION_EASING}).call(_.setSliceCursor,s,{hideOnRoot:!0,hideOnLeaves:!0,isTransitioning:s._transitioning}),h.call(d,r,k,s);var m=a.ensureSingle(u,"g","slicetext"),w=a.ensureSingle(m,"text","",(function(t){t.attr("data-notex",1)})),T=a.ensureUniformFontSize(s,_.determineTextFont(k,r,x.font));w.text(t.formatSliceLabel(r,S,k,c,x)).classed("slicetext",!0).attr("text-anchor","middle").call(i.font,T).call(o.convertToTspans,s);var M=i.bBox(w.node());r.transform=f(M,r,A),r.transform.targetX=Z(r),r.transform.targetY=Y(r);var E=function(t,e){var r=t.transform;return p(r,e),r.fontSize=T.size,l(k.type,r,x),a.getTextTransform(r)};b?w.transition().attrTween("transform",(function(t){var e=function(t){var e,r=F[_.getPtId(t)],i=t.transform;if(r)e=r;else if(e={rpx1:t.rpx1,transform:{textPosAngle:i.textPosAngle,scale:0,rotate:i.rotate,rCenter:i.rCenter,x:i.x,y:i.y}},R)if(t.parent)if(X){var o=t.x1>X?2*Math.PI:0;e.x0=e.x1=o}else a.extendFlat(e,J(t));else e.x0=e.x1=V;else e.x0=e.x1=V;var s=n(e.transform.textPosAngle,t.transform.textPosAngle),c=n(e.rpx1,t.rpx1),u=n(e.x0,t.x0),h=n(e.x1,t.x1),p=n(e.transform.scale,i.scale),f=n(e.transform.rotate,i.rotate),d=0===i.rCenter?3:0===e.transform.rCenter?1/3:1,m=n(e.transform.rCenter,i.rCenter);return function(t){var e=c(t),r=u(t),n=h(t),a=function(t){return m(Math.pow(t,d))}(t),o={pxmid:G(e,(r+n)/2),rpx1:e,transform:{textPosAngle:s(t),rCenter:a,x:i.x,y:i.y}};return l(k.type,i,x),{transform:{targetX:Z(o),targetY:Y(o),scale:p(t),rotate:f(t),rCenter:a}}}}(t);return function(t){return E(e(t),M)}})):w.attr("transform",E(r,M))}))}function w(t){return function(t,e){return[t*Math.sin(e),-t*Math.cos(e)]}(t.rpx1,t.transform.textPosAngle)}t.plot=function(t,r,n,i){var a,o,s=t._fullLayout,l=s._sunburstlayer,u=!n,h=!s.uniformtext.mode&&_.hasTransition(n);c("sunburst",s),(a=l.selectAll("g.trace.sunburst").data(r,(function(t){return t[0].trace.uid}))).enter().append("g").classed("trace",!0).classed("sunburst",!0).attr("stroke-linejoin","round"),a.order(),h?(i&&(o=i()),e.transition().duration(n.duration).ease(n.easing).each("end",(function(){o&&o()})).each("interrupt",(function(){o&&o()})).each((function(){l.selectAll("g.trace").each((function(e){b(t,e,this,n)}))}))):(a.each((function(e){b(t,e,this,n)})),s.uniformtext.mode&&m(t,s._sunburstlayer.selectAll(".trace"),"sunburst")),u&&a.exit().remove()},t.formatSliceLabel=function(t,e,r,n,i){var o=r.texttemplate,s=r.textinfo;if(!(o||s&&"none"!==s))return"";var l=i.separators,c=n[0],u=t.data.data,h=c.hierarchy,p=_.isHierarchyRoot(t),f=_.getParent(h,t),d=_.getValue(t);if(!o){var m,g=s.split("+"),y=function(t){return-1!==g.indexOf(t)},v=[];if(y("label")&&u.label&&v.push(u.label),u.hasOwnProperty("v")&&y("value")&&v.push(_.formatValue(u.v,l)),!p){y("current path")&&v.push(_.getPath(t.data));var x=0;y("percent parent")&&x++,y("percent entry")&&x++,y("percent root")&&x++;var b=x>1;if(x){var w,T=function(t){m=_.formatPercent(w,l),b&&(m+=" of "+t),v.push(m)};y("percent parent")&&!p&&(w=d/_.getValue(f),T("parent")),y("percent entry")&&(w=d/_.getValue(e),T("entry")),y("percent root")&&(w=d/_.getValue(h),T("root"))}}return y("text")&&(m=a.castOption(r,u.i,"text"),a.isValidTextValue(m)&&v.push(m)),v.join("
")}var A=a.castOption(r,u.i,"texttemplate");if(!A)return"";var k={};u.label&&(k.label=u.label),u.hasOwnProperty("v")&&(k.value=u.v,k.valueLabel=_.formatValue(u.v,l)),k.currentPath=_.getPath(t.data),p||(k.percentParent=d/_.getValue(f),k.percentParentLabel=_.formatPercent(k.percentParent,l),k.parent=_.getPtLabel(f)),k.percentEntry=d/_.getValue(e),k.percentEntryLabel=_.formatPercent(k.percentEntry,l),k.entry=_.getPtLabel(e),k.percentRoot=d/_.getValue(h),k.percentRootLabel=_.formatPercent(k.percentRoot,l),k.root=_.getPtLabel(h),u.hasOwnProperty("color")&&(k.color=u.color);var M=a.castOption(r,u.i,"text");return(a.isValidTextValue(M)||""===M)&&(k.text=M),k.customdata=a.castOption(r,u.i,"customdata"),a.texttemplateString(A,k,i._d3locale,k,r._meta||{})}}}),Vf=f({"src/traces/sunburst/index.js"(t,e){e.exports={moduleType:"trace",name:"sunburst",basePlotModule:Vu(),categories:[],animatable:!0,attributes:Hu(),layoutAttributes:Gu(),supplyDefaults:Wu(),supplyLayoutDefaults:Zu(),calc:Xu().calc,crossTraceCalc:Xu().crossTraceCalc,plot:Uf().plot,style:Bf().style,colorbar:fi(),meta:{}}}}),qf=f({"lib/sunburst.js"(t,e){e.exports=Vf()}}),Hf=f({"src/traces/treemap/base_plot.js"(t){var e=Ae();t.name="treemap",t.plot=function(r,n,i,a){e.plotBasePlot(t.name,r,n,i,a)},t.clean=function(r,n,i,a){e.cleanBasePlot(t.name,r,n,i,a)}}}),Gf=f({"src/traces/treemap/constants.js"(t,e){e.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"poly",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"],gapWithPathbar:1}}}),Wf=f({"src/traces/treemap/attributes.js"(t,e){var r=Ot().hovertemplateAttrs,n=Ot().texttemplateAttrs,i=Pe(),a=Aa().attributes,o=Lu(),s=Hu(),l=Gf(),c=R().extendFlat,u=zt().pattern;e.exports={labels:s.labels,parents:s.parents,values:s.values,branchvalues:s.branchvalues,count:s.count,level:s.level,maxdepth:s.maxdepth,tiling:{packing:{valType:"enumerated",values:["squarify","binary","dice","slice","slice-dice","dice-slice"],dflt:"squarify",editType:"plot"},squarifyratio:{valType:"number",min:1,dflt:1,editType:"plot"},flip:{valType:"flaglist",flags:["x","y"],dflt:"",editType:"plot"},pad:{valType:"number",min:0,dflt:3,editType:"plot"},editType:"calc"},marker:c({pad:{t:{valType:"number",min:0,editType:"plot"},l:{valType:"number",min:0,editType:"plot"},r:{valType:"number",min:0,editType:"plot"},b:{valType:"number",min:0,editType:"plot"},editType:"calc"},colors:s.marker.colors,pattern:u,depthfade:{valType:"enumerated",values:[!0,!1,"reversed"],editType:"style"},line:s.marker.line,cornerradius:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},i("marker",{colorAttr:"colors",anim:!1})),pathbar:{visible:{valType:"boolean",dflt:!0,editType:"plot"},side:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},edgeshape:{valType:"enumerated",values:[">","<","|","/","\\"],dflt:">",editType:"plot"},thickness:{valType:"number",min:12,editType:"plot"},textfont:c({},o.textfont,{}),editType:"calc"},text:o.text,textinfo:s.textinfo,texttemplate:n({editType:"plot"},{keys:l.eventDataKeys.concat(["label","value"])}),hovertext:o.hovertext,hoverinfo:s.hoverinfo,hovertemplate:r({},{keys:l.eventDataKeys}),textfont:o.textfont,insidetextfont:o.insidetextfont,outsidetextfont:c({},o.outsidetextfont,{}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"top left",editType:"plot"},sort:o.sort,root:s.root,domain:a({name:"treemap",trace:!0,editType:"calc"})}}}),Zf=f({"src/traces/treemap/layout_attributes.js"(t,e){e.exports={treemapcolorway:{valType:"colorlist",editType:"calc"},extendtreemapcolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),Yf=f({"src/traces/treemap/defaults.js"(t,e){var r=le(),n=Wf(),i=H(),a=Aa().defaults,o=Ya().handleText,s=Ha().TEXTPAD,l=Pu().handleMarkerDefaults,c=Ze(),u=c.hasColorscale,h=c.handleDefaults;e.exports=function(t,e,c,p){function f(i,a){return r.coerce(t,e,n,i,a)}var d=f("labels"),m=f("parents");if(d&&d.length&&m&&m.length){var g=f("values");g&&g.length?f("branchvalues"):f("count"),f("level"),f("maxdepth"),"squarify"===f("tiling.packing")&&f("tiling.squarifyratio"),f("tiling.flip"),f("tiling.pad");var y=f("text");f("texttemplate"),e.texttemplate||f("textinfo",r.isArrayOrTypedArray(y)?"text+label":"label"),f("hovertext"),f("hovertemplate");var v=f("pathbar.visible");o(t,e,p,f,"auto",{hasPathbar:v,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),f("textposition");var x=-1!==e.textposition.indexOf("bottom");l(t,e,p,f),(e._hasColorscale=u(t,"marker","colors")||(t.marker||{}).coloraxis)?h(t,e,p,f,{prefix:"marker.",cLetter:"c"}):f("marker.depthfade",!(e.marker.colors||[]).length);var _=2*e.textfont.size;f("marker.pad.t",x?_/4:_),f("marker.pad.l",_/4),f("marker.pad.r",_/4),f("marker.pad.b",x?_:_/4),f("marker.cornerradius"),e._hovered={marker:{line:{width:2,color:i.contrast(p.paper_bgcolor)}}},v&&(f("pathbar.thickness",e.pathbar.textfont.size+2*s),f("pathbar.side"),f("pathbar.edgeshape")),f("sort"),f("root.color"),a(e,p,f),e._length=null}else e.visible=!1}}}),Xf=f({"src/traces/treemap/layout_defaults.js"(t,e){var r=le(),n=Zf();e.exports=function(t,e){function i(i,a){return r.coerce(t,e,n,i,a)}i("treemapcolorway",e.colorway),i("extendtreemapcolors")}}}),$f=f({"src/traces/treemap/calc.js"(t){var e=Xu();t.calc=function(t,r){return e.calc(t,r)},t.crossTraceCalc=function(t){return e._runCrossTraceCalc("treemap",t)}}}),Kf=f({"src/traces/treemap/flip_tree.js"(t,e){e.exports=function t(e,r,n){var i;n.swapXY&&(i=e.x0,e.x0=e.y0,e.y0=i,i=e.x1,e.x1=e.y1,e.y1=i),n.flipX&&(i=e.x0,e.x0=r[0]-e.x1,e.x1=r[0]-i),n.flipY&&(i=e.y0,e.y0=r[1]-e.y1,e.y1=r[1]-i);var a=e.children;if(a)for(var o=0;o0)for(var b=0;b").join(" ")||"";var m=n.ensureSingle(f,"g","slicetext"),A=n.ensureSingle(m,"text","",(function(t){t.attr("data-notex",1)})),I=n.ensureUniformFontSize(t,c.determineTextFont(L,o,C.font,{onPathbar:!0}));A.text(o._text||" ").classed("slicetext",!0).attr("text-anchor","start").call(i.font,I).call(a.convertToTspans,t),o.textBB=i.bBox(A.node()),o.transform=b(o,{fontSize:I.size,onPathbar:!0}),o.transform.fontSize=I.size,T?A.transition().attrTween("transform",(function(t){var e=M(t,h,S,[g,y]);return function(t){return w(e(t))}})):A.attr("transform",w(o))}))}}}),ed=f({"src/traces/treemap/plot_one.js"(t,e){var r=x(),n=(Rf(),g(Of)).interpolate,i=jf(),a=le(),o=Ha().TEXTPAD,s=eo().toMoveInsideBar,l=Ja().recordMinTextSize,c=Gf(),u=td();function h(t){return i.isHierarchyRoot(t)?"":i.getPtId(t)}e.exports=function(t,e,p,f,d){var m=t._fullLayout,g=e[0],y=g.trace,v="icicle"===y.type,x=g.hierarchy,_=i.findEntryWithLevel(x,y.level),b=r.select(p),w=b.selectAll("g.pathbar"),T=b.selectAll("g.slice");if(!_)return w.remove(),void T.remove();var A=i.isHierarchyRoot(_),k=!m.uniformtext.mode&&i.hasTransition(f),M=i.getMaxDepth(y),S=m._size,E=y.domain,C=S.w*(E.x[1]-E.x[0]),I=S.h*(E.y[1]-E.y[0]),L=C,P=y.pathbar.thickness,z=y.marker.line.width+c.gapWithPathbar,D=y.pathbar.visible?y.pathbar.side.indexOf("bottom")>-1?I+z:-(P+z):0,O={x0:L,x1:L,y0:D,y1:D+P},R=function(t,e,r){var n=y.tiling.pad,i=function(t){return t-n<=e.x0},a=function(t){return t+n>=e.x1},o=function(t){return t-n<=e.y0},s=function(t){return t+n>=e.y1};return t.x0===e.x0&&t.x1===e.x1&&t.y0===e.y0&&t.y1===e.y1?{x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1}:{x0:i(t.x0-n)?0:a(t.x0-n)?r[0]:t.x0,x1:i(t.x1+n)?0:a(t.x1+n)?r[0]:t.x1,y0:o(t.y0-n)?0:s(t.y0-n)?r[1]:t.y0,y1:o(t.y1+n)?0:s(t.y1+n)?r[1]:t.y1}},F=null,B={},j={},N=null,U=function(t,e){return e?B[h(t)]:j[h(t)]};g.hasMultipleRoots&&A&&M++,y._maxDepth=M,y._backgroundColor=m.paper_bgcolor,y._entryDepth=_.data.depth,y._atRootLevel=A;var V=-C/2+S.l+S.w*(E.x[1]+E.x[0])/2,q=-I/2+S.t+S.h*(1-(E.y[1]+E.y[0])/2),H=function(t){return V+t},G=function(t){return q+t},W=G(0),Z=H(0),Y=function(t){return Z+t},X=function(t){return W+t};function $(t,e){return t+","+e}var K=Y(0),J=function(t){t.x=Math.max(K,t.x)},Q=y.pathbar.edgeshape,tt=y[v?"tiling":"marker"].pad,et=function(t){return-1!==y.textposition.indexOf(t)},rt=et("top"),nt=et("left"),it=et("right"),at=et("bottom"),ot=function(t,e){var r=t.x0,n=t.x1,i=t.y0,a=t.y1,c=t.textBB,u=rt||e.isHeader&&!at?"start":at?"end":"middle",h=et("right"),p=et("left")||e.onPathbar?-1:h?1:0;if(e.isHeader){if((r+=(v?tt:tt.l)-o)>=(n-=(v?tt:tt.r)-o)){var f=(r+n)/2;r=f,n=f}var d;at?i<(d=a-(v?tt:tt.b))&&d"===Q?(l.x-=a,c.x-=a,u.x-=a,h.x-=a):"/"===Q?(u.x-=a,h.x-=a,o.x-=a/2,s.x-=a/2):"\\"===Q?(l.x-=a,c.x-=a,o.x-=a/2,s.x-=a/2):"<"===Q&&(o.x-=a,s.x-=a),J(l),J(h),J(o),J(c),J(u),J(s),"M"+$(l.x,l.y)+"L"+$(c.x,c.y)+"L"+$(s.x,s.y)+"L"+$(u.x,u.y)+"L"+$(h.x,h.y)+"L"+$(o.x,o.y)+"Z"},toMoveInsideSlice:ot,makeUpdateSliceInterpolator:lt,makeUpdateTextInterpolator:ct,handleSlicesExit:ut,hasTransition:k,strTransform:ht}):w.remove()}}}),rd=f({"src/traces/treemap/draw.js"(t,e){var r=x(),n=jf(),i=Ja().clearMinTextSize,a=to().resizeText,o=ed();e.exports=function(t,e,s,l,c){var u,h,p=c.type,f=c.drawDescendants,d=t._fullLayout,m=d["_"+p+"layer"],g=!s;i(p,d),(u=m.selectAll("g.trace."+p).data(e,(function(t){return t[0].trace.uid}))).enter().append("g").classed("trace",!0).classed(p,!0),u.order(),!d.uniformtext.mode&&n.hasTransition(s)?(l&&(h=l()),r.transition().duration(s.duration).ease(s.easing).each("end",(function(){h&&h()})).each("interrupt",(function(){h&&h()})).each((function(){m.selectAll("g.trace").each((function(e){o(t,e,this,s,f)}))}))):(u.each((function(e){o(t,e,this,s,f)})),d.uniformtext.mode&&a(t,m.selectAll(".trace"),p)),g&&u.exit().remove()}}}),nd=f({"src/traces/treemap/draw_descendants.js"(t,e){var r=x(),n=le(),i=Qe(),a=Se(),o=Jf(),s=Qf().styleOne,l=Gf(),c=jf(),u=Nf(),h=Uf().formatSliceLabel,p=!1;e.exports=function(t,e,f,d,m){var g=m.width,y=m.height,v=m.viewX,x=m.viewY,_=m.pathSlice,b=m.toMoveInsideSlice,w=m.strTransform,T=m.hasTransition,A=m.handleSlicesExit,k=m.makeUpdateSliceInterpolator,M=m.makeUpdateTextInterpolator,S=m.prevEntry,E=t._context.staticPlot,C=t._fullLayout,I=e[0].trace,L=-1!==I.textposition.indexOf("left"),P=-1!==I.textposition.indexOf("right"),z=-1!==I.textposition.indexOf("bottom"),D=!z&&!I.marker.pad.t||z&&!I.marker.pad.b,O=o(f,[g,y],{packing:I.tiling.packing,squarifyratio:I.tiling.squarifyratio,flipX:I.tiling.flip.indexOf("x")>-1,flipY:I.tiling.flip.indexOf("y")>-1,pad:{inner:I.tiling.pad,top:I.marker.pad.t,left:I.marker.pad.l,right:I.marker.pad.r,bottom:I.marker.pad.b}}).descendants(),R=1/0,F=-1/0;O.forEach((function(t){var e=t.depth;e>=I._maxDepth?(t.x0=t.x1=(t.x0+t.x1)/2,t.y0=t.y1=(t.y0+t.y1)/2):(R=Math.min(R,e),F=Math.max(F,e))})),d=d.data(O,c.getPtId),I._maxVisibleLayers=isFinite(F)?F-R+1:0,d.enter().append("g").classed("slice",!0),A(d,p,{},[g,y],_),d.order();var B=null;if(T&&S){var j=c.getPtId(S);d.each((function(t){null===B&&c.getPtId(t)===j&&(B={x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1})}))}var N=function(){return B||{x0:0,x1:g,y0:0,y1:y}},U=d;return T&&(U=U.transition().each("end",(function(){var e=r.select(this);c.setSliceCursor(e,t,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})}))),U.each((function(o){var d=c.isHeader(o,I);o._x0=v(o.x0),o._x1=v(o.x1),o._y0=x(o.y0),o._y1=x(o.y1),o._hoverX=v(o.x1-I.marker.pad.r),o._hoverY=x(z?o.y1-I.marker.pad.b/2:o.y0+I.marker.pad.t/2);var m=r.select(this),A=n.ensureSingle(m,"path","surface",(function(t){t.style("pointer-events",E?"none":"all")}));T?A.transition().attrTween("d",(function(t){var e=k(t,p,N(),[g,y]);return function(t){return _(e(t))}})):A.attr("d",_),m.call(u,f,t,e,{styleOne:s,eventDataKeys:l.eventDataKeys,transitionTime:l.CLICK_TRANSITION_TIME,transitionEasing:l.CLICK_TRANSITION_EASING}).call(c.setSliceCursor,t,{isTransitioning:t._transitioning}),A.call(s,o,I,t,{hovered:!1}),o.x0===o.x1||o.y0===o.y1?o._text="":o._text=d?D?"":c.getPtLabel(o)||"":h(o,f,I,e,C)||"";var S=n.ensureSingle(m,"g","slicetext"),O=n.ensureSingle(S,"text","",(function(t){t.attr("data-notex",1)})),R=n.ensureUniformFontSize(t,c.determineTextFont(I,o,C.font)),F=o._text||" ",B=d&&-1===F.indexOf("
");O.text(F).classed("slicetext",!0).attr("text-anchor",P?"end":L||B?"start":"middle").call(i.font,R).call(a.convertToTspans,t),o.textBB=i.bBox(O.node()),o.transform=b(o,{fontSize:R.size,isHeader:d}),o.transform.fontSize=R.size,T?O.transition().attrTween("transform",(function(t){var e=M(t,p,N(),[g,y]);return function(t){return w(e(t))}})):O.attr("transform",w(o))})),B}}}),id=f({"src/traces/treemap/plot.js"(t,e){var r=rd(),n=nd();e.exports=function(t,e,i,a){return r(t,e,i,a,{type:"treemap",drawDescendants:n})}}}),ad=f({"src/traces/treemap/index.js"(t,e){e.exports={moduleType:"trace",name:"treemap",basePlotModule:Hf(),categories:[],animatable:!0,attributes:Wf(),layoutAttributes:Zf(),supplyDefaults:Yf(),supplyLayoutDefaults:Xf(),calc:$f().calc,crossTraceCalc:$f().crossTraceCalc,plot:id(),style:Qf().style,colorbar:fi(),meta:{}}}}),od=f({"lib/treemap.js"(t,e){e.exports=ad()}}),sd=f({"src/traces/icicle/base_plot.js"(t){var e=Ae();t.name="icicle",t.plot=function(r,n,i,a){e.plotBasePlot(t.name,r,n,i,a)},t.clean=function(r,n,i,a){e.cleanBasePlot(t.name,r,n,i,a)}}}),ld=f({"src/traces/icicle/attributes.js"(t,e){var r=Ot().hovertemplateAttrs,n=Ot().texttemplateAttrs,i=Pe(),a=Aa().attributes,o=Lu(),s=Hu(),l=Wf(),c=Gf(),u=R().extendFlat,h=zt().pattern;e.exports={labels:s.labels,parents:s.parents,values:s.values,branchvalues:s.branchvalues,count:s.count,level:s.level,maxdepth:s.maxdepth,tiling:{orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"plot"},flip:l.tiling.flip,pad:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},marker:u({colors:s.marker.colors,line:s.marker.line,pattern:h,editType:"calc"},i("marker",{colorAttr:"colors",anim:!1})),leaf:s.leaf,pathbar:l.pathbar,text:o.text,textinfo:s.textinfo,texttemplate:n({editType:"plot"},{keys:c.eventDataKeys.concat(["label","value"])}),hovertext:o.hovertext,hoverinfo:s.hoverinfo,hovertemplate:r({},{keys:c.eventDataKeys}),textfont:o.textfont,insidetextfont:o.insidetextfont,outsidetextfont:l.outsidetextfont,textposition:l.textposition,sort:o.sort,root:s.root,domain:a({name:"icicle",trace:!0,editType:"calc"})}}}),cd=f({"src/traces/icicle/layout_attributes.js"(t,e){e.exports={iciclecolorway:{valType:"colorlist",editType:"calc"},extendiciclecolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),ud=f({"src/traces/icicle/defaults.js"(t,e){var r=le(),n=ld(),i=H(),a=Aa().defaults,o=Ya().handleText,s=Ha().TEXTPAD,l=Pu().handleMarkerDefaults,c=Ze(),u=c.hasColorscale,h=c.handleDefaults;e.exports=function(t,e,c,p){function f(i,a){return r.coerce(t,e,n,i,a)}var d=f("labels"),m=f("parents");if(d&&d.length&&m&&m.length){var g=f("values");g&&g.length?f("branchvalues"):f("count"),f("level"),f("maxdepth"),f("tiling.orientation"),f("tiling.flip"),f("tiling.pad");var y=f("text");f("texttemplate"),e.texttemplate||f("textinfo",r.isArrayOrTypedArray(y)?"text+label":"label"),f("hovertext"),f("hovertemplate");var v=f("pathbar.visible");o(t,e,p,f,"auto",{hasPathbar:v,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),f("textposition"),l(t,e,p,f);var x=e._hasColorscale=u(t,"marker","colors")||(t.marker||{}).coloraxis;x&&h(t,e,p,f,{prefix:"marker.",cLetter:"c"}),f("leaf.opacity",x?1:.7),e._hovered={marker:{line:{width:2,color:i.contrast(p.paper_bgcolor)}}},v&&(f("pathbar.thickness",e.pathbar.textfont.size+2*s),f("pathbar.side"),f("pathbar.edgeshape")),f("sort"),f("root.color"),a(e,p,f),e._length=null}else e.visible=!1}}}),hd=f({"src/traces/icicle/layout_defaults.js"(t,e){var r=le(),n=cd();e.exports=function(t,e){function i(i,a){return r.coerce(t,e,n,i,a)}i("iciclecolorway",e.colorway),i("extendiciclecolors")}}}),pd=f({"src/traces/icicle/calc.js"(t){var e=Xu();t.calc=function(t,r){return e.calc(t,r)},t.crossTraceCalc=function(t){return e._runCrossTraceCalc("icicle",t)}}}),fd=f({"src/traces/icicle/partition.js"(t,e){var r=Yu(),n=Kf();e.exports=function(t,e,i){var a=i.flipX,o=i.flipY,s="h"===i.orientation,l=i.maxDepth,c=e[0],u=e[1];l&&(c=(t.height+1)*e[0]/Math.min(t.height+1,l),u=(t.height+1)*e[1]/Math.min(t.height+1,l));var h=r.partition().padding(i.pad.inner).size(s?[e[1],c]:[e[0],u])(t);return(s||a||o)&&n(h,e,{swapXY:s,flipX:a,flipY:o}),h}}}),dd=f({"src/traces/icicle/style.js"(t,e){var r=x(),n=H(),i=le(),a=Ja().resizeText,o=Ff();function s(t,e,r,a){var s=e.data.data,l=!e.children,c=s.i,u=i.castOption(r,c,"marker.line.color")||n.defaultLine,h=i.castOption(r,c,"marker.line.width")||0;t.call(o,e,r,a).style("stroke-width",h).call(n.stroke,u).style("opacity",l?r.leaf.opacity:null)}e.exports={style:function(t){var e=t._fullLayout._iciclelayer.selectAll(".trace");a(t,e,"icicle"),e.each((function(e){var n=r.select(this),i=e[0].trace;n.style("opacity",i.opacity),n.selectAll("path.surface").each((function(e){r.select(this).call(s,e,i,t)}))}))},styleOne:s}}}),md=f({"src/traces/icicle/draw_descendants.js"(t,e){var r=x(),n=le(),i=Qe(),a=Se(),o=fd(),s=dd().styleOne,l=Gf(),c=jf(),u=Nf(),h=Uf().formatSliceLabel,p=!1;e.exports=function(t,e,f,d,m){var g=m.width,y=m.height,v=m.viewX,x=m.viewY,_=m.pathSlice,b=m.toMoveInsideSlice,w=m.strTransform,T=m.hasTransition,A=m.handleSlicesExit,k=m.makeUpdateSliceInterpolator,M=m.makeUpdateTextInterpolator,S=m.prevEntry,E=t._context.staticPlot,C=t._fullLayout,I=e[0].trace,L=-1!==I.textposition.indexOf("left"),P=-1!==I.textposition.indexOf("right"),z=-1!==I.textposition.indexOf("bottom"),D=o(f,[g,y],{flipX:I.tiling.flip.indexOf("x")>-1,flipY:I.tiling.flip.indexOf("y")>-1,orientation:I.tiling.orientation,pad:{inner:I.tiling.pad},maxDepth:I._maxDepth}).descendants(),O=1/0,R=-1/0;D.forEach((function(t){var e=t.depth;e>=I._maxDepth?(t.x0=t.x1=(t.x0+t.x1)/2,t.y0=t.y1=(t.y0+t.y1)/2):(O=Math.min(O,e),R=Math.max(R,e))})),d=d.data(D,c.getPtId),I._maxVisibleLayers=isFinite(R)?R-O+1:0,d.enter().append("g").classed("slice",!0),A(d,p,{},[g,y],_),d.order();var F=null;if(T&&S){var B=c.getPtId(S);d.each((function(t){null===F&&c.getPtId(t)===B&&(F={x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1})}))}var j=function(){return F||{x0:0,x1:g,y0:0,y1:y}},N=d;return T&&(N=N.transition().each("end",(function(){var e=r.select(this);c.setSliceCursor(e,t,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})}))),N.each((function(o){o._x0=v(o.x0),o._x1=v(o.x1),o._y0=x(o.y0),o._y1=x(o.y1),o._hoverX=v(o.x1-I.tiling.pad),o._hoverY=x(z?o.y1-I.tiling.pad/2:o.y0+I.tiling.pad/2);var d=r.select(this),m=n.ensureSingle(d,"path","surface",(function(t){t.style("pointer-events",E?"none":"all")}));T?m.transition().attrTween("d",(function(t){var e=k(t,p,j(),[g,y],{orientation:I.tiling.orientation,flipX:I.tiling.flip.indexOf("x")>-1,flipY:I.tiling.flip.indexOf("y")>-1});return function(t){return _(e(t))}})):m.attr("d",_),d.call(u,f,t,e,{styleOne:s,eventDataKeys:l.eventDataKeys,transitionTime:l.CLICK_TRANSITION_TIME,transitionEasing:l.CLICK_TRANSITION_EASING}).call(c.setSliceCursor,t,{isTransitioning:t._transitioning}),m.call(s,o,I,t,{hovered:!1}),o.x0===o.x1||o.y0===o.y1?o._text="":o._text=h(o,f,I,e,C)||"";var A=n.ensureSingle(d,"g","slicetext"),S=n.ensureSingle(A,"text","",(function(t){t.attr("data-notex",1)})),D=n.ensureUniformFontSize(t,c.determineTextFont(I,o,C.font));S.text(o._text||" ").classed("slicetext",!0).attr("text-anchor",P?"end":L?"start":"middle").call(i.font,D).call(a.convertToTspans,t),o.textBB=i.bBox(S.node()),o.transform=b(o,{fontSize:D.size}),o.transform.fontSize=D.size,T?S.transition().attrTween("transform",(function(t){var e=M(t,p,j(),[g,y]);return function(t){return w(e(t))}})):S.attr("transform",w(o))})),F}}}),gd=f({"src/traces/icicle/plot.js"(t,e){var r=rd(),n=md();e.exports=function(t,e,i,a){return r(t,e,i,a,{type:"icicle",drawDescendants:n})}}}),yd=f({"src/traces/icicle/index.js"(t,e){e.exports={moduleType:"trace",name:"icicle",basePlotModule:sd(),categories:[],animatable:!0,attributes:ld(),layoutAttributes:cd(),supplyDefaults:ud(),supplyLayoutDefaults:hd(),calc:pd().calc,crossTraceCalc:pd().crossTraceCalc,plot:gd(),style:dd().style,colorbar:fi(),meta:{}}}}),vd=f({"lib/icicle.js"(t,e){e.exports=yd()}}),xd=f({"src/traces/funnelarea/base_plot.js"(t){var e=Ae();t.name="funnelarea",t.plot=function(r,n,i,a){e.plotBasePlot(t.name,r,n,i,a)},t.clean=function(r,n,i,a){e.cleanBasePlot(t.name,r,n,i,a)}}}),_d=f({"src/traces/funnelarea/attributes.js"(t,e){var r=Lu(),n=U(),i=Aa().attributes,a=Ot().hovertemplateAttrs,o=Ot().texttemplateAttrs,s=R().extendFlat;e.exports={labels:r.labels,label0:r.label0,dlabel:r.dlabel,values:r.values,marker:{colors:r.marker.colors,line:{color:s({},r.marker.line.color,{dflt:null}),width:s({},r.marker.line.width,{dflt:1}),editType:"calc"},pattern:r.marker.pattern,editType:"calc"},text:r.text,hovertext:r.hovertext,scalegroup:s({},r.scalegroup,{}),textinfo:s({},r.textinfo,{flags:["label","text","value","percent"]}),texttemplate:o({editType:"plot"},{keys:["label","color","value","text","percent"]}),hoverinfo:s({},n.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:a({},{keys:["label","color","value","text","percent"]}),textposition:s({},r.textposition,{values:["inside","none"],dflt:"inside"}),textfont:r.textfont,insidetextfont:r.insidetextfont,title:{text:r.title.text,font:r.title.font,position:s({},r.title.position,{values:["top left","top center","top right"],dflt:"top center"}),editType:"plot"},domain:i({name:"funnelarea",trace:!0,editType:"calc"}),aspectratio:{valType:"number",min:0,dflt:1,editType:"plot"},baseratio:{valType:"number",min:0,max:1,dflt:.333,editType:"plot"}}}}),bd=f({"src/traces/funnelarea/layout_attributes.js"(t,e){var r=zu().hiddenlabels;e.exports={hiddenlabels:r,funnelareacolorway:{valType:"colorlist",editType:"calc"},extendfunnelareacolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),wd=f({"src/traces/funnelarea/defaults.js"(t,e){var r=le(),n=_d(),i=Aa().defaults,a=Ya().handleText,o=Pu().handleLabelsAndValues,s=Pu().handleMarkerDefaults;e.exports=function(t,e,l,c){function u(i,a){return r.coerce(t,e,n,i,a)}var h=u("labels"),p=u("values"),f=o(h,p),d=f.len;if(e._hasLabels=f.hasLabels,e._hasValues=f.hasValues,!e._hasLabels&&e._hasValues&&(u("label0"),u("dlabel")),d){e._length=d,s(t,e,c,u),u("scalegroup");var m,g=u("text"),y=u("texttemplate");if(y||(m=u("textinfo",Array.isArray(g)?"text+percent":"percent")),u("hovertext"),u("hovertemplate"),y||m&&"none"!==m){var v=u("textposition");a(t,e,c,u,v,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1})}else"none"===m&&u("textposition","none");i(e,c,u),u("title.text")&&(u("title.position"),r.coerceFont(u,"title.font",c.font)),u("aspectratio"),u("baseratio")}else e.visible=!1}}}),Td=f({"src/traces/funnelarea/layout_defaults.js"(t,e){var r=le(),n=bd();e.exports=function(t,e){function i(i,a){return r.coerce(t,e,n,i,a)}i("hiddenlabels"),i("funnelareacolorway",e.colorway),i("extendfunnelareacolors")}}}),Ad=f({"src/traces/funnelarea/calc.js"(t,e){var r=Ou();e.exports={calc:function(t,e){return r.calc(t,e)},crossTraceCalc:function(t){r.crossTraceCalc(t,{type:"funnelarea"})}}}}),kd=f({"src/traces/funnelarea/plot.js"(t,e){var r=x(),n=Qe(),i=le(),a=i.strScale,o=i.strTranslate,s=Se(),l=eo().toMoveInsideBar,c=Ja(),u=c.recordMinTextSize,h=c.clearMinTextSize,p=br(),f=Fu(),d=f.attachFxHandlers,m=f.determineInsideTextFont,g=f.layoutAreas,y=f.prerenderTitles,v=f.positionTitleOutside,_=f.formatSliceLabel;function b(t,e){return"l"+(e[0]-t[0])+","+(e[1]-t[1])}function w(t,e){return[.5*(t[0]+e[0]),.5*(t[1]+e[1])]}e.exports=function(t,e){var c=t._context.staticPlot,f=t._fullLayout;h("funnelarea",f),y(e,t),g(e,f._size),i.makeTraceGroups(f._funnelarealayer,e,"trace").each((function(e){var h=r.select(this),g=e[0],y=g.trace;(function(t){if(t.length){var e=t[0],r=e.trace,n=r.aspectratio,i=r.baseratio;i>.999&&(i=.999);var a,o,s,l=Math.pow(i,2),c=e.vTotal,u=c,h=c*l/(1-l)/c,p=[];for(p.push(S()),o=t.length-1;o>-1;o--)if(!(s=t[o]).hidden){var f=s.v/u;h+=f,p.push(S())}var d=1/0,m=-1/0;for(o=0;o-1;o--)if(!(s=t[o]).hidden){var k=p[A+=1][0],M=p[A][1];s.TL=[-k,M],s.TR=[k,M],s.BL=b,s.BR=T,s.pxmid=w(s.TR,s.BR),b=s.TL,T=s.TR}}function S(){var t=function(){var t=Math.sqrt(h);return{x:t,y:-t}}();return[t.x,t.y]}})(e),h.each((function(){var h=r.select(this).selectAll("g.slice").data(e);h.enter().append("g").classed("slice",!0),h.exit().remove(),h.each((function(a,o){if(a.hidden)r.select(this).selectAll("path,g").remove();else{a.pointNumber=a.i,a.curveNumber=y.index;var h=g.cx,v=g.cy,x=r.select(this),w=x.selectAll("path.surface").data([a]);w.enter().append("path").classed("surface",!0).style({"pointer-events":c?"none":"all"}),x.call(d,t,e);var T="M"+(h+a.TR[0])+","+(v+a.TR[1])+b(a.TR,a.BR)+b(a.BR,a.BL)+b(a.BL,a.TL)+"Z";w.attr("d",T),_(t,a,g);var A=p.castOption(y.textposition,a.pts),k=x.selectAll("g.slicetext").data(a.text&&"none"!==A?[0]:[]);k.enter().append("g").classed("slicetext",!0),k.exit().remove(),k.each((function(){var c=i.ensureSingle(r.select(this),"text","",(function(t){t.attr("data-notex",1)})),p=i.ensureUniformFontSize(t,m(y,a,f.font));c.text(a.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(n.font,p).call(s.convertToTspans,t);var d,g,x,_=n.bBox(c.node()),b=Math.min(a.BL[1],a.BR[1])+v,w=Math.max(a.TL[1],a.TR[1])+v;g=Math.max(a.TL[0],a.BL[0])+h,x=Math.min(a.TR[0],a.BR[0])+h,(d=l(g,x,b,w,_,{isHorizontal:!0,constrained:!0,angle:0,anchor:"middle"})).fontSize=p.size,u(y.type,d,f),e[o].transform=d,i.setTransormAndDisplay(c,d)}))}}));var x=r.select(this).selectAll("g.titletext").data(y.title.text?[0]:[]);x.enter().append("g").classed("titletext",!0),x.exit().remove(),x.each((function(){var e=i.ensureSingle(r.select(this),"text","",(function(t){t.attr("data-notex",1)})),l=y.title.text;y._meta&&(l=i.templateString(l,y._meta)),e.text(l).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(n.font,y.title.font).call(s.convertToTspans,t);var c=v(g,f._size);e.attr("transform",o(c.x,c.y)+a(Math.min(1,c.scale))+o(c.tx,c.ty))}))}))}))}}}),Md=f({"src/traces/funnelarea/style.js"(t,e){var r=x(),n=Tr(),i=Ja().resizeText;e.exports=function(t){var e=t._fullLayout._funnelarealayer.selectAll(".trace");i(t,e,"funnelarea"),e.each((function(e){var i=e[0].trace,a=r.select(this);a.style({opacity:i.opacity}),a.selectAll("path.surface").each((function(e){r.select(this).call(n,e,i,t)}))}))}}}),Sd=f({"src/traces/funnelarea/index.js"(t,e){e.exports={moduleType:"trace",name:"funnelarea",basePlotModule:xd(),categories:["pie-like","funnelarea","showLegend"],attributes:_d(),layoutAttributes:bd(),supplyDefaults:wd(),supplyLayoutDefaults:Td(),calc:Ad().calc,crossTraceCalc:Ad().crossTraceCalc,plot:kd(),style:Md(),styleOne:Tr(),meta:{}}}}),Ed=f({"lib/funnelarea.js"(t,e){e.exports=Sd()}}),Cd=f({"stackgl_modules/index.js"(t,e){!function(){var t={1964:function(t,e,r){t.exports={alpha_shape:r(3502),convex_hull:r(7352),delaunay_triangulate:r(7642),gl_cone3d:r(6405),gl_error3d:r(9165),gl_line3d:r(5714),gl_mesh3d:r(7201),gl_plot3d:r(4100),gl_scatter3d:r(8418),gl_streamtube3d:r(7815),gl_surface3d:r(9499),ndarray:r(9618),ndarray_linear_interpolate:r(4317)}},4793:function(t,e,r){function n(t,e){for(var r=0;rp)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,d.prototype),e}function d(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return y(t)}return m(t,e,r)}function m(t,e,r){if("string"==typeof t)return function(t,e){if(("string"!=typeof e||""===e)&&(e="utf8"),!d.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|b(t,e),n=f(r),i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(et(t,Uint8Array)){var e=new Uint8Array(t);return x(e.buffer,e.byteOffset,e.byteLength)}return v(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+l(t));if(et(t,ArrayBuffer)||t&&et(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(et(t,SharedArrayBuffer)||t&&et(t.buffer,SharedArrayBuffer)))return x(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return d.from(n,e,r);var i=function(t){if(d.isBuffer(t)){var e=0|_(t.length),r=f(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||rt(t.length)?f(0):v(t):"Buffer"===t.type&&Array.isArray(t.data)?v(t.data):void 0}(t);if(i)return i;if(typeof Symbol<"u"&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return d.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+l(t))}function g(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function y(t){return g(t),f(t<0?0:0|_(t))}function v(t){for(var e=t.length<0?0:0|_(t.length),r=f(e),n=0;n=p)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+p.toString(16)+" bytes");return 0|t}function b(t,e){if(d.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||et(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+l(t));var r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return J(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return Q(t).length;default:if(i)return n?-1:J(t).length;e=(""+e).toLowerCase(),i=!0}}function w(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0)||(r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return R(this,e,r);case"utf8":case"utf-8":return P(this,e,r);case"ascii":return D(this,e,r);case"latin1":case"binary":return O(this,e,r);case"base64":return L(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function T(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function A(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),rt(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=d.from(e,n)),d.isBuffer(e))return 0===e.length?-1:k(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):k(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function k(t,e,r,n,i){var a,o=1,s=t.length,l=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;o=2,s/=2,l/=2,r/=2}function c(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(i){var u=-1;for(a=r;as&&(r=s-l),a=r;a>=0;a--){for(var h=!0,p=0;pi&&(n=i):n=i;var a,o=e.length;for(n>o/2&&(n=o/2),a=0;a>8,i=r%256,a.push(i),a.push(n);return a}(e,t.length-r),t,r,n)}function L(t,e,r){return 0===e&&r===t.length?c.fromByteArray(t):c.fromByteArray(t.slice(e,r))}function P(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i239?4:a>223?3:a>191?2:1;if(i+s<=r){var l=void 0,c=void 0,u=void 0,h=void 0;switch(s){case 1:a<128&&(o=a);break;case 2:128==(192&(l=t[i+1]))&&(h=(31&a)<<6|63&l)>127&&(o=h);break;case 3:l=t[i+1],c=t[i+2],128==(192&l)&&128==(192&c)&&(h=(15&a)<<12|(63&l)<<6|63&c)>2047&&(h<55296||h>57343)&&(o=h);break;case 4:l=t[i+1],c=t[i+2],u=t[i+3],128==(192&l)&&128==(192&c)&&128==(192&u)&&(h=(15&a)<<18|(63&l)<<12|(63&c)<<6|63&u)>65535&&h<1114112&&(o=h)}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(t){var e=t.length;if(e<=z)return String.fromCharCode.apply(String,t);for(var r="",n=0;nn.length?(d.isBuffer(a)||(a=d.from(a)),a.copy(n,i)):Uint8Array.prototype.set.call(n,a,i);else{if(!d.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(n,i)}i+=a.length}return n},d.byteLength=b,d.prototype._isBuffer=!0,d.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;er&&(t+=" ... "),""},h&&(d.prototype[h]=d.prototype.inspect),d.prototype.compare=function(t,e,r,n,i){if(et(t,Uint8Array)&&(t=d.from(t,t.offset,t.byteLength)),!d.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+l(t));if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var a=(i>>>=0)-(n>>>=0),o=(r>>>=0)-(e>>>=0),s=Math.min(a,o),c=this.slice(n,i),u=t.slice(e,r),h=0;h>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return M(this,t,e,r);case"utf8":case"utf-8":return S(this,t,e,r);case"ascii":case"latin1":case"binary":return E(this,t,e,r);case"base64":return C(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,e,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},d.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var z=4096;function D(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;in)&&(r=n);for(var i="",a=e;ar)throw new RangeError("Trying to access beyond buffer length")}function j(t,e,r,n,i,a){if(!d.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function N(t,e,r,n,i){Y(e,n,i,t,r,7);var a=Number(e&BigInt(4294967295));t[r++]=a,a>>=8,t[r++]=a,a>>=8,t[r++]=a,a>>=8,t[r++]=a;var o=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,r}function U(t,e,r,n,i){Y(e,n,i,t,r,7);var a=Number(e&BigInt(4294967295));t[r+7]=a,a>>=8,t[r+6]=a,a>>=8,t[r+5]=a,a>>=8,t[r+4]=a;var o=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=o,o>>=8,t[r+2]=o,o>>=8,t[r+1]=o,o>>=8,t[r]=o,r+8}function V(t,e,r,n,i,a){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function q(t,e,r,n,i){return e=+e,r>>>=0,i||V(t,0,r,4),u.write(t,e,r,n,23,4),r+4}function H(t,e,r,n,i){return e=+e,r>>>=0,i||V(t,0,r,8),u.write(t,e,r,n,52,8),r+8}d.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||B(t,e,this.length);for(var n=this[t],i=1,a=0;++a>>=0,e>>>=0,r||B(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},d.prototype.readUint8=d.prototype.readUInt8=function(t,e){return t>>>=0,e||B(t,1,this.length),this[t]},d.prototype.readUint16LE=d.prototype.readUInt16LE=function(t,e){return t>>>=0,e||B(t,2,this.length),this[t]|this[t+1]<<8},d.prototype.readUint16BE=d.prototype.readUInt16BE=function(t,e){return t>>>=0,e||B(t,2,this.length),this[t]<<8|this[t+1]},d.prototype.readUint32LE=d.prototype.readUInt32LE=function(t,e){return t>>>=0,e||B(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},d.prototype.readUint32BE=d.prototype.readUInt32BE=function(t,e){return t>>>=0,e||B(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},d.prototype.readBigUInt64LE=it((function(t){X(t>>>=0,"offset");var e=this[t],r=this[t+7];(void 0===e||void 0===r)&&$(t,this.length-8);var n=e+this[++t]*Math.pow(2,8)+this[++t]*Math.pow(2,16)+this[++t]*Math.pow(2,24),i=this[++t]+this[++t]*Math.pow(2,8)+this[++t]*Math.pow(2,16)+r*Math.pow(2,24);return BigInt(n)+(BigInt(i)<>>=0,"offset");var e=this[t],r=this[t+7];(void 0===e||void 0===r)&&$(t,this.length-8);var n=e*Math.pow(2,24)+this[++t]*Math.pow(2,16)+this[++t]*Math.pow(2,8)+this[++t],i=this[++t]*Math.pow(2,24)+this[++t]*Math.pow(2,16)+this[++t]*Math.pow(2,8)+r;return(BigInt(n)<>>=0,e>>>=0,r||B(t,e,this.length);for(var n=this[t],i=1,a=0;++a=(i*=128)&&(n-=Math.pow(2,8*e)),n},d.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||B(t,e,this.length);for(var n=e,i=1,a=this[t+--n];n>0&&(i*=256);)a+=this[t+--n]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*e)),a},d.prototype.readInt8=function(t,e){return t>>>=0,e||B(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},d.prototype.readInt16LE=function(t,e){t>>>=0,e||B(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},d.prototype.readInt16BE=function(t,e){t>>>=0,e||B(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},d.prototype.readInt32LE=function(t,e){return t>>>=0,e||B(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},d.prototype.readInt32BE=function(t,e){return t>>>=0,e||B(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},d.prototype.readBigInt64LE=it((function(t){X(t>>>=0,"offset");var e=this[t],r=this[t+7];(void 0===e||void 0===r)&&$(t,this.length-8);var n=this[t+4]+this[t+5]*Math.pow(2,8)+this[t+6]*Math.pow(2,16)+(r<<24);return(BigInt(n)<>>=0,"offset");var e=this[t],r=this[t+7];(void 0===e||void 0===r)&&$(t,this.length-8);var n=(e<<24)+this[++t]*Math.pow(2,16)+this[++t]*Math.pow(2,8)+this[++t];return(BigInt(n)<>>=0,e||B(t,4,this.length),u.read(this,t,!0,23,4)},d.prototype.readFloatBE=function(t,e){return t>>>=0,e||B(t,4,this.length),u.read(this,t,!1,23,4)},d.prototype.readDoubleLE=function(t,e){return t>>>=0,e||B(t,8,this.length),u.read(this,t,!0,52,8)},d.prototype.readDoubleBE=function(t,e){return t>>>=0,e||B(t,8,this.length),u.read(this,t,!1,52,8)},d.prototype.writeUintLE=d.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||j(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,a=0;for(this[e]=255&t;++a>>=0,r>>>=0,n||j(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,a=1;for(this[e+i]=255&t;--i>=0&&(a*=256);)this[e+i]=t/a&255;return e+r},d.prototype.writeUint8=d.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,1,255,0),this[e]=255&t,e+1},d.prototype.writeUint16LE=d.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},d.prototype.writeUint16BE=d.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},d.prototype.writeUint32LE=d.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},d.prototype.writeUint32BE=d.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},d.prototype.writeBigUInt64LE=it((function(t){return N(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))})),d.prototype.writeBigUInt64BE=it((function(t){return U(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))})),d.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);j(this,t,e,r,i-1,-i)}var a=0,o=1,s=0;for(this[e]=255&t;++a>>=0,!n){var i=Math.pow(2,8*r-1);j(this,t,e,r,i-1,-i)}var a=r-1,o=1,s=0;for(this[e+a]=255&t;--a>=0&&(o*=256);)t<0&&0===s&&0!==this[e+a+1]&&(s=1),this[e+a]=(t/o|0)-s&255;return e+r},d.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},d.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},d.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},d.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},d.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},d.prototype.writeBigInt64LE=it((function(t){return N(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),d.prototype.writeBigInt64BE=it((function(t){return U(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),d.prototype.writeFloatLE=function(t,e,r){return q(this,t,e,!0,r)},d.prototype.writeFloatBE=function(t,e,r){return q(this,t,e,!1,r)},d.prototype.writeDoubleLE=function(t,e,r){return H(this,t,e,!0,r)},d.prototype.writeDoubleBE=function(t,e,r){return H(this,t,e,!1,r)},d.prototype.copy=function(t,e,r,n){if(!d.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),!n&&0!==n&&(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(a=e;a=n+4;r-=3)e="_".concat(t.slice(r-3,r)).concat(e);return"".concat(t.slice(0,r)).concat(e)}function Y(t,e,r,n,i,a){if(t>r||t3?0===e||e===BigInt(0)?">= 0".concat(s," and < 2").concat(s," ** ").concat(8*(a+1)).concat(s):">= -(2".concat(s," ** ").concat(8*(a+1)-1).concat(s,") and < 2 ** ")+"".concat(8*(a+1)-1).concat(s):">= ".concat(e).concat(s," and <= ").concat(r).concat(s),new G.ERR_OUT_OF_RANGE("value",o,t)}!function(t,e,r){X(e,"offset"),(void 0===t[e]||void 0===t[e+r])&&$(e,t.length-(r+1))}(n,i,a)}function X(t,e){if("number"!=typeof t)throw new G.ERR_INVALID_ARG_TYPE(e,"number",t)}function $(t,e,r){throw Math.floor(t)!==t?(X(t,r),new G.ERR_OUT_OF_RANGE(r||"offset","an integer",t)):e<0?new G.ERR_BUFFER_OUT_OF_BOUNDS:new G.ERR_OUT_OF_RANGE(r||"offset",">= ".concat(r?1:0," and <= ").concat(e),t)}W("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?"".concat(t," is outside of buffer bounds"):"Attempt to access memory outside buffer bounds"}),RangeError),W("ERR_INVALID_ARG_TYPE",(function(t,e){return'The "'.concat(t,'" argument must be of type number. Received type ').concat(l(e))}),TypeError),W("ERR_OUT_OF_RANGE",(function(t,e,r){var n='The value of "'.concat(t,'" is out of range.'),i=r;return Number.isInteger(r)&&Math.abs(r)>Math.pow(2,32)?i=Z(String(r)):"bigint"==typeof r&&(i=String(r),(r>Math.pow(BigInt(2),BigInt(32))||r<-Math.pow(BigInt(2),BigInt(32)))&&(i=Z(i)),i+="n"),n+" It must be ".concat(e,". Received ").concat(i)}),RangeError);var K=/[^+/0-9A-Za-z-_]/g;function J(t,e){e=e||1/0;for(var r,n=t.length,i=null,a=[],o=0;o55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(e-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;a.push(r)}else if(r<2048){if((e-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function Q(t){return c.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(K,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function tt(t,e,r,n){var i;for(i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function et(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function rt(t){return t!=t}var nt=function(){for(var t="0123456789abcdef",e=new Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)e[n+i]=t[r]+t[i];return e}();function it(t){return typeof BigInt>"u"?at:t}function at(){throw new Error("BigInt not supported")}},9216:function(t){t.exports=i,t.exports.isMobile=i,t.exports.default=i;var e=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,r=/CrOS/,n=/android|ipad|playbook|silk/i;function i(t){t||(t={});var i=t.ua;if(!i&&typeof navigator<"u"&&(i=navigator.userAgent),i&&i.headers&&"string"==typeof i.headers["user-agent"]&&(i=i.headers["user-agent"]),"string"!=typeof i)return!1;var a=e.test(i)&&!r.test(i)||!!t.tablet&&n.test(i);return!a&&t.tablet&&t.featureDetect&&navigator&&navigator.maxTouchPoints>1&&-1!==i.indexOf("Macintosh")&&-1!==i.indexOf("Safari")&&(a=!0),a}},6296:function(t,e,r){t.exports=function(t){var e=(t=t||{}).eye||[0,0,1],r=t.center||[0,0,0],s=t.up||[0,1,0],l=t.distanceLimits||[0,1/0],c=t.mode||"turntable",u=n(),h=i(),p=a();return u.setDistanceLimits(l[0],l[1]),u.lookAt(0,e,r,s),h.setDistanceLimits(l[0],l[1]),h.lookAt(0,e,r,s),p.setDistanceLimits(l[0],l[1]),p.lookAt(0,e,r,s),new o({turntable:u,orbit:h,matrix:p},c)};var n=r(7261),i=r(9977),a=r(1811);function o(t,e){this._controllerNames=Object.keys(t),this._controllerList=this._controllerNames.map((function(e){return t[e]})),this._mode=e,this._active=t[e],this._active||(this._mode="turntable",this._active=t.turntable),this.modes=this._controllerNames,this.computedMatrix=this._active.computedMatrix,this.computedEye=this._active.computedEye,this.computedUp=this._active.computedUp,this.computedCenter=this._active.computedCenter,this.computedRadius=this._active.computedRadius}var s=o.prototype;s.flush=function(t){for(var e=this._controllerList,r=0;r"u"?r(1538):WeakMap,i=r(2762),a=r(8116),o=new n;t.exports=function(t){var e=o.get(t),r=e&&(e._triangleBuffer.handle||e._triangleBuffer.buffer);if(!r||!t.isBuffer(r)){var n=i(t,new Float32Array([-1,-1,-1,4,4,-1]));(e=a(t,[{buffer:n,type:t.FLOAT,size:2}]))._triangleBuffer=n,o.set(t,e)}e.bind(),t.drawArrays(t.TRIANGLES,0,3),e.unbind()}},1085:function(t,e,r){var n=r(1371);t.exports=function(t,e,r){e="number"==typeof e?e:1,r=r||": ";var i=t.split(/\r?\n/),a=String(i.length+e-1).length;return i.map((function(t,i){var o=i+e,s=String(o).length;return n(o,a-s)+r+t})).join("\n")}},3952:function(t,e,r){t.exports=function(t){var e=t.length;if(0===e)return[];if(1===e)return[0];for(var r=t[0].length,n=[t[0]],a=[0],o=1;o0?o-4:o;for(r=0;r>16&255,c[u++]=e>>8&255,c[u++]=255&e;return 2===l&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,c[u++]=255&e),1===l&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,c[u++]=e>>8&255,c[u++]=255&e),c},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,a=[],o=16383,s=0,l=n-i;sl?l:s+o));return 1===i?(e=t[n-1],a.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],a.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),a.join("")};for(var r=[],n=[],i=typeof Uint8Array<"u"?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0;o<64;++o)r[o]=a[o],n[a.charCodeAt(o)]=o;function s(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function l(t){return r[t>>18&63]+r[t>>12&63]+r[t>>6&63]+r[63&t]}function c(t,e,r){for(var n,i=[],a=e;a0?c=c.ushln(h):h<0&&(u=u.ushln(-h)),s(c,u)}},6330:function(t,e,r){var n=r(1533);t.exports=function(t){return Array.isArray(t)&&2===t.length&&n(t[0])&&n(t[1])}},5716:function(t,e,r){var n=r(6859);t.exports=function(t){return t.cmp(new n(0))}},1369:function(t,e,r){var n=r(5716);t.exports=function(t){var e=t.length,r=t.words,i=0;if(1===e)i=r[0];else if(2===e)i=r[0]+67108864*r[1];else for(var a=0;a20?52:r+32}},1533:function(t,e,r){r(6859),t.exports=function(t){return t&&"object"==typeof t&&!!t.words}},2651:function(t,e,r){var n=r(6859),i=r(2361);t.exports=function(t){var e=i.exponent(t);return e<52?new n(t):new n(t*Math.pow(2,52-e)).ushln(e-52)}},869:function(t,e,r){var n=r(2651),i=r(5716);t.exports=function(t,e){var r=i(t),a=i(e);if(0===r)return[n(0),n(1)];if(0===a)return[n(0),n(0)];a<0&&(t=t.neg(),e=e.neg());var o=t.gcd(e);return o.cmpn(1)?[t.div(o),e.div(o)]:[t,e]}},6768:function(t,e,r){var n=r(6859);t.exports=function(t){return new n(t)}},6504:function(t,e,r){var n=r(869);t.exports=function(t,e){return n(t[0].mul(e[0]),t[1].mul(e[1]))}},7721:function(t,e,r){var n=r(5716);t.exports=function(t){return n(t[0])*n(t[1])}},5572:function(t,e,r){var n=r(869);t.exports=function(t,e){return n(t[0].mul(e[1]).sub(t[1].mul(e[0])),t[1].mul(e[1]))}},946:function(t,e,r){var n=r(1369),i=r(4025);t.exports=function(t){var e=t[0],r=t[1];if(0===e.cmpn(0))return 0;var a=e.abs().divmod(r.abs()),o=a.div,s=n(o),l=a.mod,c=e.negative!==r.negative?-1:1;if(0===l.cmpn(0))return c*s;if(s){var u=i(s)+4;return c*(s+(p=n(l.ushln(u).divRound(r)))*Math.pow(2,-u))}var h=r.bitLength()-l.bitLength()+53,p=n(l.ushln(h).divRound(r));return h<1023?c*p*Math.pow(2,-h):c*(p*=Math.pow(2,-1023))*Math.pow(2,1023-h)}},2478:function(t){function e(t,e,r,n,i){for(var a=i+1;n<=i;){var o=n+i>>>1,s=t[o];(void 0!==r?r(s,e):s-e)>=0?(a=o,i=o-1):n=o+1}return a}function r(t,e,r,n,i){for(var a=i+1;n<=i;){var o=n+i>>>1,s=t[o];(void 0!==r?r(s,e):s-e)>0?(a=o,i=o-1):n=o+1}return a}function n(t,e,r,n,i){for(var a=n-1;n<=i;){var o=n+i>>>1,s=t[o];(void 0!==r?r(s,e):s-e)<0?(a=o,n=o+1):i=o-1}return a}function i(t,e,r,n,i){for(var a=n-1;n<=i;){var o=n+i>>>1,s=t[o];(void 0!==r?r(s,e):s-e)<=0?(a=o,n=o+1):i=o-1}return a}function a(t,e,r,n,i){for(;n<=i;){var a=n+i>>>1,o=t[a],s=void 0!==r?r(o,e):o-e;if(0===s)return a;s<=0?n=a+1:i=a-1}return-1}function o(t,e,r,n,i,a){return"function"==typeof r?a(t,e,r,void 0===n?0:0|n,void 0===i?t.length-1:0|i):a(t,e,void 0,void 0===r?0:0|r,void 0===n?t.length-1:0|n)}t.exports={ge:function(t,r,n,i,a){return o(t,r,n,i,a,e)},gt:function(t,e,n,i,a){return o(t,e,n,i,a,r)},lt:function(t,e,r,i,a){return o(t,e,r,i,a,n)},le:function(t,e,r,n,a){return o(t,e,r,n,a,i)},eq:function(t,e,r,n,i){return o(t,e,r,n,i,a)}}},8828:function(t,e){function r(t){var e=32;return(t&=-t)&&e--,65535&t&&(e-=16),16711935&t&&(e-=8),252645135&t&&(e-=4),858993459&t&&(e-=2),1431655765&t&&(e-=1),e}e.INT_BITS=32,e.INT_MAX=2147483647,e.INT_MIN=-1<<31,e.sign=function(t){return(t>0)-(t<0)},e.abs=function(t){var e=t>>31;return(t^e)-e},e.min=function(t,e){return e^(t^e)&-(t65535)<<4,e|=r=((t>>>=e)>255)<<3,e|=r=((t>>>=r)>15)<<2,(e|=r=((t>>>=r)>3)<<1)|(t>>>=r)>>1},e.log10=function(t){return t>=1e9?9:t>=1e8?8:t>=1e7?7:t>=1e6?6:t>=1e5?5:t>=1e4?4:t>=1e3?3:t>=100?2:t>=10?1:0},e.popCount=function(t){return 16843009*((t=(858993459&(t-=t>>>1&1431655765))+(t>>>2&858993459))+(t>>>4)&252645135)>>>24},e.countTrailingZeros=r,e.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,1+((t|=t>>>8)|t>>>16)},e.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)-(t>>>1)},e.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,27030>>>(t&=15)&1};var n=new Array(256);(function(t){for(var e=0;e<256;++e){var r=e,n=e,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;t[e]=n<>>8&255]<<16|n[t>>>16&255]<<8|n[t>>>24&255]},e.interleave2=function(t,e){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))<<1},e.deinterleave2=function(t,e){return(t=65535&((t=16711935&((t=252645135&((t=858993459&((t=t>>>e&1431655765)|t>>>1))|t>>>2))|t>>>4))|t>>>16))<<16>>16},e.interleave3=function(t,e,r){return t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2),(t|=(e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},e.deinterleave3=function(t,e){return(t=1023&((t=4278190335&((t=251719695&((t=3272356035&((t=t>>>e&1227133513)|t>>>2))|t>>>4))|t>>>8))|t>>>16))<<22>>22},e.nextCombination=function(t){var e=t|t-1;return e+1|(~e&-~e)-1>>>r(t)+1}},6859:function(t,e,r){!function(t,e){function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function a(t,e,r){if(a.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&(("le"===e||"be"===e)&&(r=e,e=10),this._init(t||0,e||10,r||"be"))}var o;"object"==typeof t?t.exports=a:e.BN=a,a.BN=a,a.wordSize=26;try{o=typeof window<"u"&&typeof window.Buffer<"u"?window.Buffer:r(7790).Buffer}catch{}function s(t,e){var r=t.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function l(t,e,r){var n=s(t,r);return r-1>=e&&(n|=s(t,r-1)<<4),n}function c(t,e,r,n){for(var i=0,a=Math.min(t.length,r),o=e;o=49?s-49+10:s>=17?s-17+10:s}return i}a.isBN=function(t){return t instanceof a||null!==t&&"object"==typeof t&&t.constructor.wordSize===a.wordSize&&Array.isArray(t.words)},a.max=function(t,e){return t.cmp(e)>0?t:e},a.min=function(t,e){return t.cmp(e)<0?t:e},a.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)o=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[a]|=o<>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);else if("le"===r)for(i=0,a=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);return this.strip()},a.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n=e;n-=2)i=l(t,e,n)<=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;else for(n=(t.length-e)%2==0?e+1:e;n=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;this.strip()},a.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var a=t.length-r,o=a%n,s=Math.min(a,a-o)+r,l=0,u=r;u1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?""};var u=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],a=0|e.words[0],o=i*a,s=67108863&o,l=o/67108864|0;r.words[0]=s;for(var c=1;c>>26,h=67108863&l,p=Math.min(c,e.length-1),f=Math.max(0,c-t.length+1);f<=p;f++){var d=c-f|0;u+=(o=(i=0|t.words[d])*(a=0|e.words[f])+h)/67108864|0,h=67108863&o}r.words[c]=0|h,l=0|u}return 0!==l?r.words[c]=0|l:r.length--,r.strip()}a.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,a=0,o=0;o>>24-i&16777215)||o!==this.length-1?u[6-l.length]+l+r:l+r,(i+=2)>=26&&(i-=26,o--)}for(0!==a&&(r=a.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=h[t],f=p[t];r="";var d=this.clone();for(d.negative=0;!d.isZero();){var m=d.modn(f).toString(t);r=(d=d.idivn(f)).isZero()?m+r:u[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(t,e){return n(typeof o<"u"),this.toArrayLike(o,t,e)},a.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},a.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),a=r||Math.max(1,i);n(i<=a,"byte array longer than desired length"),n(a>0,"Requested array length <= 0"),this.strip();var o,s,l="le"===e,c=new t(a),u=this.clone();if(l){for(s=0;!u.isZero();s++)o=u.andln(255),u.iushrn(8),c[s]=o;for(;s=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},a.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 8191&e||(r+=13,e>>>=13),127&e||(r+=7,e>>>=7),15&e||(r+=4,e>>>=4),3&e||(r+=2,e>>>=2),1&e||r++,r},a.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},a.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},a.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},a.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},a.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},a.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},a.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},a.prototype.notn=function(t){return this.clone().inotn(t)},a.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,n=this);for(var i=0,a=0;a>>26;for(;0!==i&&a>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;at.length?this.clone().iadd(t):t.clone().iadd(this)},a.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var a=0,o=0;o>26,this.words[o]=67108863&e;for(;0!==a&&o>26,this.words[o]=67108863&e;if(0===a&&o>>13,f=0|o[1],d=8191&f,m=f>>>13,g=0|o[2],y=8191&g,v=g>>>13,x=0|o[3],_=8191&x,b=x>>>13,w=0|o[4],T=8191&w,A=w>>>13,k=0|o[5],M=8191&k,S=k>>>13,E=0|o[6],C=8191&E,I=E>>>13,L=0|o[7],P=8191&L,z=L>>>13,D=0|o[8],O=8191&D,R=D>>>13,F=0|o[9],B=8191&F,j=F>>>13,N=0|s[0],U=8191&N,V=N>>>13,q=0|s[1],H=8191&q,G=q>>>13,W=0|s[2],Z=8191&W,Y=W>>>13,X=0|s[3],$=8191&X,K=X>>>13,J=0|s[4],Q=8191&J,tt=J>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,it=0|s[6],at=8191&it,ot=it>>>13,st=0|s[7],lt=8191&st,ct=st>>>13,ut=0|s[8],ht=8191&ut,pt=ut>>>13,ft=0|s[9],dt=8191&ft,mt=ft>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(c+(n=Math.imul(h,U))|0)+((8191&(i=(i=Math.imul(h,V))+Math.imul(p,U)|0))<<13)|0;c=((a=Math.imul(p,V))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(d,U),i=(i=Math.imul(d,V))+Math.imul(m,U)|0,a=Math.imul(m,V);var yt=(c+(n=n+Math.imul(h,H)|0)|0)+((8191&(i=(i=i+Math.imul(h,G)|0)+Math.imul(p,H)|0))<<13)|0;c=((a=a+Math.imul(p,G)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(y,U),i=(i=Math.imul(y,V))+Math.imul(v,U)|0,a=Math.imul(v,V),n=n+Math.imul(d,H)|0,i=(i=i+Math.imul(d,G)|0)+Math.imul(m,H)|0,a=a+Math.imul(m,G)|0;var vt=(c+(n=n+Math.imul(h,Z)|0)|0)+((8191&(i=(i=i+Math.imul(h,Y)|0)+Math.imul(p,Z)|0))<<13)|0;c=((a=a+Math.imul(p,Y)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(_,U),i=(i=Math.imul(_,V))+Math.imul(b,U)|0,a=Math.imul(b,V),n=n+Math.imul(y,H)|0,i=(i=i+Math.imul(y,G)|0)+Math.imul(v,H)|0,a=a+Math.imul(v,G)|0,n=n+Math.imul(d,Z)|0,i=(i=i+Math.imul(d,Y)|0)+Math.imul(m,Z)|0,a=a+Math.imul(m,Y)|0;var xt=(c+(n=n+Math.imul(h,$)|0)|0)+((8191&(i=(i=i+Math.imul(h,K)|0)+Math.imul(p,$)|0))<<13)|0;c=((a=a+Math.imul(p,K)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(T,U),i=(i=Math.imul(T,V))+Math.imul(A,U)|0,a=Math.imul(A,V),n=n+Math.imul(_,H)|0,i=(i=i+Math.imul(_,G)|0)+Math.imul(b,H)|0,a=a+Math.imul(b,G)|0,n=n+Math.imul(y,Z)|0,i=(i=i+Math.imul(y,Y)|0)+Math.imul(v,Z)|0,a=a+Math.imul(v,Y)|0,n=n+Math.imul(d,$)|0,i=(i=i+Math.imul(d,K)|0)+Math.imul(m,$)|0,a=a+Math.imul(m,K)|0;var _t=(c+(n=n+Math.imul(h,Q)|0)|0)+((8191&(i=(i=i+Math.imul(h,tt)|0)+Math.imul(p,Q)|0))<<13)|0;c=((a=a+Math.imul(p,tt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(M,U),i=(i=Math.imul(M,V))+Math.imul(S,U)|0,a=Math.imul(S,V),n=n+Math.imul(T,H)|0,i=(i=i+Math.imul(T,G)|0)+Math.imul(A,H)|0,a=a+Math.imul(A,G)|0,n=n+Math.imul(_,Z)|0,i=(i=i+Math.imul(_,Y)|0)+Math.imul(b,Z)|0,a=a+Math.imul(b,Y)|0,n=n+Math.imul(y,$)|0,i=(i=i+Math.imul(y,K)|0)+Math.imul(v,$)|0,a=a+Math.imul(v,K)|0,n=n+Math.imul(d,Q)|0,i=(i=i+Math.imul(d,tt)|0)+Math.imul(m,Q)|0,a=a+Math.imul(m,tt)|0;var bt=(c+(n=n+Math.imul(h,rt)|0)|0)+((8191&(i=(i=i+Math.imul(h,nt)|0)+Math.imul(p,rt)|0))<<13)|0;c=((a=a+Math.imul(p,nt)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(C,U),i=(i=Math.imul(C,V))+Math.imul(I,U)|0,a=Math.imul(I,V),n=n+Math.imul(M,H)|0,i=(i=i+Math.imul(M,G)|0)+Math.imul(S,H)|0,a=a+Math.imul(S,G)|0,n=n+Math.imul(T,Z)|0,i=(i=i+Math.imul(T,Y)|0)+Math.imul(A,Z)|0,a=a+Math.imul(A,Y)|0,n=n+Math.imul(_,$)|0,i=(i=i+Math.imul(_,K)|0)+Math.imul(b,$)|0,a=a+Math.imul(b,K)|0,n=n+Math.imul(y,Q)|0,i=(i=i+Math.imul(y,tt)|0)+Math.imul(v,Q)|0,a=a+Math.imul(v,tt)|0,n=n+Math.imul(d,rt)|0,i=(i=i+Math.imul(d,nt)|0)+Math.imul(m,rt)|0,a=a+Math.imul(m,nt)|0;var wt=(c+(n=n+Math.imul(h,at)|0)|0)+((8191&(i=(i=i+Math.imul(h,ot)|0)+Math.imul(p,at)|0))<<13)|0;c=((a=a+Math.imul(p,ot)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(P,U),i=(i=Math.imul(P,V))+Math.imul(z,U)|0,a=Math.imul(z,V),n=n+Math.imul(C,H)|0,i=(i=i+Math.imul(C,G)|0)+Math.imul(I,H)|0,a=a+Math.imul(I,G)|0,n=n+Math.imul(M,Z)|0,i=(i=i+Math.imul(M,Y)|0)+Math.imul(S,Z)|0,a=a+Math.imul(S,Y)|0,n=n+Math.imul(T,$)|0,i=(i=i+Math.imul(T,K)|0)+Math.imul(A,$)|0,a=a+Math.imul(A,K)|0,n=n+Math.imul(_,Q)|0,i=(i=i+Math.imul(_,tt)|0)+Math.imul(b,Q)|0,a=a+Math.imul(b,tt)|0,n=n+Math.imul(y,rt)|0,i=(i=i+Math.imul(y,nt)|0)+Math.imul(v,rt)|0,a=a+Math.imul(v,nt)|0,n=n+Math.imul(d,at)|0,i=(i=i+Math.imul(d,ot)|0)+Math.imul(m,at)|0,a=a+Math.imul(m,ot)|0;var Tt=(c+(n=n+Math.imul(h,lt)|0)|0)+((8191&(i=(i=i+Math.imul(h,ct)|0)+Math.imul(p,lt)|0))<<13)|0;c=((a=a+Math.imul(p,ct)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(O,U),i=(i=Math.imul(O,V))+Math.imul(R,U)|0,a=Math.imul(R,V),n=n+Math.imul(P,H)|0,i=(i=i+Math.imul(P,G)|0)+Math.imul(z,H)|0,a=a+Math.imul(z,G)|0,n=n+Math.imul(C,Z)|0,i=(i=i+Math.imul(C,Y)|0)+Math.imul(I,Z)|0,a=a+Math.imul(I,Y)|0,n=n+Math.imul(M,$)|0,i=(i=i+Math.imul(M,K)|0)+Math.imul(S,$)|0,a=a+Math.imul(S,K)|0,n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(A,Q)|0,a=a+Math.imul(A,tt)|0,n=n+Math.imul(_,rt)|0,i=(i=i+Math.imul(_,nt)|0)+Math.imul(b,rt)|0,a=a+Math.imul(b,nt)|0,n=n+Math.imul(y,at)|0,i=(i=i+Math.imul(y,ot)|0)+Math.imul(v,at)|0,a=a+Math.imul(v,ot)|0,n=n+Math.imul(d,lt)|0,i=(i=i+Math.imul(d,ct)|0)+Math.imul(m,lt)|0,a=a+Math.imul(m,ct)|0;var At=(c+(n=n+Math.imul(h,ht)|0)|0)+((8191&(i=(i=i+Math.imul(h,pt)|0)+Math.imul(p,ht)|0))<<13)|0;c=((a=a+Math.imul(p,pt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(B,U),i=(i=Math.imul(B,V))+Math.imul(j,U)|0,a=Math.imul(j,V),n=n+Math.imul(O,H)|0,i=(i=i+Math.imul(O,G)|0)+Math.imul(R,H)|0,a=a+Math.imul(R,G)|0,n=n+Math.imul(P,Z)|0,i=(i=i+Math.imul(P,Y)|0)+Math.imul(z,Z)|0,a=a+Math.imul(z,Y)|0,n=n+Math.imul(C,$)|0,i=(i=i+Math.imul(C,K)|0)+Math.imul(I,$)|0,a=a+Math.imul(I,K)|0,n=n+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(S,Q)|0,a=a+Math.imul(S,tt)|0,n=n+Math.imul(T,rt)|0,i=(i=i+Math.imul(T,nt)|0)+Math.imul(A,rt)|0,a=a+Math.imul(A,nt)|0,n=n+Math.imul(_,at)|0,i=(i=i+Math.imul(_,ot)|0)+Math.imul(b,at)|0,a=a+Math.imul(b,ot)|0,n=n+Math.imul(y,lt)|0,i=(i=i+Math.imul(y,ct)|0)+Math.imul(v,lt)|0,a=a+Math.imul(v,ct)|0,n=n+Math.imul(d,ht)|0,i=(i=i+Math.imul(d,pt)|0)+Math.imul(m,ht)|0,a=a+Math.imul(m,pt)|0;var kt=(c+(n=n+Math.imul(h,dt)|0)|0)+((8191&(i=(i=i+Math.imul(h,mt)|0)+Math.imul(p,dt)|0))<<13)|0;c=((a=a+Math.imul(p,mt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(B,H),i=(i=Math.imul(B,G))+Math.imul(j,H)|0,a=Math.imul(j,G),n=n+Math.imul(O,Z)|0,i=(i=i+Math.imul(O,Y)|0)+Math.imul(R,Z)|0,a=a+Math.imul(R,Y)|0,n=n+Math.imul(P,$)|0,i=(i=i+Math.imul(P,K)|0)+Math.imul(z,$)|0,a=a+Math.imul(z,K)|0,n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,tt)|0)+Math.imul(I,Q)|0,a=a+Math.imul(I,tt)|0,n=n+Math.imul(M,rt)|0,i=(i=i+Math.imul(M,nt)|0)+Math.imul(S,rt)|0,a=a+Math.imul(S,nt)|0,n=n+Math.imul(T,at)|0,i=(i=i+Math.imul(T,ot)|0)+Math.imul(A,at)|0,a=a+Math.imul(A,ot)|0,n=n+Math.imul(_,lt)|0,i=(i=i+Math.imul(_,ct)|0)+Math.imul(b,lt)|0,a=a+Math.imul(b,ct)|0,n=n+Math.imul(y,ht)|0,i=(i=i+Math.imul(y,pt)|0)+Math.imul(v,ht)|0,a=a+Math.imul(v,pt)|0;var Mt=(c+(n=n+Math.imul(d,dt)|0)|0)+((8191&(i=(i=i+Math.imul(d,mt)|0)+Math.imul(m,dt)|0))<<13)|0;c=((a=a+Math.imul(m,mt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(B,Z),i=(i=Math.imul(B,Y))+Math.imul(j,Z)|0,a=Math.imul(j,Y),n=n+Math.imul(O,$)|0,i=(i=i+Math.imul(O,K)|0)+Math.imul(R,$)|0,a=a+Math.imul(R,K)|0,n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,tt)|0)+Math.imul(z,Q)|0,a=a+Math.imul(z,tt)|0,n=n+Math.imul(C,rt)|0,i=(i=i+Math.imul(C,nt)|0)+Math.imul(I,rt)|0,a=a+Math.imul(I,nt)|0,n=n+Math.imul(M,at)|0,i=(i=i+Math.imul(M,ot)|0)+Math.imul(S,at)|0,a=a+Math.imul(S,ot)|0,n=n+Math.imul(T,lt)|0,i=(i=i+Math.imul(T,ct)|0)+Math.imul(A,lt)|0,a=a+Math.imul(A,ct)|0,n=n+Math.imul(_,ht)|0,i=(i=i+Math.imul(_,pt)|0)+Math.imul(b,ht)|0,a=a+Math.imul(b,pt)|0;var St=(c+(n=n+Math.imul(y,dt)|0)|0)+((8191&(i=(i=i+Math.imul(y,mt)|0)+Math.imul(v,dt)|0))<<13)|0;c=((a=a+Math.imul(v,mt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(B,$),i=(i=Math.imul(B,K))+Math.imul(j,$)|0,a=Math.imul(j,K),n=n+Math.imul(O,Q)|0,i=(i=i+Math.imul(O,tt)|0)+Math.imul(R,Q)|0,a=a+Math.imul(R,tt)|0,n=n+Math.imul(P,rt)|0,i=(i=i+Math.imul(P,nt)|0)+Math.imul(z,rt)|0,a=a+Math.imul(z,nt)|0,n=n+Math.imul(C,at)|0,i=(i=i+Math.imul(C,ot)|0)+Math.imul(I,at)|0,a=a+Math.imul(I,ot)|0,n=n+Math.imul(M,lt)|0,i=(i=i+Math.imul(M,ct)|0)+Math.imul(S,lt)|0,a=a+Math.imul(S,ct)|0,n=n+Math.imul(T,ht)|0,i=(i=i+Math.imul(T,pt)|0)+Math.imul(A,ht)|0,a=a+Math.imul(A,pt)|0;var Et=(c+(n=n+Math.imul(_,dt)|0)|0)+((8191&(i=(i=i+Math.imul(_,mt)|0)+Math.imul(b,dt)|0))<<13)|0;c=((a=a+Math.imul(b,mt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(B,Q),i=(i=Math.imul(B,tt))+Math.imul(j,Q)|0,a=Math.imul(j,tt),n=n+Math.imul(O,rt)|0,i=(i=i+Math.imul(O,nt)|0)+Math.imul(R,rt)|0,a=a+Math.imul(R,nt)|0,n=n+Math.imul(P,at)|0,i=(i=i+Math.imul(P,ot)|0)+Math.imul(z,at)|0,a=a+Math.imul(z,ot)|0,n=n+Math.imul(C,lt)|0,i=(i=i+Math.imul(C,ct)|0)+Math.imul(I,lt)|0,a=a+Math.imul(I,ct)|0,n=n+Math.imul(M,ht)|0,i=(i=i+Math.imul(M,pt)|0)+Math.imul(S,ht)|0,a=a+Math.imul(S,pt)|0;var Ct=(c+(n=n+Math.imul(T,dt)|0)|0)+((8191&(i=(i=i+Math.imul(T,mt)|0)+Math.imul(A,dt)|0))<<13)|0;c=((a=a+Math.imul(A,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(B,rt),i=(i=Math.imul(B,nt))+Math.imul(j,rt)|0,a=Math.imul(j,nt),n=n+Math.imul(O,at)|0,i=(i=i+Math.imul(O,ot)|0)+Math.imul(R,at)|0,a=a+Math.imul(R,ot)|0,n=n+Math.imul(P,lt)|0,i=(i=i+Math.imul(P,ct)|0)+Math.imul(z,lt)|0,a=a+Math.imul(z,ct)|0,n=n+Math.imul(C,ht)|0,i=(i=i+Math.imul(C,pt)|0)+Math.imul(I,ht)|0,a=a+Math.imul(I,pt)|0;var It=(c+(n=n+Math.imul(M,dt)|0)|0)+((8191&(i=(i=i+Math.imul(M,mt)|0)+Math.imul(S,dt)|0))<<13)|0;c=((a=a+Math.imul(S,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(B,at),i=(i=Math.imul(B,ot))+Math.imul(j,at)|0,a=Math.imul(j,ot),n=n+Math.imul(O,lt)|0,i=(i=i+Math.imul(O,ct)|0)+Math.imul(R,lt)|0,a=a+Math.imul(R,ct)|0,n=n+Math.imul(P,ht)|0,i=(i=i+Math.imul(P,pt)|0)+Math.imul(z,ht)|0,a=a+Math.imul(z,pt)|0;var Lt=(c+(n=n+Math.imul(C,dt)|0)|0)+((8191&(i=(i=i+Math.imul(C,mt)|0)+Math.imul(I,dt)|0))<<13)|0;c=((a=a+Math.imul(I,mt)|0)+(i>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,n=Math.imul(B,lt),i=(i=Math.imul(B,ct))+Math.imul(j,lt)|0,a=Math.imul(j,ct),n=n+Math.imul(O,ht)|0,i=(i=i+Math.imul(O,pt)|0)+Math.imul(R,ht)|0,a=a+Math.imul(R,pt)|0;var Pt=(c+(n=n+Math.imul(P,dt)|0)|0)+((8191&(i=(i=i+Math.imul(P,mt)|0)+Math.imul(z,dt)|0))<<13)|0;c=((a=a+Math.imul(z,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(B,ht),i=(i=Math.imul(B,pt))+Math.imul(j,ht)|0,a=Math.imul(j,pt);var zt=(c+(n=n+Math.imul(O,dt)|0)|0)+((8191&(i=(i=i+Math.imul(O,mt)|0)+Math.imul(R,dt)|0))<<13)|0;c=((a=a+Math.imul(R,mt)|0)+(i>>>13)|0)+(zt>>>26)|0,zt&=67108863;var Dt=(c+(n=Math.imul(B,dt))|0)+((8191&(i=(i=Math.imul(B,mt))+Math.imul(j,dt)|0))<<13)|0;return c=((a=Math.imul(j,mt))+(i>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,l[0]=gt,l[1]=yt,l[2]=vt,l[3]=xt,l[4]=_t,l[5]=bt,l[6]=wt,l[7]=Tt,l[8]=At,l[9]=kt,l[10]=Mt,l[11]=St,l[12]=Et,l[13]=Ct,l[14]=It,l[15]=Lt,l[16]=Pt,l[17]=zt,l[18]=Dt,0!==c&&(l[19]=c,r.length++),r};function m(t,e,r){return(new g).mulp(t,e,r)}function g(t,e){this.x=t,this.y=e}Math.imul||(d=f),a.prototype.mulTo=function(t,e){var r,n=this.length+t.length;return r=10===this.length&&10===t.length?d(this,t,e):n<63?f(this,t,e):n<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,a=0;a>>26)|0)>>>26,o&=67108863}r.words[a]=s,n=o,o=i}return 0!==n?r.words[a]=n:r.length--,r.strip()}(this,t,e):m(this,t,e),r},g.prototype.makeRBT=function(t){for(var e=new Array(t),r=a.prototype._countBits(t)-1,n=0;n>=1;return n},g.prototype.permute=function(t,e,r,n,i,a){for(var o=0;o>>=1)i++;return 1<>>=13,r[2*o+1]=8191&a,a>>>=13;for(o=2*e;o>=26,e+=i/67108864|0,e+=a>>>26,this.words[r]=67108863&a}return 0!==e&&(this.words[r]=e,this.length++),this},a.prototype.muln=function(t){return this.clone().imuln(t)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>i}return e}(t);if(0===e.length)return new a(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(t-r)/26,a=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(e=0;e>>26-r}o&&(this.words[e]=o,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var a=t%26,o=Math.min((t-a)/26,this.length),s=67108863^67108863>>>a<o)for(this.length-=o,c=0;c=0&&(0!==u||c>=i);c--){var h=0|this.words[c];this.words[c]=u<<26-a|h>>>a,u=h&s}return l&&0!==u&&(l.words[l.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},a.prototype.shln=function(t){return this.clone().ishln(t)},a.prototype.ushln=function(t){return this.clone().iushln(t)},a.prototype.shrn=function(t){return this.clone().ishrn(t)},a.prototype.ushrn=function(t){return this.clone().iushrn(t)},a.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},a.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(l/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},a.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,o=0|i.words[i.length-1];0!=(r=26-this._countBits(o))&&(i=i.ushln(r),n.iushln(r),o=0|i.words[i.length-1]);var s,l=n.length-i.length;if("mod"!==e){(s=new a(null)).length=l+1,s.words=new Array(s.length);for(var c=0;c=0;h--){var p=67108864*(0|n.words[i.length+h])+(0|n.words[i.length+h-1]);for(p=Math.min(p/o|0,67108863),n._ishlnsubmul(i,p,h);0!==n.negative;)p--,n.negative=0,n._ishlnsubmul(i,1,h),n.isZero()||(n.negative^=1);s&&(s.words[h]=p)}return s&&s.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},a.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(i=s.div.neg()),"div"!==e&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(t)),{div:i,mod:o}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(i=s.div.neg()),{div:i,mod:s.mod}):this.negative&t.negative?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(t)),{div:s.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new a(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new a(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new a(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,o,s},a.prototype.div=function(t){return this.divmod(t,"div",!1).div},a.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},a.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},a.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),a=r.cmp(n);return a<0||1===i&&0===a?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},a.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},a.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},a.prototype.divn=function(t){return this.clone().idivn(t)},a.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new a(1),o=new a(0),s=new a(0),l=new a(1),c=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++c;for(var u=r.clone(),h=e.clone();!e.isZero();){for(var p=0,f=1;!(e.words[0]&f)&&p<26;++p,f<<=1);if(p>0)for(e.iushrn(p);p-- >0;)(i.isOdd()||o.isOdd())&&(i.iadd(u),o.isub(h)),i.iushrn(1),o.iushrn(1);for(var d=0,m=1;!(r.words[0]&m)&&d<26;++d,m<<=1);if(d>0)for(r.iushrn(d);d-- >0;)(s.isOdd()||l.isOdd())&&(s.iadd(u),l.isub(h)),s.iushrn(1),l.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(s),o.isub(l)):(r.isub(e),s.isub(i),l.isub(o))}return{a:s,b:l,gcd:r.iushln(c)}},a.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e,r=this,i=t.clone();r=0!==r.negative?r.umod(t):r.clone();for(var o=new a(1),s=new a(0),l=i.clone();r.cmpn(1)>0&&i.cmpn(1)>0;){for(var c=0,u=1;!(r.words[0]&u)&&c<26;++c,u<<=1);if(c>0)for(r.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(l),o.iushrn(1);for(var h=0,p=1;!(i.words[0]&p)&&h<26;++h,p<<=1);if(h>0)for(i.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(l),s.iushrn(1);r.cmp(i)>=0?(r.isub(i),o.isub(s)):(i.isub(r),s.isub(o))}return(e=0===r.cmpn(1)?o:s).cmpn(0)<0&&e.iadd(t),e},a.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var a=e;e=r,r=a}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},a.prototype.invm=function(t){return this.egcd(t).a.umod(t)},a.prototype.isEven=function(){return!(1&this.words[0])},a.prototype.isOdd=function(){return!(1&~this.words[0])},a.prototype.andln=function(t){return this.words[0]&t},a.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,s&=67108863,this.words[o]=s}return 0!==a&&(this.words[o]=a,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},a.prototype.gtn=function(t){return 1===this.cmpn(t)},a.prototype.gt=function(t){return 1===this.cmp(t)},a.prototype.gten=function(t){return this.cmpn(t)>=0},a.prototype.gte=function(t){return this.cmp(t)>=0},a.prototype.ltn=function(t){return-1===this.cmpn(t)},a.prototype.lt=function(t){return-1===this.cmp(t)},a.prototype.lten=function(t){return this.cmpn(t)<=0},a.prototype.lte=function(t){return this.cmp(t)<=0},a.prototype.eqn=function(t){return 0===this.cmpn(t)},a.prototype.eq=function(t){return 0===this.cmp(t)},a.red=function(t){return new T(t)},a.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},a.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(t){return this.red=t,this},a.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},a.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},a.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},a.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},a.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},a.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},a.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},a.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},a.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var y={k256:null,p224:null,p192:null,p25519:null};function v(t,e){this.name=t,this.p=new a(e,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function x(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function b(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function T(t){if("string"==typeof t){var e=a._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function A(t){T.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var t=new a(null);return t.words=new Array(Math.ceil(this.n/13)),t},v.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},v.prototype.split=function(t,e){t.iushrn(this.n,0,e)},v.prototype.imulK=function(t){return t.imul(this.k)},i(x,v),x.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i>>22,a=o}a>>>=22,t.words[i-10]=a,0===a&&t.length>10?t.length-=10:t.length-=9},x.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},a._prime=function(t){if(y[t])return y[t];var e;if("k256"===t)e=new x;else if("p224"===t)e=new _;else if("p192"===t)e=new b;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new w}return y[t]=e,e},T.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},T.prototype._verify2=function(t,e){n(!(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},T.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},T.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},T.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},T.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},T.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},T.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},T.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},T.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},T.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},T.prototype.isqr=function(t){return this.imul(t,t.clone())},T.prototype.sqr=function(t){return this.mul(t,t)},T.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new a(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),o=0;!i.isZero()&&0===i.andln(1);)o++,i.iushrn(1);n(!i.isZero());var s=new a(1).toRed(this),l=s.redNeg(),c=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new a(2*u*u).toRed(this);0!==this.pow(u,c).cmp(l);)u.redIAdd(l);for(var h=this.pow(u,i),p=this.pow(t,i.addn(1).iushrn(1)),f=this.pow(t,i),d=o;0!==f.cmp(s);){for(var m=f,g=0;0!==m.cmp(s);g++)m=m.redSqr();n(g=0;n--){for(var c=e.words[n],u=l-1;u>=0;u--){var h=c>>u&1;i!==r[0]&&(i=this.sqr(i)),0!==h||0!==o?(o<<=1,o|=h,(4==++s||0===n&&0===u)&&(i=this.mul(i,r[o]),s=0,o=0)):s=0}l=26}return i},T.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},T.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},a.mont=function(t){return new A(t)},i(A,T),A.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},A.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},A.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},A.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new a(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},A.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},6204:function(t){t.exports=function(t){var e,r,n,i=t.length,a=0;for(e=0;e>>1;if(!(u<=0)){var h,p=i.mallocDouble(2*u*s),f=i.mallocInt32(s);if((s=l(t,u,p,f))>0){if(1===u&&n)a.init(s),h=a.sweepComplete(u,r,0,s,p,f,0,s,p,f);else{var d=i.mallocDouble(2*u*c),m=i.mallocInt32(c);(c=l(e,u,d,m))>0&&(a.init(s+c),h=1===u?a.sweepBipartite(u,r,0,s,p,f,0,c,d,m):o(u,r,n,s,p,f,c,d,m),i.free(d),i.free(m))}i.free(p),i.free(f)}return h}}}function u(t,e){n.push([t,e])}},2455:function(t,e){function r(t){return t?function(t,e,r,n,i,a,o,s,l,c,u){return i-n>l-s?function(t,e,r,n,i,a,o,s,l,c,u){for(var h=2*t,p=n,f=h*n;pc-l?n?function(t,e,r,n,i,a,o,s,l,c,u){for(var h=2*t,p=n,f=h*n;p0;){var D=(P-=1)*_,O=w[D],R=w[D+1],F=w[D+2],B=w[D+3],j=w[D+4],N=w[D+5],U=P*b,V=T[U],q=T[U+1],H=1&N,G=!!(16&N),W=u,Z=S,Y=C,X=I;if(H&&(W=C,Z=I,Y=u,X=S),!(2&N&&(F=g(t,O,R,F,W,Z,q),R>=F)||4&N&&(R=y(t,O,R,F,W,Z,V),R>=F))){var $=F-R,K=j-B;if(G){if(t*$*($+K)=p0)&&!(p1>=hi)"),m=u("lo===p0"),g=u("lo>>1,p=2*t,f=h,d=s[p*h+e];c=x?(f=v,d=x):y>=b?(f=g,d=y):(f=_,d=b):x>=b?(f=v,d=x):b>=y?(f=g,d=y):(f=_,d=b);for(var w=p*(u-1),T=p*f,A=0;Ar&&i[h+e]>c;--u,h-=o){for(var p=h,f=h+o,d=0;dp;++p,l+=s)if(i[l+h]===o)if(u===p)u+=1,c+=s;else{for(var f=0;s>f;++f){var d=i[l+f];i[l+f]=i[c],i[c++]=d}var m=a[p];a[p]=a[u],a[u++]=m}return u},"lop;++p,l+=s)if(i[l+h]f;++f){var d=i[l+f];i[l+f]=i[c],i[c++]=d}var m=a[p];a[p]=a[u],a[u++]=m}return u},"lo<=p0":function(t,e,r,n,i,a,o){for(var s=2*t,l=s*r,c=l,u=r,h=t+e,p=r;n>p;++p,l+=s)if(i[l+h]<=o)if(u===p)u+=1,c+=s;else{for(var f=0;s>f;++f){var d=i[l+f];i[l+f]=i[c],i[c++]=d}var m=a[p];a[p]=a[u],a[u++]=m}return u},"hi<=p0":function(t,e,r,n,i,a,o){for(var s=2*t,l=s*r,c=l,u=r,h=t+e,p=r;n>p;++p,l+=s)if(i[l+h]<=o)if(u===p)u+=1,c+=s;else{for(var f=0;s>f;++f){var d=i[l+f];i[l+f]=i[c],i[c++]=d}var m=a[p];a[p]=a[u],a[u++]=m}return u},"lof;++f,l+=s){var d=i[l+h],m=i[l+p];if(dg;++g){var y=i[l+g];i[l+g]=i[c],i[c++]=y}var v=a[f];a[f]=a[u],a[u++]=v}}return u},"lo<=p0&&p0<=hi":function(t,e,r,n,i,a,o){for(var s=2*t,l=s*r,c=l,u=r,h=e,p=t+e,f=r;n>f;++f,l+=s){var d=i[l+h],m=i[l+p];if(d<=o&&o<=m)if(u===f)u+=1,c+=s;else{for(var g=0;s>g;++g){var y=i[l+g];i[l+g]=i[c],i[c++]=y}var v=a[f];a[f]=a[u],a[u++]=v}}return u},"!(lo>=p0)&&!(p1>=hi)":function(t,e,r,n,i,a,o,s){for(var l=2*t,c=l*r,u=c,h=r,p=e,f=t+e,d=r;n>d;++d,c+=l){var m=i[c+p],g=i[c+f];if(!(m>=o||s>=g))if(h===d)h+=1,u+=l;else{for(var y=0;l>y;++y){var v=i[c+y];i[c+y]=i[u],i[u++]=v}var x=a[d];a[d]=a[h],a[h++]=x}}return h}}},4192:function(t){t.exports=function(t,n){n<=4*e?r(0,n-1,t):c(0,n-1,t)};var e=32;function r(t,e,r){for(var n=2*(t+1),i=t+1;i<=e;++i){for(var a=r[n++],o=r[n++],s=i,l=n-2;s-- >t;){var c=r[l-2],u=r[l-1];if(cr[e+1])}function l(t,e,r,n){var i=n[t*=2];return i>1,g=m-p,y=m+p,v=f,x=g,_=m,b=y,w=d,T=t+1,A=u-1,k=0;s(v,x,h)&&(k=v,v=x,x=k),s(b,w,h)&&(k=b,b=w,w=k),s(v,_,h)&&(k=v,v=_,_=k),s(x,_,h)&&(k=x,x=_,_=k),s(v,b,h)&&(k=v,v=b,b=k),s(_,b,h)&&(k=_,_=b,b=k),s(x,w,h)&&(k=x,x=w,w=k),s(x,_,h)&&(k=x,x=_,_=k),s(b,w,h)&&(k=b,b=w,w=k);for(var M=h[2*x],S=h[2*x+1],E=h[2*b],C=h[2*b+1],I=2*v,L=2*_,P=2*w,z=2*f,D=2*m,O=2*d,R=0;R<2;++R){var F=h[I+R],B=h[L+R],j=h[P+R];h[z+R]=F,h[D+R]=B,h[O+R]=j}i(g,t,h),i(y,u,h);for(var N=T;N<=A;++N)if(l(N,M,S,h))N!==T&&n(N,T,h),++T;else if(!l(N,E,C,h))for(;;){if(l(A,E,C,h)){l(A,M,S,h)?(a(N,T,A,h),++T,--A):(n(N,A,h),--A);break}if(--A>>1;a(d,S);var E=0,C=0;for(T=0;T=o)m(u,h,C--,I=I-o|0);else if(I>=0)m(l,c,E--,I);else if(I<=-o){I=-I-o|0;for(var L=0;L>>1;a(d,E);var C=0,I=0,L=0;for(A=0;A>1==d[2*A+3]>>1&&(z=2,A+=1),P<0){for(var D=-(P>>1)-1,O=0;O>1)-1,0===z?m(l,c,C--,D):1===z?m(u,h,I--,D):2===z&&m(p,f,L--,D)}},scanBipartite:function(t,e,r,n,i,s,u,h,p,f,y,v){var x=0,_=2*t,b=e,w=e+t,T=1,A=1;n?A=o:T=o;for(var k=i;k>>1;a(d,C);var I=0;for(k=0;k=o?(P=!n,M-=o):(P=!!n,M-=1),P)g(l,c,I++,M);else{var z=v[M],D=_*M,O=y[D+e+1],R=y[D+e+1+t];t:for(var F=0;F>>1;a(d,T);var A=0;for(x=0;x=o)l[A++]=_-o;else{var M=f[_-=1],S=g*_,E=p[S+e+1],C=p[S+e+1+t];t:for(var I=0;I=0;--I)if(l[I]===_){for(D=I+1;D0;){for(var f=r.pop(),d=(u=-1,h=-1,l=o[s=r.pop()],1);d=0||(e.flip(s,f),i(t,e,r,u,s,h),i(t,e,r,s,h,u),i(t,e,r,h,f,u),i(t,e,r,f,u,h))}}},5023:function(t,e,r){var n,i=r(2478);function a(t,e,r,n,i,a,o){this.cells=t,this.neighbor=e,this.flags=n,this.constraint=r,this.active=i,this.next=a,this.boundary=o}function o(t,e){return t[0]-e[0]||t[1]-e[1]||t[2]-e[2]}t.exports=function(t,e,r){var n=function(t,e){for(var r=t.cells(),n=r.length,i=0;i0||l.length>0;){for(;s.length>0;){var f=s.pop();if(c[f]!==-i){c[f]=i,u[f];for(var d=0;d<3;++d){var m=p[3*f+d];m>=0&&0===c[m]&&(h[3*f+d]?l.push(m):(s.push(m),c[m]=i))}}}var g=l;l=s,s=g,l.length=0,i=-i}var y=function(t,e,r){for(var n=0,i=0;i1&&i(r[p[f-2]],r[p[f-1]],a)>0;)t.push([p[f-1],p[f-2],o]),f-=1;p.length=f,p.push(o);var d=h.upperIds;for(f=d.length;f>1&&i(r[d[f-2]],r[d[f-1]],a)<0;)t.push([d[f-2],d[f-1],o]),f-=1;d.length=f,d.push(o)}}function u(t,e){return(t.a[0]d[0]&&i.push(new o(d,f,2,l),new o(f,d,1,l))}i.sort(s);for(var m=i[0].a[0]-(1+Math.abs(i[0].a[0]))*Math.pow(2,-52),g=[new a([m,1],[m,0],-1,[],[],[],[])],y=[],v=(l=0,i.length);l=0}}(),a.removeTriangle=function(t,e,r){var n=this.stars;o(n[t],e,r),o(n[e],r,t),o(n[r],t,e)},a.addTriangle=function(t,e,r){var n=this.stars;n[t].push(e,r),n[e].push(r,t),n[r].push(t,e)},a.opposite=function(t,e){for(var r=this.stars[e],n=1,i=r.length;ne[2]?1:0)}function y(t,e,r){if(0!==t.length){if(e)for(var n=0;n=0;--a){var x=e[u=(S=n[a])[0]],_=x[0],b=x[1],w=t[_],T=t[b];if((w[0]-T[0]||w[1]-T[1])<0){var A=_;_=b,b=A}x[0]=_;var k,M=x[1]=S[1];for(i&&(k=x[2]);a>0&&n[a-1][0]===u;){var S,E=(S=n[--a])[1];i?e.push([M,E,k]):e.push([M,E]),M=E}i?e.push([M,b,k]):e.push([M,b])}return p}(t,e,p,m,r),v=d(t,g);return y(e,v,r),!!v||p.length>0||m.length>0}},3637:function(t,e,r){t.exports=function(t,e,r,n){var a=s(e,t),h=s(n,r),p=u(a,h);if(0===o(p))return null;var f=u(h,s(t,r)),d=i(f,p),m=c(a,d);return l(t,m)};var n=r(6504),i=r(8697),a=r(5572),o=r(7721),s=r(544),l=r(2653),c=r(8987);function u(t,e){return a(n(t[0],e[1]),n(t[1],e[0]))}},3642:function(t){t.exports={jet:[{index:0,rgb:[0,0,131]},{index:.125,rgb:[0,60,170]},{index:.375,rgb:[5,255,255]},{index:.625,rgb:[255,255,0]},{index:.875,rgb:[250,0,0]},{index:1,rgb:[128,0,0]}],hsv:[{index:0,rgb:[255,0,0]},{index:.169,rgb:[253,255,2]},{index:.173,rgb:[247,255,2]},{index:.337,rgb:[0,252,4]},{index:.341,rgb:[0,252,10]},{index:.506,rgb:[1,249,255]},{index:.671,rgb:[2,0,253]},{index:.675,rgb:[8,0,253]},{index:.839,rgb:[255,0,251]},{index:.843,rgb:[255,0,245]},{index:1,rgb:[255,0,6]}],hot:[{index:0,rgb:[0,0,0]},{index:.3,rgb:[230,0,0]},{index:.6,rgb:[255,210,0]},{index:1,rgb:[255,255,255]}],spring:[{index:0,rgb:[255,0,255]},{index:1,rgb:[255,255,0]}],summer:[{index:0,rgb:[0,128,102]},{index:1,rgb:[255,255,102]}],autumn:[{index:0,rgb:[255,0,0]},{index:1,rgb:[255,255,0]}],winter:[{index:0,rgb:[0,0,255]},{index:1,rgb:[0,255,128]}],bone:[{index:0,rgb:[0,0,0]},{index:.376,rgb:[84,84,116]},{index:.753,rgb:[169,200,200]},{index:1,rgb:[255,255,255]}],copper:[{index:0,rgb:[0,0,0]},{index:.804,rgb:[255,160,102]},{index:1,rgb:[255,199,127]}],greys:[{index:0,rgb:[0,0,0]},{index:1,rgb:[255,255,255]}],yignbu:[{index:0,rgb:[8,29,88]},{index:.125,rgb:[37,52,148]},{index:.25,rgb:[34,94,168]},{index:.375,rgb:[29,145,192]},{index:.5,rgb:[65,182,196]},{index:.625,rgb:[127,205,187]},{index:.75,rgb:[199,233,180]},{index:.875,rgb:[237,248,217]},{index:1,rgb:[255,255,217]}],greens:[{index:0,rgb:[0,68,27]},{index:.125,rgb:[0,109,44]},{index:.25,rgb:[35,139,69]},{index:.375,rgb:[65,171,93]},{index:.5,rgb:[116,196,118]},{index:.625,rgb:[161,217,155]},{index:.75,rgb:[199,233,192]},{index:.875,rgb:[229,245,224]},{index:1,rgb:[247,252,245]}],yiorrd:[{index:0,rgb:[128,0,38]},{index:.125,rgb:[189,0,38]},{index:.25,rgb:[227,26,28]},{index:.375,rgb:[252,78,42]},{index:.5,rgb:[253,141,60]},{index:.625,rgb:[254,178,76]},{index:.75,rgb:[254,217,118]},{index:.875,rgb:[255,237,160]},{index:1,rgb:[255,255,204]}],bluered:[{index:0,rgb:[0,0,255]},{index:1,rgb:[255,0,0]}],rdbu:[{index:0,rgb:[5,10,172]},{index:.35,rgb:[106,137,247]},{index:.5,rgb:[190,190,190]},{index:.6,rgb:[220,170,132]},{index:.7,rgb:[230,145,90]},{index:1,rgb:[178,10,28]}],picnic:[{index:0,rgb:[0,0,255]},{index:.1,rgb:[51,153,255]},{index:.2,rgb:[102,204,255]},{index:.3,rgb:[153,204,255]},{index:.4,rgb:[204,204,255]},{index:.5,rgb:[255,255,255]},{index:.6,rgb:[255,204,255]},{index:.7,rgb:[255,153,255]},{index:.8,rgb:[255,102,204]},{index:.9,rgb:[255,102,102]},{index:1,rgb:[255,0,0]}],rainbow:[{index:0,rgb:[150,0,90]},{index:.125,rgb:[0,0,200]},{index:.25,rgb:[0,25,255]},{index:.375,rgb:[0,152,255]},{index:.5,rgb:[44,255,150]},{index:.625,rgb:[151,255,0]},{index:.75,rgb:[255,234,0]},{index:.875,rgb:[255,111,0]},{index:1,rgb:[255,0,0]}],portland:[{index:0,rgb:[12,51,131]},{index:.25,rgb:[10,136,186]},{index:.5,rgb:[242,211,56]},{index:.75,rgb:[242,143,56]},{index:1,rgb:[217,30,30]}],blackbody:[{index:0,rgb:[0,0,0]},{index:.2,rgb:[230,0,0]},{index:.4,rgb:[230,210,0]},{index:.7,rgb:[255,255,255]},{index:1,rgb:[160,200,255]}],earth:[{index:0,rgb:[0,0,130]},{index:.1,rgb:[0,180,180]},{index:.2,rgb:[40,210,40]},{index:.4,rgb:[230,230,50]},{index:.6,rgb:[120,70,20]},{index:1,rgb:[255,255,255]}],electric:[{index:0,rgb:[0,0,0]},{index:.15,rgb:[30,0,100]},{index:.4,rgb:[120,0,100]},{index:.6,rgb:[160,90,0]},{index:.8,rgb:[230,200,0]},{index:1,rgb:[255,250,220]}],alpha:[{index:0,rgb:[255,255,255,0]},{index:1,rgb:[255,255,255,1]}],viridis:[{index:0,rgb:[68,1,84]},{index:.13,rgb:[71,44,122]},{index:.25,rgb:[59,81,139]},{index:.38,rgb:[44,113,142]},{index:.5,rgb:[33,144,141]},{index:.63,rgb:[39,173,129]},{index:.75,rgb:[92,200,99]},{index:.88,rgb:[170,220,50]},{index:1,rgb:[253,231,37]}],inferno:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[31,12,72]},{index:.25,rgb:[85,15,109]},{index:.38,rgb:[136,34,106]},{index:.5,rgb:[186,54,85]},{index:.63,rgb:[227,89,51]},{index:.75,rgb:[249,140,10]},{index:.88,rgb:[249,201,50]},{index:1,rgb:[252,255,164]}],magma:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[28,16,68]},{index:.25,rgb:[79,18,123]},{index:.38,rgb:[129,37,129]},{index:.5,rgb:[181,54,122]},{index:.63,rgb:[229,80,100]},{index:.75,rgb:[251,135,97]},{index:.88,rgb:[254,194,135]},{index:1,rgb:[252,253,191]}],plasma:[{index:0,rgb:[13,8,135]},{index:.13,rgb:[75,3,161]},{index:.25,rgb:[125,3,168]},{index:.38,rgb:[168,34,150]},{index:.5,rgb:[203,70,121]},{index:.63,rgb:[229,107,93]},{index:.75,rgb:[248,148,65]},{index:.88,rgb:[253,195,40]},{index:1,rgb:[240,249,33]}],warm:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[172,0,187]},{index:.25,rgb:[219,0,170]},{index:.38,rgb:[255,0,130]},{index:.5,rgb:[255,63,74]},{index:.63,rgb:[255,123,0]},{index:.75,rgb:[234,176,0]},{index:.88,rgb:[190,228,0]},{index:1,rgb:[147,255,0]}],cool:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[116,0,218]},{index:.25,rgb:[98,74,237]},{index:.38,rgb:[68,146,231]},{index:.5,rgb:[0,204,197]},{index:.63,rgb:[0,247,146]},{index:.75,rgb:[0,255,88]},{index:.88,rgb:[40,255,8]},{index:1,rgb:[147,255,0]}],"rainbow-soft":[{index:0,rgb:[125,0,179]},{index:.1,rgb:[199,0,180]},{index:.2,rgb:[255,0,121]},{index:.3,rgb:[255,108,0]},{index:.4,rgb:[222,194,0]},{index:.5,rgb:[150,255,0]},{index:.6,rgb:[0,255,55]},{index:.7,rgb:[0,246,150]},{index:.8,rgb:[50,167,222]},{index:.9,rgb:[103,51,235]},{index:1,rgb:[124,0,186]}],bathymetry:[{index:0,rgb:[40,26,44]},{index:.13,rgb:[59,49,90]},{index:.25,rgb:[64,76,139]},{index:.38,rgb:[63,110,151]},{index:.5,rgb:[72,142,158]},{index:.63,rgb:[85,174,163]},{index:.75,rgb:[120,206,163]},{index:.88,rgb:[187,230,172]},{index:1,rgb:[253,254,204]}],cdom:[{index:0,rgb:[47,15,62]},{index:.13,rgb:[87,23,86]},{index:.25,rgb:[130,28,99]},{index:.38,rgb:[171,41,96]},{index:.5,rgb:[206,67,86]},{index:.63,rgb:[230,106,84]},{index:.75,rgb:[242,149,103]},{index:.88,rgb:[249,193,135]},{index:1,rgb:[254,237,176]}],chlorophyll:[{index:0,rgb:[18,36,20]},{index:.13,rgb:[25,63,41]},{index:.25,rgb:[24,91,59]},{index:.38,rgb:[13,119,72]},{index:.5,rgb:[18,148,80]},{index:.63,rgb:[80,173,89]},{index:.75,rgb:[132,196,122]},{index:.88,rgb:[175,221,162]},{index:1,rgb:[215,249,208]}],density:[{index:0,rgb:[54,14,36]},{index:.13,rgb:[89,23,80]},{index:.25,rgb:[110,45,132]},{index:.38,rgb:[120,77,178]},{index:.5,rgb:[120,113,213]},{index:.63,rgb:[115,151,228]},{index:.75,rgb:[134,185,227]},{index:.88,rgb:[177,214,227]},{index:1,rgb:[230,241,241]}],"freesurface-blue":[{index:0,rgb:[30,4,110]},{index:.13,rgb:[47,14,176]},{index:.25,rgb:[41,45,236]},{index:.38,rgb:[25,99,212]},{index:.5,rgb:[68,131,200]},{index:.63,rgb:[114,156,197]},{index:.75,rgb:[157,181,203]},{index:.88,rgb:[200,208,216]},{index:1,rgb:[241,237,236]}],"freesurface-red":[{index:0,rgb:[60,9,18]},{index:.13,rgb:[100,17,27]},{index:.25,rgb:[142,20,29]},{index:.38,rgb:[177,43,27]},{index:.5,rgb:[192,87,63]},{index:.63,rgb:[205,125,105]},{index:.75,rgb:[216,162,148]},{index:.88,rgb:[227,199,193]},{index:1,rgb:[241,237,236]}],oxygen:[{index:0,rgb:[64,5,5]},{index:.13,rgb:[106,6,15]},{index:.25,rgb:[144,26,7]},{index:.38,rgb:[168,64,3]},{index:.5,rgb:[188,100,4]},{index:.63,rgb:[206,136,11]},{index:.75,rgb:[220,174,25]},{index:.88,rgb:[231,215,44]},{index:1,rgb:[248,254,105]}],par:[{index:0,rgb:[51,20,24]},{index:.13,rgb:[90,32,35]},{index:.25,rgb:[129,44,34]},{index:.38,rgb:[159,68,25]},{index:.5,rgb:[182,99,19]},{index:.63,rgb:[199,134,22]},{index:.75,rgb:[212,171,35]},{index:.88,rgb:[221,210,54]},{index:1,rgb:[225,253,75]}],phase:[{index:0,rgb:[145,105,18]},{index:.13,rgb:[184,71,38]},{index:.25,rgb:[186,58,115]},{index:.38,rgb:[160,71,185]},{index:.5,rgb:[110,97,218]},{index:.63,rgb:[50,123,164]},{index:.75,rgb:[31,131,110]},{index:.88,rgb:[77,129,34]},{index:1,rgb:[145,105,18]}],salinity:[{index:0,rgb:[42,24,108]},{index:.13,rgb:[33,50,162]},{index:.25,rgb:[15,90,145]},{index:.38,rgb:[40,118,137]},{index:.5,rgb:[59,146,135]},{index:.63,rgb:[79,175,126]},{index:.75,rgb:[120,203,104]},{index:.88,rgb:[193,221,100]},{index:1,rgb:[253,239,154]}],temperature:[{index:0,rgb:[4,35,51]},{index:.13,rgb:[23,51,122]},{index:.25,rgb:[85,59,157]},{index:.38,rgb:[129,79,143]},{index:.5,rgb:[175,95,130]},{index:.63,rgb:[222,112,101]},{index:.75,rgb:[249,146,66]},{index:.88,rgb:[249,196,65]},{index:1,rgb:[232,250,91]}],turbidity:[{index:0,rgb:[34,31,27]},{index:.13,rgb:[65,50,41]},{index:.25,rgb:[98,69,52]},{index:.38,rgb:[131,89,57]},{index:.5,rgb:[161,112,59]},{index:.63,rgb:[185,140,66]},{index:.75,rgb:[202,174,88]},{index:.88,rgb:[216,209,126]},{index:1,rgb:[233,246,171]}],"velocity-blue":[{index:0,rgb:[17,32,64]},{index:.13,rgb:[35,52,116]},{index:.25,rgb:[29,81,156]},{index:.38,rgb:[31,113,162]},{index:.5,rgb:[50,144,169]},{index:.63,rgb:[87,173,176]},{index:.75,rgb:[149,196,189]},{index:.88,rgb:[203,221,211]},{index:1,rgb:[254,251,230]}],"velocity-green":[{index:0,rgb:[23,35,19]},{index:.13,rgb:[24,64,38]},{index:.25,rgb:[11,95,45]},{index:.38,rgb:[39,123,35]},{index:.5,rgb:[95,146,12]},{index:.63,rgb:[152,165,18]},{index:.75,rgb:[201,186,69]},{index:.88,rgb:[233,216,137]},{index:1,rgb:[255,253,205]}],cubehelix:[{index:0,rgb:[0,0,0]},{index:.07,rgb:[22,5,59]},{index:.13,rgb:[60,4,105]},{index:.2,rgb:[109,1,135]},{index:.27,rgb:[161,0,147]},{index:.33,rgb:[210,2,142]},{index:.4,rgb:[251,11,123]},{index:.47,rgb:[255,29,97]},{index:.53,rgb:[255,54,69]},{index:.6,rgb:[255,85,46]},{index:.67,rgb:[255,120,34]},{index:.73,rgb:[255,157,37]},{index:.8,rgb:[241,191,57]},{index:.87,rgb:[224,220,93]},{index:.93,rgb:[218,241,142]},{index:1,rgb:[227,253,198]}]}},6729:function(t,e,r){var n=r(3642),i=r(395);function a(t){return[t[0]/255,t[1]/255,t[2]/255,t[3]]}function o(t){for(var e,r="#",n=0;n<3;++n)r+=("00"+(e=(e=t[n]).toString(16))).substr(e.length);return r}function s(t){return"rgba("+t.join(",")+")"}t.exports=function(t){var e,r,l,c,u,h,p,f,d,m;if(t||(t={}),f=(t.nshades||72)-1,p=t.format||"hex",(h=t.colormap)||(h="jet"),"string"==typeof h){if(h=h.toLowerCase(),!n[h])throw Error(h+" not a supported colorscale");u=n[h]}else{if(!Array.isArray(h))throw Error("unsupported colormap option",h);u=h.slice()}if(u.length>f+1)throw new Error(h+" map requires nshades to be at least size "+u.length);d=Array.isArray(t.alpha)?2!==t.alpha.length?[1,1]:t.alpha.slice():"number"==typeof t.alpha?[t.alpha,t.alpha]:[1,1],e=u.map((function(t){return Math.round(t.index*f)})),d[0]=Math.min(Math.max(d[0],0),1),d[1]=Math.min(Math.max(d[1],0),1);var g=u.map((function(t,e){var r=u[e].index,n=u[e].rgb.slice();return 4===n.length&&n[3]>=0&&n[3]<=1||(n[3]=d[0]+(d[1]-d[0])*r),n})),y=[];for(m=0;m0||l(t,e,a)?-1:1:0===s?c>0||l(t,e,r)?1:-1:i(c-s)}var h=n(t,e,r);return h>0?o>0&&n(t,e,a)>0?1:-1:h<0?o>0||n(t,e,a)>0?1:-1:n(t,e,a)>0||l(t,e,r)?1:-1};var n=r(3250),i=r(8572),a=r(9362),o=r(5382),s=r(8210);function l(t,e,r){var n=a(t[0],-e[0]),i=a(t[1],-e[1]),l=a(r[0],-e[0]),c=a(r[1],-e[1]),u=s(o(n,l),o(i,c));return u[u.length-1]>=0}},8572:function(t){t.exports=function(t){return t<0?-1:t>0?1:0}},8507:function(t){t.exports=function(t,n){var i=t.length,a=t.length-n.length;if(a)return a;switch(i){case 0:return 0;case 1:return t[0]-n[0];case 2:return t[0]+t[1]-n[0]-n[1]||e(t[0],t[1])-e(n[0],n[1]);case 3:var o=t[0]+t[1],s=n[0]+n[1];if(a=o+t[2]-(s+n[2]))return a;var l=e(t[0],t[1]),c=e(n[0],n[1]);return e(l,t[2])-e(c,n[2])||e(l+t[2],o)-e(c+n[2],s);case 4:var u=t[0],h=t[1],p=t[2],f=t[3],d=n[0],m=n[1],g=n[2],y=n[3];return u+h+p+f-(d+m+g+y)||e(u,h,p,f)-e(d,m,g,y,d)||e(u+h,u+p,u+f,h+p,h+f,p+f)-e(d+m,d+g,d+y,m+g,m+y,g+y)||e(u+h+p,u+h+f,u+p+f,h+p+f)-e(d+m+g,d+m+y,d+g+y,m+g+y);default:for(var v=t.slice().sort(r),x=n.slice().sort(r),_=0;_t[r][0]&&(r=n);return er?[[r],[e]]:[[e]]}},4750:function(t,e,r){t.exports=function(t){var e=n(t),r=e.length;if(r<=2)return[];for(var i=new Array(r),a=e[r-1],o=0;o=e[l]&&(s+=1);a[o]=s}}return t}(n(a,!0),r)}};var n=r(8954),i=r(3952)},4769:function(t){t.exports=function(t,e,r,n,i,a){var o=i-1,s=i*i,l=o*o,c=(1+2*i)*l,u=i*l,h=s*(3-2*i),p=s*o;if(t.length){a||(a=new Array(t.length));for(var f=t.length-1;f>=0;--f)a[f]=c*t[f]+u*e[f]+h*r[f]+p*n[f];return a}return c*t+u*e+h*r+p*n},t.exports.derivative=function(t,e,r,n,i,a){var o=6*i*i-6*i,s=3*i*i-4*i+1,l=-6*i*i+6*i,c=3*i*i-2*i;if(t.length){a||(a=new Array(t.length));for(var u=t.length-1;u>=0;--u)a[u]=o*t[u]+s*e[u]+l*r[u]+c*n[u];return a}return o*t+s*e+l*r[u]+c*n}},7642:function(t,e,r){var n=r(8954),i=r(1682);function a(t,e){this.point=t,this.index=e}function o(t,e){for(var r=t.point,n=e.point,i=r.length,a=0;a=2)return!1;t[r]=n}return!0})):b.filter((function(t){for(var e=0;e<=s;++e){var r=y[t[e]];if(r<0)return!1;t[e]=r}return!0})),1&s)for(u=0;u>>31},t.exports.exponent=function(e){return(t.exports.hi(e)<<1>>>21)-1023},t.exports.fraction=function(e){var r=t.exports.lo(e),n=t.exports.hi(e),i=1048575&n;return 2146435072&n&&(i+=1048576),[r,i]},t.exports.denormalized=function(e){return!(2146435072&t.exports.hi(e))}},1338:function(t){function e(t,r,n){var i=0|t[n];if(i<=0)return[];var a,o=new Array(i);if(n===t.length-1)for(a=0;a"u"&&(r=0),typeof t){case"number":if(t>0)return function(t,e){var r,n;for(r=new Array(t),n=0;n=r-1){p=l.length-1;var d=t-e[r-1];for(f=0;f=r-1)for(var u=s.length-1,h=(e[r-1],0);h=0;--r)if(t[--e])return!1;return!0},s.jump=function(t){var e=this.lastT(),r=this.dimension;if(!(t0;--h)n.push(a(l[h-1],c[h-1],arguments[h])),i.push(0)}},s.push=function(t){var e=this.lastT(),r=this.dimension;if(!(t1e-6?1/s:0;this._time.push(t);for(var p=r;p>0;--p){var f=a(c[p-1],u[p-1],arguments[p]);n.push(f),i.push((f-n[o++])*h)}}},s.set=function(t){var e=this.dimension;if(!(t0;--l)r.push(a(o[l-1],s[l-1],arguments[l])),n.push(0)}},s.move=function(t){var e=this.lastT(),r=this.dimension;if(!(t<=e||arguments.length!==r+1)){var n=this._state,i=this._velocity,o=n.length-this.dimension,s=this.bounds,l=s[0],c=s[1],u=t-e,h=u>1e-6?1/u:0;this._time.push(t);for(var p=r;p>0;--p){var f=arguments[p];n.push(a(l[p-1],c[p-1],n[o++]+f)),i.push(f*h)}}},s.idle=function(t){var e=this.lastT();if(!(t=0;--h)n.push(a(l[h],c[h],n[o]+u*i[o])),i.push(0),o+=1}}},3840:function(t){function e(t,e,r,n,i,a){this._color=t,this.key=e,this.value=r,this.left=n,this.right=i,this._count=a}function r(t){return new e(t._color,t.key,t.value,t.left,t.right,t._count)}function n(t,r){return new e(t,r.key,r.value,r.left,r.right,r._count)}function i(t){t._count=1+(t.left?t.left._count:0)+(t.right?t.right._count:0)}function a(t,e){this._compare=t,this.root=e}t.exports=function(t){return new a(t||f,null)};var o=a.prototype;function s(t,e){var r;return e.left&&(r=s(t,e.left))?r:(r=t(e.key,e.value))||(e.right?s(t,e.right):void 0)}function l(t,e,r,n){if(e(t,n.key)<=0){var i;if(n.left&&(i=l(t,e,r,n.left)))return i;if(i=r(n.key,n.value))return i}if(n.right)return l(t,e,r,n.right)}function c(t,e,r,n,i){var a,o=r(t,i.key),s=r(e,i.key);return o<=0&&(i.left&&(a=c(t,e,r,n,i.left))||s>0&&(a=n(i.key,i.value)))?a:s>0&&i.right?c(t,e,r,n,i.right):void 0}function u(t,e){this.tree=t,this._stack=e}Object.defineProperty(o,"keys",{get:function(){var t=[];return this.forEach((function(e,r){t.push(e)})),t}}),Object.defineProperty(o,"values",{get:function(){var t=[];return this.forEach((function(e,r){t.push(r)})),t}}),Object.defineProperty(o,"length",{get:function(){return this.root?this.root._count:0}}),o.insert=function(t,r){for(var o=this._compare,s=this.root,l=[],c=[];s;){var u=o(t,s.key);l.push(s),c.push(u),s=u<=0?s.left:s.right}l.push(new e(0,t,r,null,null,1));for(var h=l.length-2;h>=0;--h)s=l[h],c[h]<=0?l[h]=new e(s._color,s.key,s.value,l[h+1],s.right,s._count+1):l[h]=new e(s._color,s.key,s.value,s.left,l[h+1],s._count+1);for(h=l.length-1;h>1;--h){var p=l[h-1];if(s=l[h],1===p._color||1===s._color)break;var f=l[h-2];if(f.left===p)if(p.left===s){if(!(d=f.right)||0!==d._color){f._color=0,f.left=p.right,p._color=1,p.right=f,l[h-2]=p,l[h-1]=s,i(f),i(p),h>=3&&((m=l[h-3]).left===f?m.left=p:m.right=p);break}p._color=1,f.right=n(1,d),f._color=0,h-=1}else{if(!(d=f.right)||0!==d._color){p.right=s.left,f._color=0,f.left=s.right,s._color=1,s.left=p,s.right=f,l[h-2]=s,l[h-1]=p,i(f),i(p),i(s),h>=3&&((m=l[h-3]).left===f?m.left=s:m.right=s);break}p._color=1,f.right=n(1,d),f._color=0,h-=1}else if(p.right===s){if(!(d=f.left)||0!==d._color){f._color=0,f.right=p.left,p._color=1,p.left=f,l[h-2]=p,l[h-1]=s,i(f),i(p),h>=3&&((m=l[h-3]).right===f?m.right=p:m.left=p);break}p._color=1,f.left=n(1,d),f._color=0,h-=1}else{var d;if(!(d=f.left)||0!==d._color){var m;p.left=s.right,f._color=0,f.right=s.left,s._color=1,s.right=p,s.left=f,l[h-2]=s,l[h-1]=p,i(f),i(p),i(s),h>=3&&((m=l[h-3]).right===f?m.right=s:m.left=s);break}p._color=1,f.left=n(1,d),f._color=0,h-=1}}return l[0]._color=1,new a(o,l[0])},o.forEach=function(t,e,r){if(this.root)switch(arguments.length){case 1:return s(t,this.root);case 2:return l(e,this._compare,t,this.root);case 3:return this._compare(e,r)>=0?void 0:c(e,r,this._compare,t,this.root)}},Object.defineProperty(o,"begin",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.left;return new u(this,t)}}),Object.defineProperty(o,"end",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.right;return new u(this,t)}}),o.at=function(t){if(t<0)return new u(this,[]);for(var e=this.root,r=[];;){if(r.push(e),e.left){if(t=e.right._count)break;e=e.right}return new u(this,[])},o.ge=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a<=0&&(i=n.length),r=a<=0?r.left:r.right}return n.length=i,new u(this,n)},o.gt=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a<0&&(i=n.length),r=a<0?r.left:r.right}return n.length=i,new u(this,n)},o.lt=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a>0&&(i=n.length),r=a<=0?r.left:r.right}return n.length=i,new u(this,n)},o.le=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a>=0&&(i=n.length),r=a<0?r.left:r.right}return n.length=i,new u(this,n)},o.find=function(t){for(var e=this._compare,r=this.root,n=[];r;){var i=e(t,r.key);if(n.push(r),0===i)return new u(this,n);r=i<=0?r.left:r.right}return new u(this,[])},o.remove=function(t){var e=this.find(t);return e?e.remove():this},o.get=function(t){for(var e=this._compare,r=this.root;r;){var n=e(t,r.key);if(0===n)return r.value;r=n<=0?r.left:r.right}};var h=u.prototype;function p(t,e){t.key=e.key,t.value=e.value,t.left=e.left,t.right=e.right,t._color=e._color,t._count=e._count}function f(t,e){return te?1:0}Object.defineProperty(h,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(h,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),h.clone=function(){return new u(this.tree,this._stack.slice())},h.remove=function(){var t=this._stack;if(0===t.length)return this.tree;var o=new Array(t.length),s=t[t.length-1];o[o.length-1]=new e(s._color,s.key,s.value,s.left,s.right,s._count);for(var l=t.length-2;l>=0;--l)(s=t[l]).left===t[l+1]?o[l]=new e(s._color,s.key,s.value,o[l+1],s.right,s._count):o[l]=new e(s._color,s.key,s.value,s.left,o[l+1],s._count);if((s=o[o.length-1]).left&&s.right){var c=o.length;for(s=s.left;s.right;)o.push(s),s=s.right;var u=o[c-1];for(o.push(new e(s._color,u.key,u.value,s.left,s.right,s._count)),o[c-1].key=s.key,o[c-1].value=s.value,l=o.length-2;l>=c;--l)s=o[l],o[l]=new e(s._color,s.key,s.value,s.left,o[l+1],s._count);o[c-1].left=o[c]}if(0===(s=o[o.length-1])._color){var h=o[o.length-2];for(h.left===s?h.left=null:h.right===s&&(h.right=null),o.pop(),l=0;l=0;--l){if(e=t[l],0===l)return void(e._color=1);if((a=t[l-1]).left===e){if((o=a.right).right&&0===o.right._color)return s=(o=a.right=r(o)).right=r(o.right),a.right=o.left,o.left=a,o.right=s,o._color=a._color,e._color=1,a._color=1,s._color=1,i(a),i(o),l>1&&((c=t[l-2]).left===a?c.left=o:c.right=o),void(t[l-1]=o);if(o.left&&0===o.left._color)return s=(o=a.right=r(o)).left=r(o.left),a.right=s.left,o.left=s.right,s.left=a,s.right=o,s._color=a._color,a._color=1,o._color=1,e._color=1,i(a),i(o),i(s),l>1&&((c=t[l-2]).left===a?c.left=s:c.right=s),void(t[l-1]=s);if(1===o._color){if(0===a._color)return a._color=1,void(a.right=n(0,o));a.right=n(0,o);continue}o=r(o),a.right=o.left,o.left=a,o._color=a._color,a._color=0,i(a),i(o),l>1&&((c=t[l-2]).left===a?c.left=o:c.right=o),t[l-1]=o,t[l]=a,l+11&&((c=t[l-2]).right===a?c.right=o:c.left=o),void(t[l-1]=o);if(o.right&&0===o.right._color)return s=(o=a.left=r(o)).right=r(o.right),a.left=s.right,o.right=s.left,s.right=a,s.left=o,s._color=a._color,a._color=1,o._color=1,e._color=1,i(a),i(o),i(s),l>1&&((c=t[l-2]).right===a?c.right=s:c.left=s),void(t[l-1]=s);if(1===o._color){if(0===a._color)return a._color=1,void(a.left=n(0,o));a.left=n(0,o);continue}var c;o=r(o),a.left=o.right,o.right=a,o._color=a._color,a._color=0,i(a),i(o),l>1&&((c=t[l-2]).right===a?c.right=o:c.left=o),t[l-1]=o,t[l]=a,l+10)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(h,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(h,"index",{get:function(){var t=0,e=this._stack;if(0===e.length){var r=this.tree.root;return r?r._count:0}e[e.length-1].left&&(t=e[e.length-1].left._count);for(var n=e.length-2;n>=0;--n)e[n+1]===e[n].right&&(++t,e[n].left&&(t+=e[n].left._count));return t},enumerable:!0}),h.next=function(){var t=this._stack;if(0!==t.length){var e=t[t.length-1];if(e.right)for(e=e.right;e;)t.push(e),e=e.left;else for(t.pop();t.length>0&&t[t.length-1].right===e;)e=t[t.length-1],t.pop()}},Object.defineProperty(h,"hasNext",{get:function(){var t=this._stack;if(0===t.length)return!1;if(t[t.length-1].right)return!0;for(var e=t.length-1;e>0;--e)if(t[e-1].left===t[e])return!0;return!1}}),h.update=function(t){var r=this._stack;if(0===r.length)throw new Error("Can't update empty node!");var n=new Array(r.length),i=r[r.length-1];n[n.length-1]=new e(i._color,i.key,t,i.left,i.right,i._count);for(var o=r.length-2;o>=0;--o)(i=r[o]).left===r[o+1]?n[o]=new e(i._color,i.key,i.value,n[o+1],i.right,i._count):n[o]=new e(i._color,i.key,i.value,i.left,n[o+1],i._count);return new a(this.tree._compare,n[0])},h.prev=function(){var t=this._stack;if(0!==t.length){var e=t[t.length-1];if(e.left)for(e=e.left;e;)t.push(e),e=e.right;else for(t.pop();t.length>0&&t[t.length-1].left===e;)e=t[t.length-1],t.pop()}},Object.defineProperty(h,"hasPrev",{get:function(){var t=this._stack;if(0===t.length)return!1;if(t[t.length-1].left)return!0;for(var e=t.length-1;e>0;--e)if(t[e-1].right===t[e])return!0;return!1}})},3837:function(t,e,r){t.exports=function(t,e){var r=new f(t);return r.update(e),r};var n=r(4935),i=r(501),a=r(5304),o=r(6429),s=r(6444),l=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),c=ArrayBuffer,u=DataView;function h(t){return Array.isArray(t)||function(t){return c.isView(t)&&!(t instanceof u)}(t)}function p(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function f(t){this.gl=t,this.pixelRatio=1,this.bounds=[[-10,-10,-10],[10,10,10]],this.ticks=[[],[],[]],this.autoTicks=!0,this.tickSpacing=[1,1,1],this.tickEnable=[!0,!0,!0],this.tickFont=["sans-serif","sans-serif","sans-serif"],this.tickFontStyle=["normal","normal","normal"],this.tickFontWeight=["normal","normal","normal"],this.tickFontVariant=["normal","normal","normal"],this.tickSize=[12,12,12],this.tickAngle=[0,0,0],this.tickAlign=["auto","auto","auto"],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[10,10,10],this.lastCubeProps={cubeEdges:[0,0,0],axis:[0,0,0]},this.labels=["x","y","z"],this.labelEnable=[!0,!0,!0],this.labelFont=["sans-serif","sans-serif","sans-serif"],this.labelFontStyle=["normal","normal","normal"],this.labelFontWeight=["normal","normal","normal"],this.labelFontVariant=["normal","normal","normal"],this.labelSize=[20,20,20],this.labelAngle=[0,0,0],this.labelAlign=["auto","auto","auto"],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[10,10,10],this.lineEnable=[!0,!0,!0],this.lineMirror=[!1,!1,!1],this.lineWidth=[1,1,1],this.lineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.lineTickEnable=[!0,!0,!0],this.lineTickMirror=[!1,!1,!1],this.lineTickLength=[0,0,0],this.lineTickWidth=[1,1,1],this.lineTickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.gridEnable=[!0,!0,!0],this.gridWidth=[1,1,1],this.gridColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroEnable=[!0,!0,!0],this.zeroLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroLineWidth=[2,2,2],this.backgroundEnable=[!1,!1,!1],this.backgroundColor=[[.8,.8,.8,.5],[.8,.8,.8,.5],[.8,.8,.8,.5]],this._firstInit=!0,this._text=null,this._lines=null,this._background=a(t)}var d=f.prototype;function m(){this.primalOffset=[0,0,0],this.primalMinor=[0,0,0],this.mirrorOffset=[0,0,0],this.mirrorMinor=[0,0,0]}d.update=function(t){function e(e,r,n){if(n in t){var i,a=t[n],o=this[n];(e?h(a)&&h(a[0]):h(a))?this[n]=i=[r(a[0]),r(a[1]),r(a[2])]:this[n]=i=[r(a),r(a),r(a)];for(var s=0;s<3;++s)if(i[s]!==o[s])return!0}return!1}t=t||{};var r,a=e.bind(this,!1,Number),o=e.bind(this,!1,Boolean),l=e.bind(this,!1,String),c=e.bind(this,!0,(function(t){if(h(t)){if(3===t.length)return[+t[0],+t[1],+t[2],1];if(4===t.length)return[+t[0],+t[1],+t[2],+t[3]]}return[0,0,0,1]})),u=!1,p=!1;if("bounds"in t)for(var f=t.bounds,d=0;d<2;++d)for(var m=0;m<3;++m)f[d][m]!==this.bounds[d][m]&&(p=!0),this.bounds[d][m]=f[d][m];if("ticks"in t)for(r=t.ticks,u=!0,this.autoTicks=!1,d=0;d<3;++d)this.tickSpacing[d]=0;else a("tickSpacing")&&(this.autoTicks=!0,p=!0);if(this._firstInit&&("ticks"in t||"tickSpacing"in t||(this.autoTicks=!0),p=!0,u=!0,this._firstInit=!1),p&&this.autoTicks&&(r=s.create(this.bounds,this.tickSpacing),u=!0),u){for(d=0;d<3;++d)r[d].sort((function(t,e){return t.x-e.x}));s.equal(r,this.ticks)?u=!1:this.ticks=r}o("tickEnable"),l("tickFont")&&(u=!0),l("tickFontStyle")&&(u=!0),l("tickFontWeight")&&(u=!0),l("tickFontVariant")&&(u=!0),a("tickSize"),a("tickAngle"),a("tickPad"),c("tickColor");var g=l("labels");l("labelFont")&&(g=!0),l("labelFontStyle")&&(g=!0),l("labelFontWeight")&&(g=!0),l("labelFontVariant")&&(g=!0),o("labelEnable"),a("labelSize"),a("labelPad"),c("labelColor"),o("lineEnable"),o("lineMirror"),a("lineWidth"),c("lineColor"),o("lineTickEnable"),o("lineTickMirror"),a("lineTickLength"),a("lineTickWidth"),c("lineTickColor"),o("gridEnable"),a("gridWidth"),c("gridColor"),o("zeroEnable"),c("zeroLineColor"),a("zeroLineWidth"),o("backgroundEnable"),c("backgroundColor");var y=[{family:this.labelFont[0],style:this.labelFontStyle[0],weight:this.labelFontWeight[0],variant:this.labelFontVariant[0]},{family:this.labelFont[1],style:this.labelFontStyle[1],weight:this.labelFontWeight[1],variant:this.labelFontVariant[1]},{family:this.labelFont[2],style:this.labelFontStyle[2],weight:this.labelFontWeight[2],variant:this.labelFontVariant[2]}],v=[{family:this.tickFont[0],style:this.tickFontStyle[0],weight:this.tickFontWeight[0],variant:this.tickFontVariant[0]},{family:this.tickFont[1],style:this.tickFontStyle[1],weight:this.tickFontWeight[1],variant:this.tickFontVariant[1]},{family:this.tickFont[2],style:this.tickFontStyle[2],weight:this.tickFontWeight[2],variant:this.tickFontVariant[2]}];this._text?this._text&&(g||u)&&this._text.update(this.bounds,this.labels,y,this.ticks,v):this._text=n(this.gl,this.bounds,this.labels,y,this.ticks,v),this._lines&&u&&(this._lines.dispose(),this._lines=null),this._lines||(this._lines=i(this.gl,this.bounds,this.ticks))};var g=[new m,new m,new m];function y(t,e,r,n,i){for(var a=t.primalOffset,o=t.primalMinor,s=t.mirrorOffset,l=t.mirrorMinor,c=n[e],u=0;u<3;++u)if(e!==u){var h=a,p=s,f=o,d=l;c&1<0?(f[u]=-1,d[u]=0):(f[u]=0,d[u]=1)}}var v=[0,0,0],x={model:l,view:l,projection:l,_ortho:!1};d.isOpaque=function(){return!0},d.isTransparent=function(){return!1},d.drawTransparent=function(t){};var _=[0,0,0],b=[0,0,0],w=[0,0,0];d.draw=function(t){t=t||x;for(var e=this.gl,r=t.model||l,n=t.view||l,i=t.projection||l,a=this.bounds,s=t._ortho||!1,c=o(r,n,i,a,s),u=c.cubeEdges,h=c.axis,f=n[12],d=n[13],m=n[14],T=n[15],A=(s?2:1)*this.pixelRatio*(i[3]*f+i[7]*d+i[11]*m+i[15]*T)/e.drawingBufferHeight,k=0;k<3;++k)this.lastCubeProps.cubeEdges[k]=u[k],this.lastCubeProps.axis[k]=h[k];var M=g;for(k=0;k<3;++k)y(g[k],k,this.bounds,u,h);e=this.gl;var S,E,C,I,L,P,z,D,O,R,F,B,j=v;for(k=0;k<3;++k)this.backgroundEnable[k]?j[k]=h[k]:j[k]=0;for(this._background.draw(r,n,i,a,j,this.backgroundColor),this._lines.bind(r,n,i,this),k=0;k<3;++k){var N=[0,0,0];h[k]>0?N[k]=a[1][k]:N[k]=a[0][k];for(var U=0;U<2;++U){var V=(k+1+U)%3,q=(k+1+(1^U))%3;this.gridEnable[V]&&this._lines.drawGrid(V,q,this.bounds,N,this.gridColor[V],this.gridWidth[V]*this.pixelRatio)}for(U=0;U<2;++U)V=(k+1+U)%3,q=(k+1+(1^U))%3,this.zeroEnable[q]&&Math.min(a[0][q],a[1][q])<=0&&Math.max(a[0][q],a[1][q])>=0&&this._lines.drawZero(V,q,this.bounds,N,this.zeroLineColor[q],this.zeroLineWidth[q]*this.pixelRatio)}for(k=0;k<3;++k){this.lineEnable[k]&&this._lines.drawAxisLine(k,this.bounds,M[k].primalOffset,this.lineColor[k],this.lineWidth[k]*this.pixelRatio),this.lineMirror[k]&&this._lines.drawAxisLine(k,this.bounds,M[k].mirrorOffset,this.lineColor[k],this.lineWidth[k]*this.pixelRatio);var H=p(_,M[k].primalMinor),G=p(b,M[k].mirrorMinor),W=this.lineTickLength;for(U=0;U<3;++U){var Z=A/r[5*U];H[U]*=W[U]*Z,G[U]*=W[U]*Z}this.lineTickEnable[k]&&this._lines.drawAxisTicks(k,M[k].primalOffset,H,this.lineTickColor[k],this.lineTickWidth[k]*this.pixelRatio),this.lineTickMirror[k]&&this._lines.drawAxisTicks(k,M[k].mirrorOffset,G,this.lineTickColor[k],this.lineTickWidth[k]*this.pixelRatio)}function Y(t){(C=[0,0,0])[t]=1}for(this._lines.unbind(),this._text.bind(r,n,i,this.pixelRatio),k=0;k<3;++k){var X=M[k].primalMinor,$=M[k].mirrorMinor,K=p(w,M[k].primalOffset);for(U=0;U<3;++U)this.lineTickEnable[k]&&(K[U]+=A*X[U]*Math.max(this.lineTickLength[U],0)/r[5*U]);var J=[0,0,0];if(J[k]=1,this.tickEnable[k]){for(-3600===this.tickAngle[k]?(this.tickAngle[k]=0,this.tickAlign[k]="auto"):this.tickAlign[k]=-1,E=1,"auto"===(S=[this.tickAlign[k],.5,E])[0]?S[0]=0:S[0]=parseInt(""+S[0]),C=[0,0,0],P=$,void 0,void 0,void 0,void 0,void 0,void 0,D=((I=k)+2)%3,O=(L=X)[z=(I+1)%3],R=L[D],F=P[z],B=P[D],O>0&&B>0||O>0&&B<0||O<0&&B>0||O<0&&B<0?Y(z):(R>0&&F>0||R>0&&F<0||R<0&&F>0||R<0&&F<0)&&Y(D),U=0;U<3;++U)K[U]+=A*X[U]*this.tickPad[U]/r[5*U];this._text.drawTicks(k,this.tickSize[k],this.tickAngle[k],K,this.tickColor[k],J,C,S)}if(this.labelEnable[k]){for(E=0,C=[0,0,0],this.labels[k].length>4&&(Y(k),E=1),"auto"===(S=[this.labelAlign[k],.5,E])[0]?S[0]=0:S[0]=parseInt(""+S[0]),U=0;U<3;++U)K[U]+=A*X[U]*this.labelPad[U]/r[5*U];K[k]+=.5*(a[0][k]+a[1][k]),this._text.drawLabel(k,this.labelSize[k],this.labelAngle[k],K,this.labelColor[k],[0,0,0],C,S)}}this._text.unbind()},d.dispose=function(){this._text.dispose(),this._lines.dispose(),this._background.dispose(),this._lines=null,this._text=null,this._background=null,this.gl=null}},5304:function(t,e,r){t.exports=function(t){for(var e=[],r=[],s=0,l=0;l<3;++l)for(var c=(l+1)%3,u=(l+2)%3,h=[0,0,0],p=[0,0,0],f=-1;f<=1;f+=2){r.push(s,s+2,s+1,s+1,s+2,s+3),h[l]=f,p[l]=f;for(var d=-1;d<=1;d+=2){h[c]=d;for(var m=-1;m<=1;m+=2)h[u]=m,e.push(h[0],h[1],h[2],p[0],p[1],p[2]),s+=1}var g=c;c=u,u=g}var y=n(t,new Float32Array(e)),v=n(t,new Uint16Array(r),t.ELEMENT_ARRAY_BUFFER),x=i(t,[{buffer:y,type:t.FLOAT,size:3,offset:0,stride:24},{buffer:y,type:t.FLOAT,size:3,offset:12,stride:24}],v),_=a(t);return _.attributes.position.location=0,_.attributes.normal.location=1,new o(t,y,x,_)};var n=r(2762),i=r(8116),a=r(1879).bg;function o(t,e,r,n){this.gl=t,this.buffer=e,this.vao=r,this.shader=n}var s=o.prototype;s.draw=function(t,e,r,n,i,a){for(var o=!1,s=0;s<3;++s)o=o||i[s];if(o){var l=this.gl;l.enable(l.POLYGON_OFFSET_FILL),l.polygonOffset(1,2),this.shader.bind(),this.shader.uniforms={model:t,view:e,projection:r,bounds:n,enable:i,colors:a},this.vao.bind(),this.vao.draw(this.gl.TRIANGLES,36),this.vao.unbind(),l.disable(l.POLYGON_OFFSET_FILL)}},s.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},6429:function(t,e,r){t.exports=function(t,e,r,a,f){i(s,e,t),i(s,r,s);for(var v=0,x=0;x<2;++x){u[2]=a[x][2];for(var _=0;_<2;++_){u[1]=a[_][1];for(var b=0;b<2;++b)u[0]=a[b][0],p(l[v],u,s),v+=1}}var w=-1;for(x=0;x<8;++x){for(var T=l[x][3],A=0;A<3;++A)c[x][A]=l[x][A]/T;f&&(c[x][2]*=-1),T<0&&(w<0||c[x][2]E&&(w|=1<E&&(w|=1<c[x][1])&&(R=x);var F=-1;for(x=0;x<3;++x)(j=R^1<c[B][0]&&(B=j))}var N=m;N[0]=N[1]=N[2]=0,N[n.log2(F^R)]=R&F,N[n.log2(R^B)]=R&B;var U=7^B;U===w||U===O?(U=7^F,N[n.log2(B^U)]=U&B):N[n.log2(F^U)]=U&F;var V=g,q=w;for(k=0;k<3;++k)V[k]=q&1< HALF_PI) && (b <= ONE_AND_HALF_PI)) ?\n b - PI :\n b;\n}\n\nfloat look_horizontal_or_vertical(float a, float ratio) {\n // ratio controls the ratio between being horizontal to (vertical + horizontal)\n // if ratio is set to 0.5 then it is 50%, 50%.\n // when using a higher ratio e.g. 0.75 the result would\n // likely be more horizontal than vertical.\n\n float b = positive_angle(a);\n\n return\n (b < ( ratio) * HALF_PI) ? 0.0 :\n (b < (2.0 - ratio) * HALF_PI) ? -HALF_PI :\n (b < (2.0 + ratio) * HALF_PI) ? 0.0 :\n (b < (4.0 - ratio) * HALF_PI) ? HALF_PI :\n 0.0;\n}\n\nfloat roundTo(float a, float b) {\n return float(b * floor((a + 0.5 * b) / b));\n}\n\nfloat look_round_n_directions(float a, int n) {\n float b = positive_angle(a);\n float div = TWO_PI / float(n);\n float c = roundTo(b, div);\n return look_upwards(c);\n}\n\nfloat applyAlignOption(float rawAngle, float delta) {\n return\n (option > 2) ? look_round_n_directions(rawAngle + delta, option) : // option 3-n: round to n directions\n (option == 2) ? look_horizontal_or_vertical(rawAngle + delta, hv_ratio) : // horizontal or vertical\n (option == 1) ? rawAngle + delta : // use free angle, and flip to align with one direction of the axis\n (option == 0) ? look_upwards(rawAngle) : // use free angle, and stay upwards\n (option ==-1) ? 0.0 : // useful for backward compatibility, all texts remains horizontal\n rawAngle; // otherwise return back raw input angle\n}\n\nbool isAxisTitle = (axis.x == 0.0) &&\n (axis.y == 0.0) &&\n (axis.z == 0.0);\n\nvoid main() {\n //Compute world offset\n float axisDistance = position.z;\n vec3 dataPosition = axisDistance * axis + offset;\n\n float beta = angle; // i.e. user defined attributes for each tick\n\n float axisAngle;\n float clipAngle;\n float flip;\n\n if (enableAlign) {\n axisAngle = (isAxisTitle) ? HALF_PI :\n computeViewAngle(dataPosition, dataPosition + axis);\n clipAngle = computeViewAngle(dataPosition, dataPosition + alignDir);\n\n axisAngle += (sin(axisAngle) < 0.0) ? PI : 0.0;\n clipAngle += (sin(clipAngle) < 0.0) ? PI : 0.0;\n\n flip = (dot(vec2(cos(axisAngle), sin(axisAngle)),\n vec2(sin(clipAngle),-cos(clipAngle))) > 0.0) ? 1.0 : 0.0;\n\n beta += applyAlignOption(clipAngle, flip * PI);\n }\n\n //Compute plane offset\n vec2 planeCoord = position.xy * pixelScale;\n\n mat2 planeXform = scale * mat2(\n cos(beta), sin(beta),\n -sin(beta), cos(beta)\n );\n\n vec2 viewOffset = 2.0 * planeXform * planeCoord / resolution;\n\n //Compute clip position\n vec3 clipPosition = project(dataPosition);\n\n //Apply text offset in clip coordinates\n clipPosition += vec3(viewOffset, 0.0);\n\n //Done\n gl_Position = vec4(clipPosition, 1.0);\n}\n"]),l=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec4 color;\nvoid main() {\n gl_FragColor = color;\n}"]);e.Q=function(t){return i(t,s,l,null,[{name:"position",type:"vec3"}])};var c=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec3 normal;\n\nuniform mat4 model, view, projection;\nuniform vec3 enable;\nuniform vec3 bounds[2];\n\nvarying vec3 colorChannel;\n\nvoid main() {\n\n vec3 signAxis = sign(bounds[1] - bounds[0]);\n\n vec3 realNormal = signAxis * normal;\n\n if(dot(realNormal, enable) > 0.0) {\n vec3 minRange = min(bounds[0], bounds[1]);\n vec3 maxRange = max(bounds[0], bounds[1]);\n vec3 nPosition = mix(minRange, maxRange, 0.5 * (position + 1.0));\n gl_Position = projection * (view * (model * vec4(nPosition, 1.0)));\n } else {\n gl_Position = vec4(0,0,0,0);\n }\n\n colorChannel = abs(realNormal);\n}\n"]),u=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec4 colors[3];\n\nvarying vec3 colorChannel;\n\nvoid main() {\n gl_FragColor = colorChannel.x * colors[0] +\n colorChannel.y * colors[1] +\n colorChannel.z * colors[2];\n}"]);e.bg=function(t){return i(t,c,u,null,[{name:"position",type:"vec3"},{name:"normal",type:"vec3"}])}},4935:function(t,e,r){t.exports=function(t,e,r,a,s,l){var c=n(t),h=i(t,[{buffer:c,size:3}]),p=o(t);p.attributes.position.location=0;var f=new u(t,p,c,h);return f.update(e,r,a,s,l),f};var n=r(2762),i=r(8116),a=r(4359),o=r(1879).Q,s=window||c.global||{},l=s.__TEXT_CACHE||{};function u(t,e,r,n){this.gl=t,this.shader=e,this.buffer=r,this.vao=n,this.tickOffset=this.tickCount=this.labelOffset=this.labelCount=null}s.__TEXT_CACHE={};var h=u.prototype,p=[0,0];h.bind=function(t,e,r,n){this.vao.bind(),this.shader.bind();var i=this.shader.uniforms;i.model=t,i.view=e,i.projection=r,i.pixelScale=n,p[0]=this.gl.drawingBufferWidth,p[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=p},h.unbind=function(){this.vao.unbind()},h.update=function(t,e,r,n,i){var o=[];function s(t,e,r,n,i,s){var c=[r.style,r.weight,r.variant,r.family].join("_"),u=l[c];u||(u=l[c]={});var h=u[e];h||(h=u[e]=function(t,e){try{return a(t,e)}catch(e){return console.warn('error vectorizing text:"'+t+'" error:',e),{cells:[],positions:[]}}}(e,{triangles:!0,font:r.family,fontStyle:r.style,fontWeight:r.weight,fontVariant:r.variant,textAlign:"center",textBaseline:"middle",lineSpacing:i,styletags:s}));for(var p=(n||12)/12,f=h.positions,d=h.cells,m=0,g=d.length;m=0;--v){var x=f[y[v]];o.push(p*x[0],-p*x[1],t)}}for(var c=[0,0,0],u=[0,0,0],h=[0,0,0],p=[0,0,0],f={breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},d=0;d<3;++d){h[d]=o.length/3|0,s(.5*(t[0][d]+t[1][d]),e[d],r[d],12,1.25,f),p[d]=(o.length/3|0)-h[d],c[d]=o.length/3|0;for(var m=0;m=0&&(i=r.length-n-1);var a=Math.pow(10,i),o=Math.round(t*e*a),s=o+"";if(s.indexOf("e")>=0)return s;var l=o/a,c=o%a;o<0?(l=0|-Math.ceil(l),c=0|-c):(l=0|Math.floor(l),c|=0);var u=""+l;if(o<0&&(u="-"+u),i){for(var h=""+c;h.length=t[0][i];--o)a.push({x:o*e[i],text:r(e[i],o)});n.push(a)}return n},e.equal=function(t,e){for(var r=0;r<3;++r){if(t[r].length!==e[r].length)return!1;for(var n=0;nr)throw new Error("gl-buffer: If resizing buffer, must not specify offset");return t.bufferSubData(e,a,i),r}function u(t,e){for(var r=n.malloc(t.length,e),i=t.length,a=0;a=0;--n){if(e[n]!==r)return!1;r*=t[n]}return!0}(t.shape,t.stride))0===t.offset&&t.data.length===t.shape[0]?this.length=c(this.gl,this.type,this.length,this.usage,t.data,e):this.length=c(this.gl,this.type,this.length,this.usage,t.data.subarray(t.offset,t.shape[0]),e);else{var s=n.malloc(t.size,r),l=a(s,t.shape);i.assign(l,t),this.length=c(this.gl,this.type,this.length,this.usage,e<0?s:s.subarray(0,t.size),e),n.free(s)}}else if(Array.isArray(t)){var h;h=this.type===this.gl.ELEMENT_ARRAY_BUFFER?u(t,"uint16"):u(t,"float32"),this.length=c(this.gl,this.type,this.length,this.usage,e<0?h:h.subarray(0,t.length),e),n.free(h)}else if("object"==typeof t&&"number"==typeof t.length)this.length=c(this.gl,this.type,this.length,this.usage,t,e);else{if("number"!=typeof t&&void 0!==t)throw new Error("gl-buffer: Invalid data type");if(e>=0)throw new Error("gl-buffer: Cannot specify offset when resizing buffer");(t|=0)<=0&&(t=1),this.gl.bufferData(this.type,0|t,this.usage),this.length=t}},t.exports=function(t,e,r,n){if(r=r||t.ARRAY_BUFFER,n=n||t.DYNAMIC_DRAW,r!==t.ARRAY_BUFFER&&r!==t.ELEMENT_ARRAY_BUFFER)throw new Error("gl-buffer: Invalid type for webgl buffer, must be either gl.ARRAY_BUFFER or gl.ELEMENT_ARRAY_BUFFER");if(n!==t.DYNAMIC_DRAW&&n!==t.STATIC_DRAW&&n!==t.STREAM_DRAW)throw new Error("gl-buffer: Invalid usage for buffer, must be either gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW");var i=t.createBuffer(),a=new s(t,r,i,0,n);return a.update(e),a}},6405:function(t,e,r){var n=r(2931);t.exports=function(t,e){var r=t.positions,i=t.vectors,a={positions:[],vertexIntensity:[],vertexIntensityBounds:t.vertexIntensityBounds,vectors:[],cells:[],coneOffset:t.coneOffset,colormap:t.colormap};if(0===t.positions.length)return e&&(e[0]=[0,0,0],e[1]=[0,0,0]),a;for(var o=0,s=1/0,l=-1/0,c=1/0,u=-1/0,h=1/0,p=-1/0,f=null,d=null,m=[],g=1/0,y=!1,v="raw"===t.coneSizemode,x=0;xo&&(o=n.length(b)),x&&!v){var w=2*n.distance(f,_)/(n.length(d)+n.length(b));w?(g=Math.min(g,w),y=!1):y=!0}y||(f=_,d=b),m.push(b)}var T=[s,c,h],A=[l,u,p];e&&(e[0]=T,e[1]=A),0===o&&(o=1);var k=1/o;isFinite(g)||(g=1),a.vectorScale=g;var M=t.coneSize||(v?1:.5);t.absoluteConeSize&&(M=t.absoluteConeSize*k),a.coneScale=M,x=0;for(var S=0;x=1},f.isTransparent=function(){return this.opacity<1},f.pickSlots=1,f.setPickBase=function(t){this.pickId=t},f.update=function(t){t=t||{};var e=this.gl;this.dirty=!0,"lightPosition"in t&&(this.lightPosition=t.lightPosition),"opacity"in t&&(this.opacity=t.opacity),"ambient"in t&&(this.ambientLight=t.ambient),"diffuse"in t&&(this.diffuseLight=t.diffuse),"specular"in t&&(this.specularLight=t.specular),"roughness"in t&&(this.roughness=t.roughness),"fresnel"in t&&(this.fresnel=t.fresnel),void 0!==t.tubeScale&&(this.tubeScale=t.tubeScale),void 0!==t.vectorScale&&(this.vectorScale=t.vectorScale),void 0!==t.coneScale&&(this.coneScale=t.coneScale),void 0!==t.coneOffset&&(this.coneOffset=t.coneOffset),t.colormap&&(this.texture.shape=[256,256],this.texture.minFilter=e.LINEAR_MIPMAP_LINEAR,this.texture.magFilter=e.LINEAR,this.texture.setPixels(function(t){for(var e=u({colormap:t,nshades:256,format:"rgba"}),r=new Uint8Array(1024),n=0;n<256;++n){for(var i=e[n],a=0;a<3;++a)r[4*n+a]=i[a];r[4*n+3]=255*i[3]}return c(r,[256,256,4],[4,0,1])}(t.colormap)),this.texture.generateMipmap());var r=t.cells,n=t.positions,i=t.vectors;if(n&&r&&i){var a=[],o=[],s=[],l=[],h=[];this.cells=r,this.positions=n,this.vectors=i;var p=t.meshColor||[1,1,1,1],f=t.vertexIntensity,d=1/0,m=-1/0;if(f)if(t.vertexIntensityBounds)d=+t.vertexIntensityBounds[0],m=+t.vertexIntensityBounds[1];else for(var g=0;g0){var m=this.triShader;m.bind(),m.uniforms=c,this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()}},f.drawPick=function(t){t=t||{};for(var e=this.gl,r=t.model||h,n=t.view||h,i=t.projection||h,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);this._model=[].slice.call(r),this._view=[].slice.call(n),this._projection=[].slice.call(i),this._resolution=[e.drawingBufferWidth,e.drawingBufferHeight];var s={model:r,view:n,projection:i,clipBounds:a,tubeScale:this.tubeScale,vectorScale:this.vectorScale,coneScale:this.coneScale,coneOffset:this.coneOffset,pickId:this.pickId/255},l=this.pickShader;l.bind(),l.uniforms=s,this.triangleCount>0&&(this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind())},f.pick=function(t){if(!t||t.id!==this.pickId)return null;var e=t.value[0]+256*t.value[1]+65536*t.value[2],r=this.cells[e],n=this.positions[r[1]].slice(0,3),i={position:n,dataCoordinate:n,index:Math.floor(r[1]/48)};return"cone"===this.traceType?i.index=Math.floor(r[1]/48):"streamtube"===this.traceType&&(i.intensity=this.intensity[r[1]],i.velocity=this.vectors[r[1]].slice(0,3),i.divergence=this.vectors[r[1]][3],i.index=e),i},f.dispose=function(){this.texture.dispose(),this.triShader.dispose(),this.pickShader.dispose(),this.triangleVAO.dispose(),this.trianglePositions.dispose(),this.triangleVectors.dispose(),this.triangleColors.dispose(),this.triangleUVs.dispose(),this.triangleIds.dispose()},t.exports=function(t,e,r){var s=r.shaders;1===arguments.length&&(t=(e=t).gl);var l=function(t,e){var r=n(t,e.meshShader.vertex,e.meshShader.fragment,null,e.meshShader.attributes);return r.attributes.position.location=0,r.attributes.color.location=2,r.attributes.uv.location=3,r.attributes.vector.location=4,r}(t,s),u=function(t,e){var r=n(t,e.pickShader.vertex,e.pickShader.fragment,null,e.pickShader.attributes);return r.attributes.position.location=0,r.attributes.id.location=1,r.attributes.vector.location=4,r}(t,s),h=o(t,c(new Uint8Array([255,255,255,255]),[1,1,4]));h.generateMipmap(),h.minFilter=t.LINEAR_MIPMAP_LINEAR,h.magFilter=t.LINEAR;var f=i(t),d=i(t),m=i(t),g=i(t),y=i(t),v=new p(t,h,l,u,f,d,y,m,g,a(t,[{buffer:f,type:t.FLOAT,size:4},{buffer:y,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:m,type:t.FLOAT,size:4},{buffer:g,type:t.FLOAT,size:2},{buffer:d,type:t.FLOAT,size:4}]),r.traceType||"cone");return v.update(e),v}},614:function(t,e,r){var n=r(3236),i=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the cone vertex and normal at the given index.\n//\n// The returned vertex is for a cone with its top at origin and height of 1.0,\n// pointing in the direction of the vector attribute.\n//\n// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices.\n// These vertices are used to make up the triangles of the cone by the following:\n// segment + 0 top vertex\n// segment + 1 perimeter vertex a+1\n// segment + 2 perimeter vertex a\n// segment + 3 center base vertex\n// segment + 4 perimeter vertex a\n// segment + 5 perimeter vertex a+1\n// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment.\n// To go from index to segment, floor(index / 6)\n// To go from segment to angle, 2*pi * (segment/segmentCount)\n// To go from index to segment index, index - (segment*6)\n//\nvec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) {\n\n const float segmentCount = 8.0;\n\n float index = rawIndex - floor(rawIndex /\n (segmentCount * 6.0)) *\n (segmentCount * 6.0);\n\n float segment = floor(0.001 + index/6.0);\n float segmentIndex = index - (segment*6.0);\n\n normal = -normalize(d);\n\n if (segmentIndex > 2.99 && segmentIndex < 3.01) {\n return mix(vec3(0.0), -d, coneOffset);\n }\n\n float nextAngle = (\n (segmentIndex > 0.99 && segmentIndex < 1.01) ||\n (segmentIndex > 4.99 && segmentIndex < 5.01)\n ) ? 1.0 : 0.0;\n float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount);\n\n vec3 v1 = mix(d, vec3(0.0), coneOffset);\n vec3 v2 = v1 - d;\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d)*0.25;\n vec3 y = v * sin(angle) * length(d)*0.25;\n vec3 v3 = v2 + x + y;\n if (segmentIndex < 3.0) {\n vec3 tx = u * sin(angle);\n vec3 ty = v * -cos(angle);\n vec3 tangent = tx + ty;\n normal = normalize(cross(v3 - v1, tangent));\n }\n\n if (segmentIndex == 0.0) {\n return mix(d, vec3(0.0), coneOffset);\n }\n return v3;\n}\n\nattribute vec3 vector;\nattribute vec4 color, position;\nattribute vec2 uv;\n\nuniform float vectorScale, coneScale, coneOffset;\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 eyePosition, lightPosition;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n // Scale the vector magnitude to stay constant with\n // model & view changes.\n vec3 normal;\n vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector), position.w, coneOffset, normal);\n vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * conePosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n // vec4 m_position = model * vec4(conePosition, 1.0);\n vec4 t_position = view * conePosition;\n gl_Position = projection * t_position;\n\n f_color = color;\n f_data = conePosition.xyz;\n f_position = position.xyz;\n f_uv = uv;\n}\n"]),a=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\nfloat cookTorranceSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness,\n float fresnel) {\n\n float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);\n float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);\n\n //Half angle vector\n vec3 H = normalize(lightDirection + viewDirection);\n\n //Geometric term\n float NdotH = max(dot(surfaceNormal, H), 0.0);\n float VdotH = max(dot(viewDirection, H), 0.000001);\n float LdotH = max(dot(lightDirection, H), 0.000001);\n float G1 = (2.0 * NdotH * VdotN) / VdotH;\n float G2 = (2.0 * NdotH * LdotN) / LdotH;\n float G = min(1.0, min(G1, G2));\n \n //Distribution term\n float D = beckmannDistribution(NdotH, roughness);\n\n //Fresnel term\n float F = pow(1.0 - VdotN, fresnel);\n\n //Multiply terms and done\n return G * F * D / max(3.14159265 * VdotN, 0.000001);\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform sampler2D texture;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n vec3 N = normalize(f_normal);\n vec3 L = normalize(f_lightDirection);\n vec3 V = normalize(f_eyeDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = f_color * texture2D(texture, f_uv);\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = litColor * opacity;\n}\n"]),o=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the cone vertex and normal at the given index.\n//\n// The returned vertex is for a cone with its top at origin and height of 1.0,\n// pointing in the direction of the vector attribute.\n//\n// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices.\n// These vertices are used to make up the triangles of the cone by the following:\n// segment + 0 top vertex\n// segment + 1 perimeter vertex a+1\n// segment + 2 perimeter vertex a\n// segment + 3 center base vertex\n// segment + 4 perimeter vertex a\n// segment + 5 perimeter vertex a+1\n// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment.\n// To go from index to segment, floor(index / 6)\n// To go from segment to angle, 2*pi * (segment/segmentCount)\n// To go from index to segment index, index - (segment*6)\n//\nvec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) {\n\n const float segmentCount = 8.0;\n\n float index = rawIndex - floor(rawIndex /\n (segmentCount * 6.0)) *\n (segmentCount * 6.0);\n\n float segment = floor(0.001 + index/6.0);\n float segmentIndex = index - (segment*6.0);\n\n normal = -normalize(d);\n\n if (segmentIndex > 2.99 && segmentIndex < 3.01) {\n return mix(vec3(0.0), -d, coneOffset);\n }\n\n float nextAngle = (\n (segmentIndex > 0.99 && segmentIndex < 1.01) ||\n (segmentIndex > 4.99 && segmentIndex < 5.01)\n ) ? 1.0 : 0.0;\n float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount);\n\n vec3 v1 = mix(d, vec3(0.0), coneOffset);\n vec3 v2 = v1 - d;\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d)*0.25;\n vec3 y = v * sin(angle) * length(d)*0.25;\n vec3 v3 = v2 + x + y;\n if (segmentIndex < 3.0) {\n vec3 tx = u * sin(angle);\n vec3 ty = v * -cos(angle);\n vec3 tangent = tx + ty;\n normal = normalize(cross(v3 - v1, tangent));\n }\n\n if (segmentIndex == 0.0) {\n return mix(d, vec3(0.0), coneOffset);\n }\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform float vectorScale, coneScale, coneOffset;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n vec3 normal;\n vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector.xyz), position.w, coneOffset, normal);\n vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n gl_Position = projection * (view * conePosition);\n f_id = id;\n f_position = position.xyz;\n}\n"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]);e.meshShader={vertex:i,fragment:a,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec3"}]},e.pickShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec3"}]}},737:function(t){t.exports={0:"NONE",1:"ONE",2:"LINE_LOOP",3:"LINE_STRIP",4:"TRIANGLES",5:"TRIANGLE_STRIP",6:"TRIANGLE_FAN",256:"DEPTH_BUFFER_BIT",512:"NEVER",513:"LESS",514:"EQUAL",515:"LEQUAL",516:"GREATER",517:"NOTEQUAL",518:"GEQUAL",519:"ALWAYS",768:"SRC_COLOR",769:"ONE_MINUS_SRC_COLOR",770:"SRC_ALPHA",771:"ONE_MINUS_SRC_ALPHA",772:"DST_ALPHA",773:"ONE_MINUS_DST_ALPHA",774:"DST_COLOR",775:"ONE_MINUS_DST_COLOR",776:"SRC_ALPHA_SATURATE",1024:"STENCIL_BUFFER_BIT",1028:"FRONT",1029:"BACK",1032:"FRONT_AND_BACK",1280:"INVALID_ENUM",1281:"INVALID_VALUE",1282:"INVALID_OPERATION",1285:"OUT_OF_MEMORY",1286:"INVALID_FRAMEBUFFER_OPERATION",2304:"CW",2305:"CCW",2849:"LINE_WIDTH",2884:"CULL_FACE",2885:"CULL_FACE_MODE",2886:"FRONT_FACE",2928:"DEPTH_RANGE",2929:"DEPTH_TEST",2930:"DEPTH_WRITEMASK",2931:"DEPTH_CLEAR_VALUE",2932:"DEPTH_FUNC",2960:"STENCIL_TEST",2961:"STENCIL_CLEAR_VALUE",2962:"STENCIL_FUNC",2963:"STENCIL_VALUE_MASK",2964:"STENCIL_FAIL",2965:"STENCIL_PASS_DEPTH_FAIL",2966:"STENCIL_PASS_DEPTH_PASS",2967:"STENCIL_REF",2968:"STENCIL_WRITEMASK",2978:"VIEWPORT",3024:"DITHER",3042:"BLEND",3088:"SCISSOR_BOX",3089:"SCISSOR_TEST",3106:"COLOR_CLEAR_VALUE",3107:"COLOR_WRITEMASK",3317:"UNPACK_ALIGNMENT",3333:"PACK_ALIGNMENT",3379:"MAX_TEXTURE_SIZE",3386:"MAX_VIEWPORT_DIMS",3408:"SUBPIXEL_BITS",3410:"RED_BITS",3411:"GREEN_BITS",3412:"BLUE_BITS",3413:"ALPHA_BITS",3414:"DEPTH_BITS",3415:"STENCIL_BITS",3553:"TEXTURE_2D",4352:"DONT_CARE",4353:"FASTEST",4354:"NICEST",5120:"BYTE",5121:"UNSIGNED_BYTE",5122:"SHORT",5123:"UNSIGNED_SHORT",5124:"INT",5125:"UNSIGNED_INT",5126:"FLOAT",5386:"INVERT",5890:"TEXTURE",6401:"STENCIL_INDEX",6402:"DEPTH_COMPONENT",6406:"ALPHA",6407:"RGB",6408:"RGBA",6409:"LUMINANCE",6410:"LUMINANCE_ALPHA",7680:"KEEP",7681:"REPLACE",7682:"INCR",7683:"DECR",7936:"VENDOR",7937:"RENDERER",7938:"VERSION",9728:"NEAREST",9729:"LINEAR",9984:"NEAREST_MIPMAP_NEAREST",9985:"LINEAR_MIPMAP_NEAREST",9986:"NEAREST_MIPMAP_LINEAR",9987:"LINEAR_MIPMAP_LINEAR",10240:"TEXTURE_MAG_FILTER",10241:"TEXTURE_MIN_FILTER",10242:"TEXTURE_WRAP_S",10243:"TEXTURE_WRAP_T",10497:"REPEAT",10752:"POLYGON_OFFSET_UNITS",16384:"COLOR_BUFFER_BIT",32769:"CONSTANT_COLOR",32770:"ONE_MINUS_CONSTANT_COLOR",32771:"CONSTANT_ALPHA",32772:"ONE_MINUS_CONSTANT_ALPHA",32773:"BLEND_COLOR",32774:"FUNC_ADD",32777:"BLEND_EQUATION_RGB",32778:"FUNC_SUBTRACT",32779:"FUNC_REVERSE_SUBTRACT",32819:"UNSIGNED_SHORT_4_4_4_4",32820:"UNSIGNED_SHORT_5_5_5_1",32823:"POLYGON_OFFSET_FILL",32824:"POLYGON_OFFSET_FACTOR",32854:"RGBA4",32855:"RGB5_A1",32873:"TEXTURE_BINDING_2D",32926:"SAMPLE_ALPHA_TO_COVERAGE",32928:"SAMPLE_COVERAGE",32936:"SAMPLE_BUFFERS",32937:"SAMPLES",32938:"SAMPLE_COVERAGE_VALUE",32939:"SAMPLE_COVERAGE_INVERT",32968:"BLEND_DST_RGB",32969:"BLEND_SRC_RGB",32970:"BLEND_DST_ALPHA",32971:"BLEND_SRC_ALPHA",33071:"CLAMP_TO_EDGE",33170:"GENERATE_MIPMAP_HINT",33189:"DEPTH_COMPONENT16",33306:"DEPTH_STENCIL_ATTACHMENT",33635:"UNSIGNED_SHORT_5_6_5",33648:"MIRRORED_REPEAT",33901:"ALIASED_POINT_SIZE_RANGE",33902:"ALIASED_LINE_WIDTH_RANGE",33984:"TEXTURE0",33985:"TEXTURE1",33986:"TEXTURE2",33987:"TEXTURE3",33988:"TEXTURE4",33989:"TEXTURE5",33990:"TEXTURE6",33991:"TEXTURE7",33992:"TEXTURE8",33993:"TEXTURE9",33994:"TEXTURE10",33995:"TEXTURE11",33996:"TEXTURE12",33997:"TEXTURE13",33998:"TEXTURE14",33999:"TEXTURE15",34e3:"TEXTURE16",34001:"TEXTURE17",34002:"TEXTURE18",34003:"TEXTURE19",34004:"TEXTURE20",34005:"TEXTURE21",34006:"TEXTURE22",34007:"TEXTURE23",34008:"TEXTURE24",34009:"TEXTURE25",34010:"TEXTURE26",34011:"TEXTURE27",34012:"TEXTURE28",34013:"TEXTURE29",34014:"TEXTURE30",34015:"TEXTURE31",34016:"ACTIVE_TEXTURE",34024:"MAX_RENDERBUFFER_SIZE",34041:"DEPTH_STENCIL",34055:"INCR_WRAP",34056:"DECR_WRAP",34067:"TEXTURE_CUBE_MAP",34068:"TEXTURE_BINDING_CUBE_MAP",34069:"TEXTURE_CUBE_MAP_POSITIVE_X",34070:"TEXTURE_CUBE_MAP_NEGATIVE_X",34071:"TEXTURE_CUBE_MAP_POSITIVE_Y",34072:"TEXTURE_CUBE_MAP_NEGATIVE_Y",34073:"TEXTURE_CUBE_MAP_POSITIVE_Z",34074:"TEXTURE_CUBE_MAP_NEGATIVE_Z",34076:"MAX_CUBE_MAP_TEXTURE_SIZE",34338:"VERTEX_ATTRIB_ARRAY_ENABLED",34339:"VERTEX_ATTRIB_ARRAY_SIZE",34340:"VERTEX_ATTRIB_ARRAY_STRIDE",34341:"VERTEX_ATTRIB_ARRAY_TYPE",34342:"CURRENT_VERTEX_ATTRIB",34373:"VERTEX_ATTRIB_ARRAY_POINTER",34466:"NUM_COMPRESSED_TEXTURE_FORMATS",34467:"COMPRESSED_TEXTURE_FORMATS",34660:"BUFFER_SIZE",34661:"BUFFER_USAGE",34816:"STENCIL_BACK_FUNC",34817:"STENCIL_BACK_FAIL",34818:"STENCIL_BACK_PASS_DEPTH_FAIL",34819:"STENCIL_BACK_PASS_DEPTH_PASS",34877:"BLEND_EQUATION_ALPHA",34921:"MAX_VERTEX_ATTRIBS",34922:"VERTEX_ATTRIB_ARRAY_NORMALIZED",34930:"MAX_TEXTURE_IMAGE_UNITS",34962:"ARRAY_BUFFER",34963:"ELEMENT_ARRAY_BUFFER",34964:"ARRAY_BUFFER_BINDING",34965:"ELEMENT_ARRAY_BUFFER_BINDING",34975:"VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",35040:"STREAM_DRAW",35044:"STATIC_DRAW",35048:"DYNAMIC_DRAW",35632:"FRAGMENT_SHADER",35633:"VERTEX_SHADER",35660:"MAX_VERTEX_TEXTURE_IMAGE_UNITS",35661:"MAX_COMBINED_TEXTURE_IMAGE_UNITS",35663:"SHADER_TYPE",35664:"FLOAT_VEC2",35665:"FLOAT_VEC3",35666:"FLOAT_VEC4",35667:"INT_VEC2",35668:"INT_VEC3",35669:"INT_VEC4",35670:"BOOL",35671:"BOOL_VEC2",35672:"BOOL_VEC3",35673:"BOOL_VEC4",35674:"FLOAT_MAT2",35675:"FLOAT_MAT3",35676:"FLOAT_MAT4",35678:"SAMPLER_2D",35680:"SAMPLER_CUBE",35712:"DELETE_STATUS",35713:"COMPILE_STATUS",35714:"LINK_STATUS",35715:"VALIDATE_STATUS",35716:"INFO_LOG_LENGTH",35717:"ATTACHED_SHADERS",35718:"ACTIVE_UNIFORMS",35719:"ACTIVE_UNIFORM_MAX_LENGTH",35720:"SHADER_SOURCE_LENGTH",35721:"ACTIVE_ATTRIBUTES",35722:"ACTIVE_ATTRIBUTE_MAX_LENGTH",35724:"SHADING_LANGUAGE_VERSION",35725:"CURRENT_PROGRAM",36003:"STENCIL_BACK_REF",36004:"STENCIL_BACK_VALUE_MASK",36005:"STENCIL_BACK_WRITEMASK",36006:"FRAMEBUFFER_BINDING",36007:"RENDERBUFFER_BINDING",36048:"FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",36049:"FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",36050:"FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",36051:"FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",36053:"FRAMEBUFFER_COMPLETE",36054:"FRAMEBUFFER_INCOMPLETE_ATTACHMENT",36055:"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",36057:"FRAMEBUFFER_INCOMPLETE_DIMENSIONS",36061:"FRAMEBUFFER_UNSUPPORTED",36064:"COLOR_ATTACHMENT0",36096:"DEPTH_ATTACHMENT",36128:"STENCIL_ATTACHMENT",36160:"FRAMEBUFFER",36161:"RENDERBUFFER",36162:"RENDERBUFFER_WIDTH",36163:"RENDERBUFFER_HEIGHT",36164:"RENDERBUFFER_INTERNAL_FORMAT",36168:"STENCIL_INDEX8",36176:"RENDERBUFFER_RED_SIZE",36177:"RENDERBUFFER_GREEN_SIZE",36178:"RENDERBUFFER_BLUE_SIZE",36179:"RENDERBUFFER_ALPHA_SIZE",36180:"RENDERBUFFER_DEPTH_SIZE",36181:"RENDERBUFFER_STENCIL_SIZE",36194:"RGB565",36336:"LOW_FLOAT",36337:"MEDIUM_FLOAT",36338:"HIGH_FLOAT",36339:"LOW_INT",36340:"MEDIUM_INT",36341:"HIGH_INT",36346:"SHADER_COMPILER",36347:"MAX_VERTEX_UNIFORM_VECTORS",36348:"MAX_VARYING_VECTORS",36349:"MAX_FRAGMENT_UNIFORM_VECTORS",37440:"UNPACK_FLIP_Y_WEBGL",37441:"UNPACK_PREMULTIPLY_ALPHA_WEBGL",37442:"CONTEXT_LOST_WEBGL",37443:"UNPACK_COLORSPACE_CONVERSION_WEBGL",37444:"BROWSER_DEFAULT_WEBGL"}},5171:function(t,e,r){var n=r(737);t.exports=function(t){return n[t]}},9165:function(t,e,r){t.exports=function(t){var e=t.gl,r=n(e),o=i(e,[{buffer:r,type:e.FLOAT,size:3,offset:0,stride:40},{buffer:r,type:e.FLOAT,size:4,offset:12,stride:40},{buffer:r,type:e.FLOAT,size:3,offset:28,stride:40}]),l=a(e);l.attributes.position.location=0,l.attributes.color.location=1,l.attributes.offset.location=2;var c=new s(e,r,o,l);return c.update(t),c};var n=r(2762),i=r(8116),a=r(3436),o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function s(t,e,r,n){this.gl=t,this.shader=n,this.buffer=e,this.vao=r,this.pixelRatio=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lineWidth=[1,1,1],this.capSize=[10,10,10],this.lineCount=[0,0,0],this.lineOffset=[0,0,0],this.opacity=1,this.hasAlpha=!1}var l=s.prototype;function c(t,e){for(var r=0;r<3;++r)t[0][r]=Math.min(t[0][r],e[r]),t[1][r]=Math.max(t[1][r],e[r])}l.isOpaque=function(){return!this.hasAlpha},l.isTransparent=function(){return this.hasAlpha},l.drawTransparent=l.draw=function(t){var e=this.gl,r=this.shader.uniforms;this.shader.bind();var n=r.view=t.view||o,i=r.projection=t.projection||o;r.model=t.model||o,r.clipBounds=this.clipBounds,r.opacity=this.opacity;var a=n[12],s=n[13],l=n[14],c=n[15],u=(t._ortho?2:1)*this.pixelRatio*(i[3]*a+i[7]*s+i[11]*l+i[15]*c)/e.drawingBufferHeight;this.vao.bind();for(var h=0;h<3;++h)e.lineWidth(this.lineWidth[h]*this.pixelRatio),r.capSize=this.capSize[h]*u,this.lineCount[h]&&e.drawArrays(e.LINES,this.lineOffset[h],this.lineCount[h]);this.vao.unbind()};var u=function(){for(var t=new Array(3),e=0;e<3;++e){for(var r=[],n=1;n<=2;++n)for(var i=-1;i<=1;i+=2){var a=[0,0,0];a[(n+e)%3]=i,r.push(a)}t[e]=r}return t}();function h(t,e,r,n){for(var i=u[n],a=0;a0&&((f=u.slice())[s]+=d[1][s],i.push(u[0],u[1],u[2],m[0],m[1],m[2],m[3],0,0,0,f[0],f[1],f[2],m[0],m[1],m[2],m[3],0,0,0),c(this.bounds,f),o+=2+h(i,f,m,s)))}this.lineCount[s]=o-this.lineOffset[s]}this.buffer.update(i)}},l.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()}},3436:function(t,e,r){var n=r(3236),i=r(9405),a=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position, offset;\nattribute vec4 color;\nuniform mat4 model, view, projection;\nuniform float capSize;\nvarying vec4 fragColor;\nvarying vec3 fragPosition;\n\nvoid main() {\n vec4 worldPosition = model * vec4(position, 1.0);\n worldPosition = (worldPosition / worldPosition.w) + vec4(capSize * offset, 0.0);\n gl_Position = projection * (view * worldPosition);\n fragColor = color;\n fragPosition = position;\n}"]),o=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float opacity;\nvarying vec3 fragPosition;\nvarying vec4 fragColor;\n\nvoid main() {\n if (\n outOfRange(clipBounds[0], clipBounds[1], fragPosition) ||\n fragColor.a * opacity == 0.\n ) discard;\n\n gl_FragColor = opacity * fragColor;\n}"]);t.exports=function(t){return i(t,a,o,null,[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"offset",type:"vec3"}])}},2260:function(t,e,r){var n=r(7766);t.exports=function(t,e,r,n){i||(i=t.FRAMEBUFFER_UNSUPPORTED,a=t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT,o=t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS,s=t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT);var c=t.getExtension("WEBGL_draw_buffers");if(!l&&c&&function(t,e){var r=t.getParameter(e.MAX_COLOR_ATTACHMENTS_WEBGL);l=new Array(r+1);for(var n=0;n<=r;++n){for(var i=new Array(r),a=0;au||r<0||r>u)throw new Error("gl-fbo: Parameters are too large for FBO");var h=1;if("color"in(n=n||{})){if((h=Math.max(0|n.color,0))<0)throw new Error("gl-fbo: Must specify a nonnegative number of colors");if(h>1){if(!c)throw new Error("gl-fbo: Multiple draw buffer extension not supported");if(h>t.getParameter(c.MAX_COLOR_ATTACHMENTS_WEBGL))throw new Error("gl-fbo: Context does not support "+h+" draw buffers")}}var p=t.UNSIGNED_BYTE,f=t.getExtension("OES_texture_float");if(n.float&&h>0){if(!f)throw new Error("gl-fbo: Context does not support floating point textures");p=t.FLOAT}else n.preferFloat&&h>0&&f&&(p=t.FLOAT);var m=!0;"depth"in n&&(m=!!n.depth);var g=!1;return"stencil"in n&&(g=!!n.stencil),new d(t,e,r,p,h,m,g,c)};var i,a,o,s,l=null;function c(t){return[t.getParameter(t.FRAMEBUFFER_BINDING),t.getParameter(t.RENDERBUFFER_BINDING),t.getParameter(t.TEXTURE_BINDING_2D)]}function u(t,e){t.bindFramebuffer(t.FRAMEBUFFER,e[0]),t.bindRenderbuffer(t.RENDERBUFFER,e[1]),t.bindTexture(t.TEXTURE_2D,e[2])}function h(t){switch(t){case i:throw new Error("gl-fbo: Framebuffer unsupported");case a:throw new Error("gl-fbo: Framebuffer incomplete attachment");case o:throw new Error("gl-fbo: Framebuffer incomplete dimensions");case s:throw new Error("gl-fbo: Framebuffer incomplete missing attachment");default:throw new Error("gl-fbo: Framebuffer failed for unspecified reason")}}function p(t,e,r,i,a,o){if(!i)return null;var s=n(t,e,r,a,i);return s.magFilter=t.NEAREST,s.minFilter=t.NEAREST,s.mipSamples=1,s.bind(),t.framebufferTexture2D(t.FRAMEBUFFER,o,t.TEXTURE_2D,s.handle,0),s}function f(t,e,r,n,i){var a=t.createRenderbuffer();return t.bindRenderbuffer(t.RENDERBUFFER,a),t.renderbufferStorage(t.RENDERBUFFER,n,e,r),t.framebufferRenderbuffer(t.FRAMEBUFFER,i,t.RENDERBUFFER,a),a}function d(t,e,r,n,i,a,o,s){this.gl=t,this._shape=[0|e,0|r],this._destroyed=!1,this._ext=s,this.color=new Array(i);for(var d=0;d1&&s.drawBuffersWEBGL(l[o]);var v=r.getExtension("WEBGL_depth_texture");v?d?t.depth=p(r,i,a,v.UNSIGNED_INT_24_8_WEBGL,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):m&&(t.depth=p(r,i,a,r.UNSIGNED_SHORT,r.DEPTH_COMPONENT,r.DEPTH_ATTACHMENT)):m&&d?t._depth_rb=f(r,i,a,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):m?t._depth_rb=f(r,i,a,r.DEPTH_COMPONENT16,r.DEPTH_ATTACHMENT):d&&(t._depth_rb=f(r,i,a,r.STENCIL_INDEX,r.STENCIL_ATTACHMENT));var x=r.checkFramebufferStatus(r.FRAMEBUFFER);if(x!==r.FRAMEBUFFER_COMPLETE){for(t._destroyed=!0,r.bindFramebuffer(r.FRAMEBUFFER,null),r.deleteFramebuffer(t.handle),t.handle=null,t.depth&&(t.depth.dispose(),t.depth=null),t._depth_rb&&(r.deleteRenderbuffer(t._depth_rb),t._depth_rb=null),y=0;yi||r<0||r>i)throw new Error("gl-fbo: Can't resize FBO, invalid dimensions");t._shape[0]=e,t._shape[1]=r;for(var a=c(n),o=0;o max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform sampler2D dashTexture;\nuniform float dashScale;\nuniform float opacity;\n\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\nvarying vec4 fragColor;\n\nvoid main() {\n if (\n outOfRange(clipBounds[0], clipBounds[1], worldPosition) ||\n fragColor.a * opacity == 0.\n ) discard;\n\n float dashWeight = texture2D(dashTexture, vec2(dashScale * pixelArcLength, 0)).r;\n if(dashWeight < 0.5) {\n discard;\n }\n gl_FragColor = fragColor * opacity;\n}\n"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\n#define FLOAT_MAX 1.70141184e38\n#define FLOAT_MIN 1.17549435e-38\n\n// https://github.com/mikolalysenko/glsl-read-float/blob/master/index.glsl\nvec4 packFloat(float v) {\n float av = abs(v);\n\n //Handle special cases\n if(av < FLOAT_MIN) {\n return vec4(0.0, 0.0, 0.0, 0.0);\n } else if(v > FLOAT_MAX) {\n return vec4(127.0, 128.0, 0.0, 0.0) / 255.0;\n } else if(v < -FLOAT_MAX) {\n return vec4(255.0, 128.0, 0.0, 0.0) / 255.0;\n }\n\n vec4 c = vec4(0,0,0,0);\n\n //Compute exponent and mantissa\n float e = floor(log2(av));\n float m = av * pow(2.0, -e) - 1.0;\n\n //Unpack mantissa\n c[1] = floor(128.0 * m);\n m -= c[1] / 128.0;\n c[2] = floor(32768.0 * m);\n m -= c[2] / 32768.0;\n c[3] = floor(8388608.0 * m);\n\n //Unpack exponent\n float ebias = e + 127.0;\n c[0] = floor(ebias / 2.0);\n ebias -= c[0] * 2.0;\n c[1] += floor(ebias) * 128.0;\n\n //Unpack sign bit\n c[0] += 128.0 * step(0.0, -v);\n\n //Scale back to range\n return c / 255.0;\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform float pickId;\nuniform vec3 clipBounds[2];\n\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\nvarying vec4 fragColor;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], worldPosition)) discard;\n\n gl_FragColor = vec4(pickId/255.0, packFloat(pixelArcLength).xyz);\n}"]),l=[{name:"position",type:"vec3"},{name:"nextPosition",type:"vec3"},{name:"arcLength",type:"float"},{name:"lineWidth",type:"float"},{name:"color",type:"vec4"}];e.createShader=function(t){return i(t,a,o,null,l)},e.createPickShader=function(t){return i(t,a,s,null,l)}},5714:function(t,e,r){t.exports=function(t){var e=t.gl||t.scene&&t.scene.gl,r=h(e);r.attributes.position.location=0,r.attributes.nextPosition.location=1,r.attributes.arcLength.location=2,r.attributes.lineWidth.location=3,r.attributes.color.location=4;var o=p(e);o.attributes.position.location=0,o.attributes.nextPosition.location=1,o.attributes.arcLength.location=2,o.attributes.lineWidth.location=3,o.attributes.color.location=4;for(var s=n(e),l=i(e,[{buffer:s,size:3,offset:0,stride:48},{buffer:s,size:3,offset:12,stride:48},{buffer:s,size:1,offset:24,stride:48},{buffer:s,size:1,offset:28,stride:48},{buffer:s,size:4,offset:32,stride:48}]),u=c(new Array(1024),[256,1,4]),f=0;f<1024;++f)u.data[f]=255;var d=a(e,u);d.wrap=e.REPEAT;var m=new y(e,r,o,s,l,d);return m.update(t),m};var n=r(2762),i=r(8116),a=r(7766),o=new Uint8Array(4),s=new Float32Array(o.buffer),l=r(2478),c=r(9618),u=r(7319),h=u.createShader,p=u.createPickShader,f=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function d(t,e){for(var r=0,n=0;n<3;++n){var i=t[n]-e[n];r+=i*i}return Math.sqrt(r)}function m(t){for(var e=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],r=0;r<3;++r)e[0][r]=Math.max(t[0][r],e[0][r]),e[1][r]=Math.min(t[1][r],e[1][r]);return e}function g(t,e,r,n){this.arcLength=t,this.position=e,this.index=r,this.dataCoordinate=n}function y(t,e,r,n,i,a){this.gl=t,this.shader=e,this.pickShader=r,this.buffer=n,this.vao=i,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.points=[],this.arcLength=[],this.vertexCount=0,this.bounds=[[0,0,0],[0,0,0]],this.pickId=0,this.lineWidth=1,this.texture=a,this.dashScale=1,this.opacity=1,this.hasAlpha=!1,this.dirty=!0,this.pixelRatio=1}var v=y.prototype;v.isTransparent=function(){return this.hasAlpha},v.isOpaque=function(){return!this.hasAlpha},v.pickSlots=1,v.setPickBase=function(t){this.pickId=t},v.drawTransparent=v.draw=function(t){if(this.vertexCount){var e=this.gl,r=this.shader,n=this.vao;r.bind(),r.uniforms={model:t.model||f,view:t.view||f,projection:t.projection||f,clipBounds:m(this.clipBounds),dashTexture:this.texture.bind(),dashScale:this.dashScale/this.arcLength[this.arcLength.length-1],opacity:this.opacity,screenShape:[e.drawingBufferWidth,e.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(e.TRIANGLE_STRIP,this.vertexCount),n.unbind()}},v.drawPick=function(t){if(this.vertexCount){var e=this.gl,r=this.pickShader,n=this.vao;r.bind(),r.uniforms={model:t.model||f,view:t.view||f,projection:t.projection||f,pickId:this.pickId,clipBounds:m(this.clipBounds),screenShape:[e.drawingBufferWidth,e.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(e.TRIANGLE_STRIP,this.vertexCount),n.unbind()}},v.update=function(t){var e,r;this.dirty=!0;var n=!!t.connectGaps;"dashScale"in t&&(this.dashScale=t.dashScale),this.hasAlpha=!1,"opacity"in t&&(this.opacity=+t.opacity,this.opacity<1&&(this.hasAlpha=!0));var i=[],a=[],o=[],s=0,u=0,h=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],p=t.position||t.positions;if(p){var f=t.color||t.colors||[0,0,0,1],m=t.lineWidth||1,g=!1;t:for(e=1;e0){for(var w=0;w<24;++w)i.push(i[i.length-12]);u+=2,g=!0}continue t}h[0][r]=Math.min(h[0][r],_[r],b[r]),h[1][r]=Math.max(h[1][r],_[r],b[r])}Array.isArray(f[0])?(y=f.length>e-1?f[e-1]:f.length>0?f[f.length-1]:[0,0,0,1],v=f.length>e?f[e]:f.length>0?f[f.length-1]:[0,0,0,1]):y=v=f,3===y.length&&(y=[y[0],y[1],y[2],1]),3===v.length&&(v=[v[0],v[1],v[2],1]),!this.hasAlpha&&y[3]<1&&(this.hasAlpha=!0),x=Array.isArray(m)?m.length>e-1?m[e-1]:m.length>0?m[m.length-1]:[0,0,0,1]:m;var T=s;if(s+=d(_,b),g){for(r=0;r<2;++r)i.push(_[0],_[1],_[2],b[0],b[1],b[2],T,x,y[0],y[1],y[2],y[3]);u+=2,g=!1}i.push(_[0],_[1],_[2],b[0],b[1],b[2],T,x,y[0],y[1],y[2],y[3],_[0],_[1],_[2],b[0],b[1],b[2],T,-x,y[0],y[1],y[2],y[3],b[0],b[1],b[2],_[0],_[1],_[2],s,-x,v[0],v[1],v[2],v[3],b[0],b[1],b[2],_[0],_[1],_[2],s,x,v[0],v[1],v[2],v[3]),u+=4}}if(this.buffer.update(i),a.push(s),o.push(p[p.length-1].slice()),this.bounds=h,this.vertexCount=u,this.points=o,this.arcLength=a,"dashes"in t){var A=t.dashes.slice();for(A.unshift(0),e=1;e1.0001)return null;y+=g[h]}return Math.abs(y-1)>.001?null:[p,s(t,g),g]}},840:function(t,e,r){var n=r(3236),i=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position, normal;\nattribute vec4 color;\nattribute vec2 uv;\n\nuniform mat4 model\n , view\n , projection\n , inverseModel;\nuniform vec3 eyePosition\n , lightPosition;\n\nvarying vec3 f_normal\n , f_lightDirection\n , f_eyeDirection\n , f_data;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvec4 project(vec3 p) {\n return projection * (view * (model * vec4(p, 1.0)));\n}\n\nvoid main() {\n gl_Position = project(position);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * vec4(position , 1.0);\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n f_color = color;\n f_data = position;\n f_uv = uv;\n}\n"]),a=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\nfloat cookTorranceSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness,\n float fresnel) {\n\n float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);\n float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);\n\n //Half angle vector\n vec3 H = normalize(lightDirection + viewDirection);\n\n //Geometric term\n float NdotH = max(dot(surfaceNormal, H), 0.0);\n float VdotH = max(dot(viewDirection, H), 0.000001);\n float LdotH = max(dot(lightDirection, H), 0.000001);\n float G1 = (2.0 * NdotH * VdotN) / VdotH;\n float G2 = (2.0 * NdotH * LdotN) / LdotH;\n float G = min(1.0, min(G1, G2));\n \n //Distribution term\n float D = beckmannDistribution(NdotH, roughness);\n\n //Fresnel term\n float F = pow(1.0 - VdotN, fresnel);\n\n //Multiply terms and done\n return G * F * D / max(3.14159265 * VdotN, 0.000001);\n}\n\n//#pragma glslify: beckmann = require(glsl-specular-beckmann) // used in gl-surface3d\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness\n , fresnel\n , kambient\n , kdiffuse\n , kspecular;\nuniform sampler2D texture;\n\nvarying vec3 f_normal\n , f_lightDirection\n , f_eyeDirection\n , f_data;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (f_color.a == 0.0 ||\n outOfRange(clipBounds[0], clipBounds[1], f_data)\n ) discard;\n\n vec3 N = normalize(f_normal);\n vec3 L = normalize(f_lightDirection);\n vec3 V = normalize(f_eyeDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));\n //float specular = max(0.0, beckmann(L, V, N, roughness)); // used in gl-surface3d\n\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = vec4(f_color.rgb, 1.0) * texture2D(texture, f_uv);\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = litColor * f_color.a;\n}\n"]),o=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 uv;\n\nuniform mat4 model, view, projection;\n\nvarying vec4 f_color;\nvarying vec3 f_data;\nvarying vec2 f_uv;\n\nvoid main() {\n gl_Position = projection * (view * (model * vec4(position, 1.0)));\n f_color = color;\n f_data = position;\n f_uv = uv;\n}"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform sampler2D texture;\nuniform float opacity;\n\nvarying vec4 f_color;\nvarying vec3 f_data;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_data)) discard;\n\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}"]),l=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 uv;\nattribute float pointSize;\n\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0.0, 0.0 ,0.0 ,0.0);\n } else {\n gl_Position = projection * (view * (model * vec4(position, 1.0)));\n }\n gl_PointSize = pointSize;\n f_color = color;\n f_uv = uv;\n}"]),c=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D texture;\nuniform float opacity;\n\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n vec2 pointR = gl_PointCoord.xy - vec2(0.5, 0.5);\n if(dot(pointR, pointR) > 0.25) {\n discard;\n }\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}"]),u=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n gl_Position = projection * (view * (model * vec4(position, 1.0)));\n f_id = id;\n f_position = position;\n}"]),h=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]),p=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute float pointSize;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0.0, 0.0, 0.0, 0.0);\n } else {\n gl_Position = projection * (view * (model * vec4(position, 1.0)));\n gl_PointSize = pointSize;\n }\n f_id = id;\n f_position = position;\n}"]),f=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\n\nuniform mat4 model, view, projection;\n\nvoid main() {\n gl_Position = projection * (view * (model * vec4(position, 1.0)));\n}"]),d=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec3 contourColor;\n\nvoid main() {\n gl_FragColor = vec4(contourColor, 1.0);\n}\n"]);e.meshShader={vertex:i,fragment:a,attributes:[{name:"position",type:"vec3"},{name:"normal",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},e.wireShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},e.pointShader={vertex:l,fragment:c,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"pointSize",type:"float"}]},e.pickShader={vertex:u,fragment:h,attributes:[{name:"position",type:"vec3"},{name:"id",type:"vec4"}]},e.pointPickShader={vertex:p,fragment:h,attributes:[{name:"position",type:"vec3"},{name:"pointSize",type:"float"},{name:"id",type:"vec4"}]},e.contourShader={vertex:f,fragment:d,attributes:[{name:"position",type:"vec3"}]}},7201:function(t,e,r){var n=r(9405),i=r(2762),a=r(8116),o=r(7766),s=r(8406),l=r(6760),c=r(7608),u=r(9618),h=r(6729),p=r(7765),f=r(1888),d=r(840),m=r(7626),g=d.meshShader,y=d.wireShader,v=d.pointShader,x=d.pickShader,_=d.pointPickShader,b=d.contourShader,w=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function T(t,e,r,n,i,a,o,s,l,c,u,h,p,f,d,m,g,y,v,x,_,b,T,A,k,M,S){this.gl=t,this.pixelRatio=1,this.cells=[],this.positions=[],this.intensity=[],this.texture=e,this.dirty=!0,this.triShader=r,this.lineShader=n,this.pointShader=i,this.pickShader=a,this.pointPickShader=o,this.contourShader=s,this.trianglePositions=l,this.triangleColors=u,this.triangleNormals=p,this.triangleUVs=h,this.triangleIds=c,this.triangleVAO=f,this.triangleCount=0,this.lineWidth=1,this.edgePositions=d,this.edgeColors=g,this.edgeUVs=y,this.edgeIds=m,this.edgeVAO=v,this.edgeCount=0,this.pointPositions=x,this.pointColors=b,this.pointUVs=T,this.pointSizes=A,this.pointIds=_,this.pointVAO=k,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=M,this.contourVAO=S,this.contourCount=0,this.contourColor=[0,0,0],this.contourEnable=!0,this.pickVertex=!0,this.pickId=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lightPosition=[1e5,1e5,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.opacity=1,this.hasAlpha=!1,this.opacityscale=!1,this._model=w,this._view=w,this._projection=w,this._resolution=[1,1]}var A=T.prototype;function k(t,e){if(!e||!e.length)return 1;for(var r=0;rt&&r>0){var n=(e[r][0]-t)/(e[r][0]-e[r-1][0]);return e[r][1]*(1-n)+n*e[r-1][1]}}return 1}A.isOpaque=function(){return!this.hasAlpha},A.isTransparent=function(){return this.hasAlpha},A.pickSlots=1,A.setPickBase=function(t){this.pickId=t},A.highlight=function(t){if(t&&this.contourEnable){for(var e=p(this.cells,this.intensity,t.intensity),r=e.cells,n=e.vertexIds,i=e.vertexWeights,a=r.length,o=f.mallocFloat32(6*a),s=0,l=0;l0&&((u=this.triShader).bind(),u.uniforms=s,this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()),this.edgeCount>0&&this.lineWidth>0&&((u=this.lineShader).bind(),u.uniforms=s,this.edgeVAO.bind(),e.lineWidth(this.lineWidth*this.pixelRatio),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0&&((u=this.pointShader).bind(),u.uniforms=s,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind()),this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0&&((u=this.contourShader).bind(),u.uniforms=s,this.contourVAO.bind(),e.drawArrays(e.LINES,0,this.contourCount),this.contourVAO.unbind())},A.drawPick=function(t){t=t||{};for(var e=this.gl,r=t.model||w,n=t.view||w,i=t.projection||w,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);this._model=[].slice.call(r),this._view=[].slice.call(n),this._projection=[].slice.call(i),this._resolution=[e.drawingBufferWidth,e.drawingBufferHeight];var s,l={model:r,view:n,projection:i,clipBounds:a,pickId:this.pickId/255};(s=this.pickShader).bind(),s.uniforms=l,this.triangleCount>0&&(this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()),this.edgeCount>0&&(this.edgeVAO.bind(),e.lineWidth(this.lineWidth*this.pixelRatio),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0&&((s=this.pointPickShader).bind(),s.uniforms=l,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind())},A.pick=function(t){if(!t||t.id!==this.pickId)return null;for(var e=t.value[0]+256*t.value[1]+65536*t.value[2],r=this.cells[e],n=this.positions,i=new Array(r.length),a=0;aMath.abs(e))c.rotate(a,0,0,-t*r*Math.PI*d.rotateSpeed/window.innerWidth);else if(!d._ortho){var o=-d.zoomSpeed*i*e/window.innerHeight*(a-c.lastT())/20;c.pan(a,0,0,h*(Math.exp(o)-1))}}}),!0)},d.enableMouseListeners(),d};var n=r(3025),i=r(6296),a=r(351),o=r(8512),s=r(24),l=r(7520)},799:function(t,e,r){var n=r(3236),i=r(9405),a=n(["precision mediump float;\n#define GLSLIFY 1\nattribute vec2 position;\nvarying vec2 uv;\nvoid main() {\n uv = position;\n gl_Position = vec4(position, 0, 1);\n}"]),o=n(["precision mediump float;\n#define GLSLIFY 1\n\nuniform sampler2D accumBuffer;\nvarying vec2 uv;\n\nvoid main() {\n vec4 accum = texture2D(accumBuffer, 0.5 * (uv + 1.0));\n gl_FragColor = min(vec4(1,1,1,1), accum);\n}"]);t.exports=function(t){return i(t,a,o,null,[{name:"position",type:"vec2"}])}},4100:function(t,e,r){var n=r(4437),i=r(3837),a=r(5445),o=r(4449),s=r(3589),l=r(2260),c=r(7169),u=r(351),h=r(4772),p=r(4040),f=r(799),d=r(9216)({tablet:!0,featureDetect:!0});function m(){this.mouse=[-1,-1],this.screen=null,this.distance=1/0,this.index=null,this.dataCoordinate=null,this.dataPosition=null,this.object=null,this.data=null}function g(t){var e=Math.round(Math.log(Math.abs(t))/Math.log(10));if(e<0){var r=Math.round(Math.pow(10,-e));return Math.ceil(t*r)/r}return e>0?(r=Math.round(Math.pow(10,e)),Math.ceil(t/r)*r):Math.ceil(t)}function y(t){return"boolean"!=typeof t||t}t.exports={createScene:function(t){(t=t||{}).camera=t.camera||{};var e=t.canvas;e||(e=document.createElement("canvas"),t.container?t.container.appendChild(e):document.body.appendChild(e));var r=t.gl;if(r||(t.glOptions&&(d=!!t.glOptions.preserveDrawingBuffer),r=function(t,e){var r=null;try{(r=t.getContext("webgl",e))||(r=t.getContext("experimental-webgl",e))}catch{return null}return r}(e,t.glOptions||{premultipliedAlpha:!0,antialias:!0,preserveDrawingBuffer:d})),!r)throw new Error("webgl not supported");var v=t.bounds||[[-10,-10,-10],[10,10,10]],x=new m,_=l(r,r.drawingBufferWidth,r.drawingBufferHeight,{preferFloat:!d}),b=f(r),w=t.cameraObject&&!0===t.cameraObject._ortho||t.camera.projection&&"orthographic"===t.camera.projection.type||!1,T={eye:t.camera.eye||[2,0,0],center:t.camera.center||[0,0,0],up:t.camera.up||[0,1,0],zoomMin:t.camera.zoomMax||.1,zoomMax:t.camera.zoomMin||100,mode:t.camera.mode||"turntable",_ortho:w},A=t.axes||{},k=i(r,A);k.enable=!A.disable;var M=t.spikes||{},S=o(r,M),E=[],C=[],I=[],L=[],P=!0,z=!0,D={view:null,projection:new Array(16),model:new Array(16),_ortho:!1},O=(z=!0,[r.drawingBufferWidth,r.drawingBufferHeight]),R=t.cameraObject||n(e,T),F={gl:r,contextLost:!1,pixelRatio:t.pixelRatio||1,canvas:e,selection:x,camera:R,axes:k,axesPixels:null,spikes:S,bounds:v,objects:E,shape:O,aspect:t.aspectRatio||[1,1,1],pickRadius:t.pickRadius||10,zNear:t.zNear||.01,zFar:t.zFar||1e3,fovy:t.fovy||Math.PI/4,clearColor:t.clearColor||[0,0,0,0],autoResize:y(t.autoResize),autoBounds:y(t.autoBounds),autoScale:!!t.autoScale,autoCenter:y(t.autoCenter),clipToBounds:y(t.clipToBounds),snapToData:!!t.snapToData,onselect:t.onselect||null,onrender:t.onrender||null,onclick:t.onclick||null,cameraParams:D,oncontextloss:null,mouseListener:null,_stopped:!1,getAspectratio:function(){return{x:this.aspect[0],y:this.aspect[1],z:this.aspect[2]}},setAspectratio:function(t){this.aspect[0]=t.x,this.aspect[1]=t.y,this.aspect[2]=t.z,z=!0},setBounds:function(t,e){this.bounds[0][t]=e.min,this.bounds[1][t]=e.max},setClearColor:function(t){this.clearColor=t},clearRGBA:function(){this.gl.clearColor(this.clearColor[0],this.clearColor[1],this.clearColor[2],this.clearColor[3]),this.gl.clear(this.gl.COLOR_BUFFER_BIT|this.gl.DEPTH_BUFFER_BIT)}},B=[r.drawingBufferWidth/F.pixelRatio|0,r.drawingBufferHeight/F.pixelRatio|0];function j(){if(!F._stopped&&F.autoResize){var t=e.parentNode,r=1,n=1;t&&t!==document.body?(r=t.clientWidth,n=t.clientHeight):(r=window.innerWidth,n=window.innerHeight);var i=0|Math.ceil(r*F.pixelRatio),a=0|Math.ceil(n*F.pixelRatio);if(i!==e.width||a!==e.height){e.width=i,e.height=a;var o=e.style;o.position=o.position||"absolute",o.left="0px",o.top="0px",o.width=r+"px",o.height=n+"px",P=!0}}}function N(){for(var t=E.length,e=L.length,n=0;n0&&0===I[e-1];)I.pop(),L.pop().dispose()}function U(){if(F.contextLost)return!0;r.isContextLost()&&(F.contextLost=!0,F.mouseListener.enabled=!1,F.selection.object=null,F.oncontextloss&&F.oncontextloss())}F.autoResize&&j(),window.addEventListener("resize",j),F.update=function(t){F._stopped||(t=t||{},P=!0,z=!0)},F.add=function(t){F._stopped||(t.axes=k,E.push(t),C.push(-1),P=!0,z=!0,N())},F.remove=function(t){if(!F._stopped){var e=E.indexOf(t);e<0||(E.splice(e,1),C.pop(),P=!0,z=!0,N())}},F.dispose=function(){if(!F._stopped&&(F._stopped=!0,window.removeEventListener("resize",j),e.removeEventListener("webglcontextlost",U),F.mouseListener.enabled=!1,!F.contextLost)){k.dispose(),S.dispose();for(var t=0;tx.distance)continue;for(var c=0;c1e-6?(i=Math.acos(a),o=Math.sin(i),s=Math.sin((1-n)*i)/o,l=Math.sin(n*i)/o):(s=1-n,l=n),t[0]=s*c+l*f,t[1]=s*u+l*d,t[2]=s*h+l*m,t[3]=s*p+l*g,t}},5964:function(t){t.exports=function(t){return t||0===t?t.toString():""}},9366:function(t,e,r){var n=r(4359);t.exports=function(t,e,r){var a=[e.style,e.weight,e.variant,e.family].join("_"),o=i[a];if(o||(o=i[a]={}),t in o)return o[t];var s={textAlign:"center",textBaseline:"middle",lineHeight:1,font:e.family,fontStyle:e.style,fontWeight:e.weight,fontVariant:e.variant,lineSpacing:1.25,styletags:{breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},triangles:!0},l=n(t,s);s.triangles=!1;var c,u,h=n(t,s);if(r&&1!==r){for(c=0;c max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\nuniform vec4 highlightId;\nuniform float highlightScale;\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0,0,0,0);\n } else {\n float scale = 1.0;\n if(distance(highlightId, id) < 0.0001) {\n scale = highlightScale;\n }\n\n vec4 worldPosition = model * vec4(position, 1);\n vec4 viewPosition = view * worldPosition;\n viewPosition = viewPosition / viewPosition.w;\n vec4 clipPosition = projection * (viewPosition + scale * vec4(glyph.x, -glyph.y, 0, 0));\n\n gl_Position = clipPosition;\n interpColor = color;\n pickId = id;\n dataCoordinate = position;\n }\n}"]),o=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform vec2 screenSize;\nuniform vec3 clipBounds[2];\nuniform float highlightScale, pixelRatio;\nuniform vec4 highlightId;\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0,0,0,0);\n } else {\n float scale = pixelRatio;\n if(distance(highlightId.bgr, id.bgr) < 0.001) {\n scale *= highlightScale;\n }\n\n vec4 worldPosition = model * vec4(position, 1.0);\n vec4 viewPosition = view * worldPosition;\n vec4 clipPosition = projection * viewPosition;\n clipPosition /= clipPosition.w;\n\n gl_Position = clipPosition + vec4(screenSize * scale * vec2(glyph.x, -glyph.y), 0.0, 0.0);\n interpColor = color;\n pickId = id;\n dataCoordinate = position;\n }\n}"]),s=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\nuniform float highlightScale;\nuniform vec4 highlightId;\nuniform vec3 axes[2];\nuniform mat4 model, view, projection;\nuniform vec2 screenSize;\nuniform vec3 clipBounds[2];\nuniform float scale, pixelRatio;\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0,0,0,0);\n } else {\n float lscale = pixelRatio * scale;\n if(distance(highlightId, id) < 0.0001) {\n lscale *= highlightScale;\n }\n\n vec4 clipCenter = projection * (view * (model * vec4(position, 1)));\n vec3 dataPosition = position + 0.5*lscale*(axes[0] * glyph.x + axes[1] * glyph.y) * clipCenter.w * screenSize.y;\n vec4 clipPosition = projection * (view * (model * vec4(dataPosition, 1)));\n\n gl_Position = clipPosition;\n interpColor = color;\n pickId = id;\n dataCoordinate = dataPosition;\n }\n}\n"]),l=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 fragClipBounds[2];\nuniform float opacity;\n\nvarying vec4 interpColor;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (\n outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate) ||\n interpColor.a * opacity == 0.\n ) discard;\n gl_FragColor = interpColor * opacity;\n}\n"]),c=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 fragClipBounds[2];\nuniform float pickGroup;\n\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate)) discard;\n\n gl_FragColor = vec4(pickGroup, pickId.bgr);\n}"]),u=[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"glyph",type:"vec2"},{name:"id",type:"vec4"}],h={vertex:a,fragment:l,attributes:u},p={vertex:o,fragment:l,attributes:u},f={vertex:s,fragment:l,attributes:u},d={vertex:a,fragment:c,attributes:u},m={vertex:o,fragment:c,attributes:u},g={vertex:s,fragment:c,attributes:u};function y(t,e){var r=n(t,e),i=r.attributes;return i.position.location=0,i.color.location=1,i.glyph.location=2,i.id.location=3,r}e.createPerspective=function(t){return y(t,h)},e.createOrtho=function(t){return y(t,p)},e.createProject=function(t){return y(t,f)},e.createPickPerspective=function(t){return y(t,d)},e.createPickOrtho=function(t){return y(t,m)},e.createPickProject=function(t){return y(t,g)}},8418:function(t,e,r){var n=r(5219),i=r(2762),a=r(8116),o=r(1888),s=r(6760),l=r(1283),c=r(9366),u=r(5964),h=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],p=ArrayBuffer,f=DataView;function d(t){return Array.isArray(t)||function(t){return p.isView(t)&&!(t instanceof f)}(t)}function m(t,e){var r=t[0],n=t[1],i=t[2],a=t[3];return t[0]=e[0]*r+e[4]*n+e[8]*i+e[12]*a,t[1]=e[1]*r+e[5]*n+e[9]*i+e[13]*a,t[2]=e[2]*r+e[6]*n+e[10]*i+e[14]*a,t[3]=e[3]*r+e[7]*n+e[11]*i+e[15]*a,t}function g(t,e,r,n){return m(n,n),m(n,n),m(n,n)}function y(t,e){this.index=t,this.dataCoordinate=this.position=e}function v(t){return!0===t||t>1?1:t}function x(t,e,r,n,i,a,o,s,l,c,u,h){this.gl=t,this.pixelRatio=1,this.shader=e,this.orthoShader=r,this.projectShader=n,this.pointBuffer=i,this.colorBuffer=a,this.glyphBuffer=o,this.idBuffer=s,this.vao=l,this.vertexCount=0,this.lineVertexCount=0,this.opacity=1,this.hasAlpha=!1,this.lineWidth=0,this.projectScale=[.6666666666666666,.6666666666666666,.6666666666666666],this.projectOpacity=[1,1,1],this.projectHasAlpha=!1,this.pickId=0,this.pickPerspectiveShader=c,this.pickOrthoShader=u,this.pickProjectShader=h,this.points=[],this._selectResult=new y(0,[0,0,0]),this.useOrtho=!0,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.axesProject=[!0,!0,!0],this.axesBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.highlightId=[1,1,1,1],this.highlightScale=2,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.dirty=!0}t.exports=function(t){var e=t.gl,r=l.createPerspective(e),n=l.createOrtho(e),o=l.createProject(e),s=l.createPickPerspective(e),c=l.createPickOrtho(e),u=l.createPickProject(e),h=i(e),p=i(e),f=i(e),d=i(e),m=new x(e,r,n,o,h,p,f,d,a(e,[{buffer:h,size:3,type:e.FLOAT},{buffer:p,size:4,type:e.FLOAT},{buffer:f,size:2,type:e.FLOAT},{buffer:d,size:4,type:e.UNSIGNED_BYTE,normalized:!0}]),s,c,u);return m.update(t),m};var _=x.prototype;_.pickSlots=1,_.setPickBase=function(t){this.pickId=t},_.isTransparent=function(){if(this.hasAlpha)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&this.projectHasAlpha)return!0;return!1},_.isOpaque=function(){if(!this.hasAlpha)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&!this.projectHasAlpha)return!0;return!1};var b=[0,0],w=[0,0,0],T=[0,0,0],A=[0,0,0,1],k=[0,0,0,1],M=h.slice(),S=[0,0,0],E=[[0,0,0],[0,0,0]];function C(t){return t[0]=t[1]=t[2]=0,t}function I(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=1,t}function L(t,e,r,n){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[r]=n,t}var P=[[-1e8,-1e8,-1e8],[1e8,1e8,1e8]];function z(t,e,r,n,i,a,o){var l=r.gl;if((a===r.projectHasAlpha||o)&&function(t,e,r,n){var i,a=e.axesProject,o=e.gl,l=t.uniforms,c=r.model||h,u=r.view||h,p=r.projection||h,f=e.axesBounds,d=function(t){for(var e=E,r=0;r<2;++r)for(var n=0;n<3;++n)e[r][n]=Math.max(Math.min(t[r][n],1e8),-1e8);return e}(e.clipBounds);i=e.axes&&e.axes.lastCubeProps?e.axes.lastCubeProps.axis:[1,1,1],b[0]=2/o.drawingBufferWidth,b[1]=2/o.drawingBufferHeight,t.bind(),l.view=u,l.projection=p,l.screenSize=b,l.highlightId=e.highlightId,l.highlightScale=e.highlightScale,l.clipBounds=d,l.pickGroup=e.pickId/255,l.pixelRatio=n;for(var m=0;m<3;++m)if(a[m]){l.scale=e.projectScale[m],l.opacity=e.projectOpacity[m];for(var y=M,v=0;v<16;++v)y[v]=0;for(v=0;v<4;++v)y[5*v]=1;y[5*m]=0,i[m]<0?y[12+m]=f[0][m]:y[12+m]=f[1][m],s(y,c,y),l.model=y;var x=(m+1)%3,_=(m+2)%3,P=C(w),z=C(T);P[x]=1,z[_]=1;var D=g(0,0,0,I(A,P)),O=g(0,0,0,I(k,z));if(Math.abs(D[1])>Math.abs(O[1])){var R=D;D=O,O=R,R=P,P=z,z=R;var F=x;x=_,_=F}D[0]<0&&(P[x]=-1),O[1]>0&&(z[_]=-1);var B=0,j=0;for(v=0;v<4;++v)B+=Math.pow(c[4*x+v],2),j+=Math.pow(c[4*_+v],2);P[x]/=Math.sqrt(B),z[_]/=Math.sqrt(j),l.axes[0]=P,l.axes[1]=z,l.fragClipBounds[0]=L(S,d[0],m,-1e8),l.fragClipBounds[1]=L(S,d[1],m,1e8),e.vao.bind(),e.vao.draw(o.TRIANGLES,e.vertexCount),e.lineWidth>0&&(o.lineWidth(e.lineWidth*n),e.vao.draw(o.LINES,e.lineVertexCount,e.vertexCount)),e.vao.unbind()}}(e,r,n,i),a===r.hasAlpha||o){t.bind();var c=t.uniforms;c.model=n.model||h,c.view=n.view||h,c.projection=n.projection||h,b[0]=2/l.drawingBufferWidth,b[1]=2/l.drawingBufferHeight,c.screenSize=b,c.highlightId=r.highlightId,c.highlightScale=r.highlightScale,c.fragClipBounds=P,c.clipBounds=r.axes.bounds,c.opacity=r.opacity,c.pickGroup=r.pickId/255,c.pixelRatio=i,r.vao.bind(),r.vao.draw(l.TRIANGLES,r.vertexCount),r.lineWidth>0&&(l.lineWidth(r.lineWidth*i),r.vao.draw(l.LINES,r.lineVertexCount,r.vertexCount)),r.vao.unbind()}}function D(t,e,r,i){var a;a=d(t)?e=this.pointCount||e<0)return null;var r=this.points[e],n=this._selectResult;n.index=e;for(var i=0;i<3;++i)n.position[i]=n.dataCoordinate[i]=r[i];return n},_.highlight=function(t){if(t){var e=t.index,r=255&e,n=e>>8&255,i=e>>16&255;this.highlightId=[r/255,n/255,i/255,0]}else this.highlightId=[1,1,1,1]},_.update=function(t){if("perspective"in(t=t||{})&&(this.useOrtho=!t.perspective),"orthographic"in t&&(this.useOrtho=!!t.orthographic),"lineWidth"in t&&(this.lineWidth=t.lineWidth),"project"in t)if(d(t.project))this.axesProject=t.project;else{var e=!!t.project;this.axesProject=[e,e,e]}if("projectScale"in t)if(d(t.projectScale))this.projectScale=t.projectScale.slice();else{var r=+t.projectScale;this.projectScale=[r,r,r]}if(this.projectHasAlpha=!1,"projectOpacity"in t){d(t.projectOpacity)?this.projectOpacity=t.projectOpacity.slice():(r=+t.projectOpacity,this.projectOpacity=[r,r,r]);for(var n=0;n<3;++n)this.projectOpacity[n]=v(this.projectOpacity[n]),this.projectOpacity[n]<1&&(this.projectHasAlpha=!0)}this.hasAlpha=!1,"opacity"in t&&(this.opacity=v(t.opacity),this.opacity<1&&(this.hasAlpha=!0)),this.dirty=!0;var i,a,s=t.position,l={family:t.font||"normal",style:t.fontStyle||"normal",weight:t.fontWeight||"normal",variant:t.fontVariant||"normal"},c=t.alignment||[0,0];if(2===c.length)i=c[0],a=c[1];else for(i=[],a=[],n=0;n0){var z=0,O=_,R=[0,0,0,1],F=[0,0,0,1],B=d(f)&&d(f[0]),j=d(y)&&d(y[0]);t:for(n=0;n0?1-S[0][0]:Z<0?1+S[1][0]:1,Y*=Y>0?1-S[0][1]:Y<0?1+S[1][1]:1],$=k.cells||[],K=k.positions||[];for(A=0;A<$.length;++A)for(var J=$[A],Q=0;Q<3;++Q){for(var tt=0;tt<3;++tt)C[3*z+tt]=T[tt];for(tt=0;tt<4;++tt)I[4*z+tt]=R[tt];P[z]=x;var et=K[J[Q]];L[2*z]=q*(G*et[0]-W*et[1]+X[0]),L[2*z+1]=q*(W*et[0]+G*et[1]+X[1]),z+=1}for($=M.edges,K=M.positions,A=0;A<$.length;++A)for(J=$[A],Q=0;Q<2;++Q){for(tt=0;tt<3;++tt)C[3*O+tt]=T[tt];for(tt=0;tt<4;++tt)I[4*O+tt]=F[tt];P[O]=x,et=K[J[Q]],L[2*O]=q*(G*et[0]-W*et[1]+X[0]),L[2*O+1]=q*(W*et[0]+G*et[1]+X[1]),O+=1}}}this.bounds=[u,h],this.points=s,this.pointCount=s.length,this.vertexCount=_,this.lineVertexCount=b,this.pointBuffer.update(C),this.colorBuffer.update(I),this.glyphBuffer.update(L),this.idBuffer.update(P),o.free(C),o.free(I),o.free(L),o.free(P)},_.dispose=function(){this.shader.dispose(),this.orthoShader.dispose(),this.pickPerspectiveShader.dispose(),this.pickOrthoShader.dispose(),this.vao.dispose(),this.pointBuffer.dispose(),this.colorBuffer.dispose(),this.glyphBuffer.dispose(),this.idBuffer.dispose()}},3589:function(t,e,r){t.exports=function(t,e){var r=e[0],a=e[1];return new l(t,n(t,r,a,{}),i.mallocUint8(r*a*4))};var n=r(2260),i=r(1888),a=r(9618),o=r(8828).nextPow2;function s(t,e,r,n,i){this.coord=[t,e],this.id=r,this.value=n,this.distance=i}function l(t,e,r){this.gl=t,this.fbo=e,this.buffer=r,this._readTimeout=null;var n=this;this._readCallback=function(){n.gl&&(e.bind(),t.readPixels(0,0,e.shape[0],e.shape[1],t.RGBA,t.UNSIGNED_BYTE,n.buffer),n._readTimeout=null)}}var c=l.prototype;Object.defineProperty(c,"shape",{get:function(){return this.gl?this.fbo.shape.slice():[0,0]},set:function(t){if(this.gl){this.fbo.shape=t;var e=this.fbo.shape[0],r=this.fbo.shape[1];if(r*e*4>this.buffer.length){i.free(this.buffer);for(var n=this.buffer=i.mallocUint8(o(r*e*4)),a=0;ar)for(t=r;te)for(t=e;t=0){for(var T=0|w.type.charAt(w.type.length-1),A=new Array(T),k=0;k=0;)M+=1;b[v]=M}var S=new Array(r.length);function E(){p.program=o.program(f,p._vref,p._fref,_,b);for(var t=0;t=0){if((d=p.charCodeAt(p.length-1)-48)<2||d>4)throw new n("","Invalid data type for attribute "+h+": "+p);s(t,e,f[0],i,d,a,h)}else{if(!(p.indexOf("mat")>=0))throw new n("","Unknown data type for attribute "+h+": "+p);var d;if((d=p.charCodeAt(p.length-1)-48)<2||d>4)throw new n("","Invalid data type for attribute "+h+": "+p);l(t,e,f,i,d,a,h)}}}return a};var n=r(8866);function i(t,e,r,n,i,a){this._gl=t,this._wrapper=e,this._index=r,this._locations=n,this._dimension=i,this._constFunc=a}var a=i.prototype;a.pointer=function(t,e,r,n){var i=this,a=i._gl,o=i._locations[i._index];a.vertexAttribPointer(o,i._dimension,t||a.FLOAT,!!e,r||0,n||0),a.enableVertexAttribArray(o)},a.set=function(t,e,r,n){return this._constFunc(this._locations[this._index],t,e,r,n)},Object.defineProperty(a,"location",{get:function(){return this._locations[this._index]},set:function(t){return t!==this._locations[this._index]&&(this._locations[this._index]=0|t,this._wrapper.program=null),0|t}});var o=[function(t,e,r){return void 0===r.length?t.vertexAttrib1f(e,r):t.vertexAttrib1fv(e,r)},function(t,e,r,n){return void 0===r.length?t.vertexAttrib2f(e,r,n):t.vertexAttrib2fv(e,r)},function(t,e,r,n,i){return void 0===r.length?t.vertexAttrib3f(e,r,n,i):t.vertexAttrib3fv(e,r)},function(t,e,r,n,i,a){return void 0===r.length?t.vertexAttrib4f(e,r,n,i,a):t.vertexAttrib4fv(e,r)}];function s(t,e,r,n,a,s,l){var c=o[a],u=new i(t,e,r,n,a,c);Object.defineProperty(s,l,{set:function(e){return t.disableVertexAttribArray(n[r]),c(t,n[r],e),e},get:function(){return u},enumerable:!0})}function l(t,e,r,n,i,a,o){for(var l=new Array(i),c=new Array(i),u=0;u4)throw new i("","Invalid uniform dimension type for matrix "+name+": "+v);t["uniformMatrix"+y+"fv"](s[h],!1,p);break}throw new i("","Unknown uniform data type for "+name+": "+v)}if((y=v.charCodeAt(v.length-1)-48)<2||y>4)throw new i("","Invalid data type");switch(v.charAt(0)){case"b":case"i":t["uniform"+y+"iv"](s[h],p);break;case"v":t["uniform"+y+"fv"](s[h],p);break;default:throw new i("","Unrecognized data type for vector "+name+": "+v)}}}}}}function u(t,e){if("object"!=typeof e)return[[t,e]];var r=[];for(var n in e){var i=e[n],a=t;parseInt(n)+""===n?a+="["+n+"]":a+="."+n,"object"==typeof i?r.push.apply(r,u(a,i)):r.push([a,i])}return r}function h(t,e,n){if("object"==typeof n){var u=p(n);Object.defineProperty(t,e,{get:a(u),set:c(n),enumerable:!0,configurable:!1})}else s[n]?Object.defineProperty(t,e,{get:l(n),set:c(n),enumerable:!0,configurable:!1}):t[e]=function(t){switch(t){case"bool":return!1;case"int":case"sampler2D":case"samplerCube":case"float":return 0;default:var e=t.indexOf("vec");if(0<=e&&e<=1&&t.length===4+e){if((r=t.charCodeAt(t.length-1)-48)<2||r>4)throw new i("","Invalid data type");return"b"===t.charAt(0)?o(r,!1):o(r,0)}if(0===t.indexOf("mat")&&4===t.length){var r;if((r=t.charCodeAt(t.length-1)-48)<2||r>4)throw new i("","Invalid uniform dimension type for matrix "+name+": "+t);return o(r*r,0)}throw new i("","Unknown uniform data type for "+name+": "+t)}}(r[n].type)}function p(t){var e;if(Array.isArray(t)){e=new Array(t.length);for(var r=0;r1){s[0]in a||(a[s[0]]=[]),a=a[s[0]];for(var l=1;l1)for(var l=0;l"u"?r(606):WeakMap),o=0;function s(t,e,r,n,i,a,o){this.id=t,this.src=e,this.type=r,this.shader=n,this.count=a,this.programs=[],this.cache=o}function l(t){this.gl=t,this.shaders=[{},{}],this.programs={}}s.prototype.dispose=function(){if(0==--this.count){for(var t=this.cache,e=t.gl,r=this.programs,n=0,i=r.length;n 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the tube vertex and normal at the given index.\n//\n// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d.\n//\n// Each tube segment is made up of a ring of vertices.\n// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array.\n// The indexes of tube segments run from 0 to 8.\n//\nvec3 getTubePosition(vec3 d, float index, out vec3 normal) {\n float segmentCount = 8.0;\n\n float angle = 2.0 * 3.14159 * (index / segmentCount);\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d);\n vec3 y = v * sin(angle) * length(d);\n vec3 v3 = x + y;\n\n normal = normalize(v3);\n\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 color, position;\nattribute vec2 uv;\n\nuniform float vectorScale, tubeScale;\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 eyePosition, lightPosition;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n // Scale the vector magnitude to stay constant with\n // model & view changes.\n vec3 normal;\n vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal);\n vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * tubePosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n // vec4 m_position = model * vec4(tubePosition, 1.0);\n vec4 t_position = view * tubePosition;\n gl_Position = projection * t_position;\n\n f_color = color;\n f_data = tubePosition.xyz;\n f_position = position.xyz;\n f_uv = uv;\n}\n"]),a=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\nfloat cookTorranceSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness,\n float fresnel) {\n\n float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);\n float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);\n\n //Half angle vector\n vec3 H = normalize(lightDirection + viewDirection);\n\n //Geometric term\n float NdotH = max(dot(surfaceNormal, H), 0.0);\n float VdotH = max(dot(viewDirection, H), 0.000001);\n float LdotH = max(dot(lightDirection, H), 0.000001);\n float G1 = (2.0 * NdotH * VdotN) / VdotH;\n float G2 = (2.0 * NdotH * LdotN) / LdotH;\n float G = min(1.0, min(G1, G2));\n \n //Distribution term\n float D = beckmannDistribution(NdotH, roughness);\n\n //Fresnel term\n float F = pow(1.0 - VdotN, fresnel);\n\n //Multiply terms and done\n return G * F * D / max(3.14159265 * VdotN, 0.000001);\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform sampler2D texture;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n vec3 N = normalize(f_normal);\n vec3 L = normalize(f_lightDirection);\n vec3 V = normalize(f_eyeDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = f_color * texture2D(texture, f_uv);\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = litColor * opacity;\n}\n"]),o=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the tube vertex and normal at the given index.\n//\n// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d.\n//\n// Each tube segment is made up of a ring of vertices.\n// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array.\n// The indexes of tube segments run from 0 to 8.\n//\nvec3 getTubePosition(vec3 d, float index, out vec3 normal) {\n float segmentCount = 8.0;\n\n float angle = 2.0 * 3.14159 * (index / segmentCount);\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d);\n vec3 y = v * sin(angle) * length(d);\n vec3 v3 = x + y;\n\n normal = normalize(v3);\n\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform float tubeScale;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n vec3 normal;\n vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal);\n vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n gl_Position = projection * (view * tubePosition);\n f_id = id;\n f_position = position.xyz;\n}\n"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]);e.meshShader={vertex:i,fragment:a,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec4"}]},e.pickShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec4"}]}},7815:function(t,e,r){var n=r(2931),i=r(9970),a=["xyz","xzy","yxz","yzx","zxy","zyx"],o=function(t,e){var r,n=t.length;for(r=0;re)return r-1}return r},s=function(t,e,r){return tr?r:t},l=function(t){var e=1/0;t.sort((function(t,e){return t-e}));for(var r=t.length,n=1;nh-1||v>p-1||x>f-1)return n.create();var _,b,w,T,A,k,M=a[0][d],S=a[0][y],E=a[1][m],C=a[1][v],I=a[2][g],L=(l-M)/(S-M),P=(c-E)/(C-E),z=(u-I)/(a[2][x]-I);switch(isFinite(L)||(L=.5),isFinite(P)||(P=.5),isFinite(z)||(z=.5),r.reversedX&&(d=h-1-d,y=h-1-y),r.reversedY&&(m=p-1-m,v=p-1-v),r.reversedZ&&(g=f-1-g,x=f-1-x),r.filled){case 5:A=g,k=x,w=m*f,T=v*f,_=d*f*p,b=y*f*p;break;case 4:A=g,k=x,_=d*f,b=y*f,w=m*f*h,T=v*f*h;break;case 3:w=m,T=v,A=g*p,k=x*p,_=d*p*f,b=y*p*f;break;case 2:w=m,T=v,_=d*p,b=y*p,A=g*p*h,k=x*p*h;break;case 1:_=d,b=y,A=g*h,k=x*h,w=m*h*f,T=v*h*f;break;default:_=d,b=y,w=m*h,T=v*h,A=g*h*p,k=x*h*p}var D=i[_+w+A],O=i[_+w+k],R=i[_+T+A],F=i[_+T+k],B=i[b+w+A],j=i[b+w+k],N=i[b+T+A],U=i[b+T+k],V=n.create(),q=n.create(),H=n.create(),G=n.create();n.lerp(V,D,B,L),n.lerp(q,O,j,L),n.lerp(H,R,N,L),n.lerp(G,F,U,L);var W=n.create(),Z=n.create();n.lerp(W,V,H,P),n.lerp(Z,q,G,P);var Y=n.create();return n.lerp(Y,W,Z,z),Y}(e,t,f)},x=t.getDivergence||function(t,e){var r=n.create(),i=1e-4;n.add(r,t,[i,0,0]);var a=v(r);n.subtract(a,a,e),n.scale(a,a,1/i),n.add(r,t,[0,i,0]);var o=v(r);n.subtract(o,o,e),n.scale(o,o,1/i),n.add(r,t,[0,0,i]);var s=v(r);return n.subtract(s,s,e),n.scale(s,s,1/i),n.add(r,a,o),n.add(r,r,s),r},_=[],b=e[0][0],w=e[0][1],T=e[0][2],A=e[1][0],k=e[1][1],M=e[1][2],S=10*n.distance(e[0],e[1])/c,E=S*S,C=1,I=0,L=r.length;L>1&&(C=function(t){for(var e=[],r=[],n=[],i={},a={},o={},s=t.length,c=0;cI&&(I=N),B.push(N),_.push({points:D,velocities:O,divergences:B});for(var U=0;U<100*c&&D.lengthA||gk||yM));){U++;var V=n.clone(R),q=n.squaredLength(V);if(0===q)break;q>E&&n.scale(V,V,S/Math.sqrt(q)),n.add(V,V,z),R=v(V),n.squaredDistance(F,V)-E>-1e-4*E&&(D.push(V),F=V,O.push(R),j=x(V,R),N=n.length(j),isFinite(N)&&N>I&&(I=N),B.push(N)),z=V}}var H=function(t,e,r,a){for(var o=0,s=0;s0)for(T=0;T<8;T++){var A=(T+1)%8;c.push(p[T],f[T],f[A],f[A],p[A],p[T]),h.push(v,y,y,y,v,v),d.push(m,g,g,g,m,m);var k=c.length;u.push([k-6,k-5,k-4],[k-3,k-2,k-1])}var M=p;p=f,f=M;var S=v;v=y,y=S;var E=m;m=g,g=E}return{positions:c,cells:u,vectors:h,vertexIntensity:d}}(t,r,a,o)})),h=[],p=[],f=[],d=[];for(s=0;s max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 lowerBound, upperBound;\nuniform float contourTint;\nuniform vec4 contourColor;\nuniform sampler2D colormap;\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform float vertexColor;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n if (\n kill > 0.0 ||\n vColor.a == 0.0 ||\n outOfRange(clipBounds[0], clipBounds[1], worldCoordinate)\n ) discard;\n\n vec3 N = normalize(surfaceNormal);\n vec3 V = normalize(eyeDirection);\n vec3 L = normalize(lightDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = max(beckmannSpecular(L, V, N, roughness), 0.);\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n //decide how to interpolate color — in vertex or in fragment\n vec4 surfaceColor =\n step(vertexColor, .5) * texture2D(colormap, vec2(value, value)) +\n step(.5, vertexColor) * vColor;\n\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = mix(litColor, contourColor, contourTint) * opacity;\n}\n"]),s=i(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute float f;\n\nuniform vec3 objectOffset;\nuniform mat3 permutation;\nuniform mat4 model, view, projection;\nuniform float height, zOffset;\nuniform sampler2D colormap;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n vec3 dataCoordinate = permutation * vec3(uv.xy, height);\n worldCoordinate = objectOffset + dataCoordinate;\n mat4 objectOffsetTranslation = mat4(1.0) + mat4(vec4(0), vec4(0), vec4(0), vec4(objectOffset, 0));\n vec4 worldPosition = (model * objectOffsetTranslation) * vec4(dataCoordinate, 1.0);\n\n vec4 clipPosition = projection * (view * worldPosition);\n clipPosition.z += zOffset;\n\n gl_Position = clipPosition;\n value = f + objectOffset.z;\n kill = -1.0;\n planeCoordinate = uv.zw;\n\n vColor = texture2D(colormap, vec2(value, value));\n\n //Don't do lighting for contours\n surfaceNormal = vec3(1,0,0);\n eyeDirection = vec3(0,1,0);\n lightDirection = vec3(0,0,1);\n}\n"]),l=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec2 shape;\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 surfaceNormal;\n\nvec2 splitFloat(float v) {\n float vh = 255.0 * v;\n float upper = floor(vh);\n float lower = fract(vh);\n return vec2(upper / 255.0, floor(lower * 16.0) / 16.0);\n}\n\nvoid main() {\n if ((kill > 0.0) ||\n (outOfRange(clipBounds[0], clipBounds[1], worldCoordinate))) discard;\n\n vec2 ux = splitFloat(planeCoordinate.x / shape.x);\n vec2 uy = splitFloat(planeCoordinate.y / shape.y);\n gl_FragColor = vec4(pickId, ux.x, uy.x, ux.y + (uy.y/16.0));\n}\n"]);e.createShader=function(t){var e=n(t,a,o,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e.attributes.normal.location=2,e},e.createPickShader=function(t){var e=n(t,a,l,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e.attributes.normal.location=2,e},e.createContourShader=function(t){var e=n(t,s,o,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e},e.createPickContourShader=function(t){var e=n(t,s,l,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e}},9499:function(t,e,r){t.exports=function(t){var e=t.gl,r=v(e),n=_(e),s=x(e),l=b(e),c=i(e),u=a(e,[{buffer:c,size:4,stride:w,offset:0},{buffer:c,size:3,stride:w,offset:16},{buffer:c,size:3,stride:w,offset:28}]),h=i(e),p=a(e,[{buffer:h,size:4,stride:20,offset:0},{buffer:h,size:1,stride:20,offset:16}]),f=i(e),d=a(e,[{buffer:f,size:2,type:e.FLOAT}]),m=o(e,1,S,e.RGBA,e.UNSIGNED_BYTE);m.minFilter=e.LINEAR,m.magFilter=e.LINEAR;var g=new E(e,[0,0],[[0,0,0],[0,0,0]],r,n,c,u,m,s,l,h,p,f,d,[0,0,0]),y={levels:[[],[],[]]};for(var T in t)y[T]=t[T];return y.colormap=y.colormap||"jet",g.update(y),g};var n=r(8828),i=r(2762),a=r(8116),o=r(7766),s=r(1888),l=r(6729),c=r(5298),u=r(9994),h=r(9618),p=r(3711),f=r(6760),d=r(7608),m=r(2478),g=r(6199),y=r(990),v=y.createShader,x=y.createContourShader,_=y.createPickShader,b=y.createPickContourShader,w=40,T=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],A=[[0,0],[0,1],[1,0],[1,1],[1,0],[0,1]],k=[[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0]];function M(t,e,r,n,i){this.position=t,this.index=e,this.uv=r,this.level=n,this.dataCoordinate=i}!function(){for(var t=0;t<3;++t){var e=k[t],r=(t+2)%3;e[(t+1)%3+0]=1,e[r+3]=1,e[t+6]=1}}();var S=256;function E(t,e,r,n,i,a,o,l,c,u,p,f,d,m,g){this.gl=t,this.shape=e,this.bounds=r,this.objectOffset=g,this.intensityBounds=[],this._shader=n,this._pickShader=i,this._coordinateBuffer=a,this._vao=o,this._colorMap=l,this._contourShader=c,this._contourPickShader=u,this._contourBuffer=p,this._contourVAO=f,this._contourOffsets=[[],[],[]],this._contourCounts=[[],[],[]],this._vertexCount=0,this._pickResult=new M([0,0,0],[0,0],[0,0],[0,0,0],[0,0,0]),this._dynamicBuffer=d,this._dynamicVAO=m,this._dynamicOffsets=[0,0,0],this._dynamicCounts=[0,0,0],this.contourWidth=[1,1,1],this.contourLevels=[[1],[1],[1]],this.contourTint=[0,0,0],this.contourColor=[[.5,.5,.5,1],[.5,.5,.5,1],[.5,.5,.5,1]],this.showContour=!0,this.showSurface=!0,this.enableHighlight=[!0,!0,!0],this.highlightColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.highlightTint=[1,1,1],this.highlightLevel=[-1,-1,-1],this.enableDynamic=[!0,!0,!0],this.dynamicLevel=[NaN,NaN,NaN],this.dynamicColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.dynamicTint=[1,1,1],this.dynamicWidth=[1,1,1],this.axesBounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.surfaceProject=[!1,!1,!1],this.contourProject=[[!1,!1,!1],[!1,!1,!1],[!1,!1,!1]],this.colorBounds=[!1,!1],this._field=[h(s.mallocFloat(1024),[0,0]),h(s.mallocFloat(1024),[0,0]),h(s.mallocFloat(1024),[0,0])],this.pickId=1,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.snapToData=!1,this.pixelRatio=1,this.opacity=1,this.lightPosition=[10,1e4,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.vertexColor=0,this.dirty=!0}var C=E.prototype;C.genColormap=function(t,e){var r=!1,n=u([l({colormap:t,nshades:S,format:"rgba"}).map((function(t,n){var i=e?function(t,e){if(!e||!e.length)return 1;for(var r=0;rt&&r>0){var n=(e[r][0]-t)/(e[r][0]-e[r-1][0]);return e[r][1]*(1-n)+n*e[r-1][1]}}return 1}(n/255,e):t[3];return i<1&&(r=!0),[t[0],t[1],t[2],255*i]}))]);return c.divseq(n,255),this.hasAlphaScale=r,n},C.isTransparent=function(){return this.opacity<1||this.hasAlphaScale},C.isOpaque=function(){return!this.isTransparent()},C.pickSlots=1,C.setPickBase=function(t){this.pickId=t};var I=[0,0,0],L={showSurface:!1,showContour:!1,projections:[T.slice(),T.slice(),T.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]};function P(t,e){var r,n,i,a=e.axes&&e.axes.lastCubeProps.axis||I,o=e.showSurface,s=e.showContour;for(r=0;r<3;++r)for(o=o||e.surfaceProject[r],n=0;n<3;++n)s=s||e.contourProject[r][n];for(r=0;r<3;++r){var l=L.projections[r];for(n=0;n<16;++n)l[n]=0;for(n=0;n<4;++n)l[5*n]=1;l[5*r]=0,l[12+r]=e.axesBounds[+(a[r]>0)][r],f(l,t.model,l);var c=L.clipBounds[r];for(i=0;i<2;++i)for(n=0;n<3;++n)c[i][n]=t.clipBounds[i][n];c[0][r]=-1e8,c[1][r]=1e8}return L.showSurface=o,L.showContour=s,L}var z={model:T,view:T,projection:T,inverseModel:T.slice(),lowerBound:[0,0,0],upperBound:[0,0,0],colorMap:0,clipBounds:[[0,0,0],[0,0,0]],height:0,contourTint:0,contourColor:[0,0,0,1],permutation:[1,0,0,0,1,0,0,0,1],zOffset:-1e-4,objectOffset:[0,0,0],kambient:1,kdiffuse:1,kspecular:1,lightPosition:[1e3,1e3,1e3],eyePosition:[0,0,0],roughness:1,fresnel:1,opacity:1,vertexColor:0},D=T.slice(),O=[1,0,0,0,1,0,0,0,1];function R(t,e){t=t||{};var r=this.gl;r.disable(r.CULL_FACE),this._colorMap.bind(0);var n=z;n.model=t.model||T,n.view=t.view||T,n.projection=t.projection||T,n.lowerBound=[this.bounds[0][0],this.bounds[0][1],this.colorBounds[0]||this.bounds[0][2]],n.upperBound=[this.bounds[1][0],this.bounds[1][1],this.colorBounds[1]||this.bounds[1][2]],n.objectOffset=this.objectOffset,n.contourColor=this.contourColor[0],n.inverseModel=d(n.inverseModel,n.model);for(var i=0;i<2;++i)for(var a=n.clipBounds[i],o=0;o<3;++o)a[o]=Math.min(Math.max(this.clipBounds[i][o],-1e8),1e8);n.kambient=this.ambientLight,n.kdiffuse=this.diffuseLight,n.kspecular=this.specularLight,n.roughness=this.roughness,n.fresnel=this.fresnel,n.opacity=this.opacity,n.height=0,n.permutation=O,n.vertexColor=this.vertexColor;var s=D;for(f(s,n.view,n.model),f(s,n.projection,s),d(s,s),i=0;i<3;++i)n.eyePosition[i]=s[12+i]/s[15];var l=s[15];for(i=0;i<3;++i)l+=this.lightPosition[i]*s[4*i+3];for(i=0;i<3;++i){var c=s[12+i];for(o=0;o<3;++o)c+=s[4*o+i]*this.lightPosition[o];n.lightPosition[i]=c/l}var u=P(n,this);if(u.showSurface){for(this._shader.bind(),this._shader.uniforms=n,this._vao.bind(),this.showSurface&&this._vertexCount&&this._vao.draw(r.TRIANGLES,this._vertexCount),i=0;i<3;++i)!this.surfaceProject[i]||!this.vertexCount||(this._shader.uniforms.model=u.projections[i],this._shader.uniforms.clipBounds=u.clipBounds[i],this._vao.draw(r.TRIANGLES,this._vertexCount));this._vao.unbind()}if(u.showContour){var h=this._contourShader;n.kambient=1,n.kdiffuse=0,n.kspecular=0,n.opacity=1,h.bind(),h.uniforms=n;var p=this._contourVAO;for(p.bind(),i=0;i<3;++i)for(h.uniforms.permutation=k[i],r.lineWidth(this.contourWidth[i]*this.pixelRatio),o=0;o>4)/16)/255,i=Math.floor(n),a=n-i,o=e[1]*(t.value[1]+(15&t.value[2])/16)/255,s=Math.floor(o),l=o-s;i+=1,s+=1;var c=r.position;c[0]=c[1]=c[2]=0;for(var u=0;u<2;++u)for(var h=u?a:1-a,p=0;p<2;++p)for(var f=i+u,d=s+p,g=h*(p?l:1-l),y=0;y<3;++y)c[y]+=this._field[y].get(f,d)*g;for(var v=this._pickResult.level,x=0;x<3;++x)if(v[x]=m.le(this.contourLevels[x],c[x]),v[x]<0)this.contourLevels[x].length>0&&(v[x]=0);else if(v[x]Math.abs(b-c[x])&&(v[x]+=1)}for(r.index[0]=a<.5?i:i+1,r.index[1]=l<.5?s:s+1,r.uv[0]=n/e[0],r.uv[1]=o/e[1],y=0;y<3;++y)r.dataCoordinate[y]=this._field[y].get(r.index[0],r.index[1]);return r},C.padField=function(t,e){var r=e.shape.slice(),n=t.shape.slice();c.assign(t.lo(1,1).hi(r[0],r[1]),e),c.assign(t.lo(1).hi(r[0],1),e.hi(r[0],1)),c.assign(t.lo(1,n[1]-1).hi(r[0],1),e.lo(0,r[1]-1).hi(r[0],1)),c.assign(t.lo(0,1).hi(1,r[1]),e.hi(1)),c.assign(t.lo(n[0]-1,1).hi(1,r[1]),e.lo(r[0]-1)),t.set(0,0,e.get(0,0)),t.set(0,n[1]-1,e.get(0,r[1]-1)),t.set(n[0]-1,0,e.get(r[0]-1,0)),t.set(n[0]-1,n[1]-1,e.get(r[0]-1,r[1]-1))},C.update=function(t){t=t||{},this.objectOffset=t.objectOffset||this.objectOffset,this.dirty=!0,"contourWidth"in t&&(this.contourWidth=B(t.contourWidth,Number)),"showContour"in t&&(this.showContour=B(t.showContour,Boolean)),"showSurface"in t&&(this.showSurface=!!t.showSurface),"contourTint"in t&&(this.contourTint=B(t.contourTint,Boolean)),"contourColor"in t&&(this.contourColor=N(t.contourColor)),"contourProject"in t&&(this.contourProject=B(t.contourProject,(function(t){return B(t,Boolean)}))),"surfaceProject"in t&&(this.surfaceProject=t.surfaceProject),"dynamicColor"in t&&(this.dynamicColor=N(t.dynamicColor)),"dynamicTint"in t&&(this.dynamicTint=B(t.dynamicTint,Number)),"dynamicWidth"in t&&(this.dynamicWidth=B(t.dynamicWidth,Number)),"opacity"in t&&(this.opacity=t.opacity),"opacityscale"in t&&(this.opacityscale=t.opacityscale),"colorBounds"in t&&(this.colorBounds=t.colorBounds),"vertexColor"in t&&(this.vertexColor=t.vertexColor?1:0),"colormap"in t&&this._colorMap.setPixels(this.genColormap(t.colormap,this.opacityscale));var e=t.field||t.coords&&t.coords[2]||null,r=!1;if(e||(e=this._field[2].shape[0]||this._field[2].shape[2]?this._field[2].lo(1,1).hi(this._field[2].shape[0]-2,this._field[2].shape[1]-2):this._field[2].hi(0,0)),"field"in t||"coords"in t){var i=(e.shape[0]+2)*(e.shape[1]+2);i>this._field[2].data.length&&(s.freeFloat(this._field[2].data),this._field[2].data=s.mallocFloat(n.nextPow2(i))),this._field[2]=h(this._field[2].data,[e.shape[0]+2,e.shape[1]+2]),this.padField(this._field[2],e),this.shape=e.shape.slice();for(var a=this.shape,o=0;o<2;++o)this._field[2].size>this._field[o].data.length&&(s.freeFloat(this._field[o].data),this._field[o].data=s.mallocFloat(this._field[2].size)),this._field[o]=h(this._field[o].data,[a[0]+2,a[1]+2]);if(t.coords){var l=t.coords;if(!Array.isArray(l)||3!==l.length)throw new Error("gl-surface: invalid coordinates for x/y");for(o=0;o<2;++o){var c=l[o];for(y=0;y<2;++y)if(c.shape[y]!==a[y])throw new Error("gl-surface: coords have incorrect shape");this.padField(this._field[o],c)}}else if(t.ticks){var u=t.ticks;if(!Array.isArray(u)||2!==u.length)throw new Error("gl-surface: invalid ticks");for(o=0;o<2;++o){var f=u[o];if((Array.isArray(f)||f.length)&&(f=h(f)),f.shape[0]!==a[o])throw new Error("gl-surface: invalid tick length");var d=h(f.data,a);d.stride[o]=f.stride[0],d.stride[1^o]=0,this.padField(this._field[o],d)}}else{for(o=0;o<2;++o){var m=[0,0];m[o]=1,this._field[o]=h(this._field[o].data,[a[0]+2,a[1]+2],m,0)}this._field[0].set(0,0,0);for(var y=0;y0){for(var xt=0;xt<5;++xt)J.pop();U-=1}continue t}J.push(nt[0],nt[1],ot[0],ot[1],nt[2]),U+=1}}rt.push(U)}this._contourOffsets[Q]=et,this._contourCounts[Q]=rt}var _t=s.mallocFloat(J.length);for(o=0;os||o[1]<0||o[1]>s)throw new Error("gl-texture2d: Invalid texture size");var l=d(o,e.stride.slice()),c=0;"float32"===r?c=t.FLOAT:"float64"===r?(c=t.FLOAT,l=!1,r="float32"):"uint8"===r?c=t.UNSIGNED_BYTE:(c=t.UNSIGNED_BYTE,l=!1,r="uint8");var h=0;if(2===o.length)h=t.LUMINANCE,o=[o[0],o[1],1],e=n(e.data,o,[e.stride[0],e.stride[1],1],e.offset);else{if(3!==o.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===o[2])h=t.ALPHA;else if(2===o[2])h=t.LUMINANCE_ALPHA;else if(3===o[2])h=t.RGB;else{if(4!==o[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");h=t.RGBA}}c===t.FLOAT&&!t.getExtension("OES_texture_float")&&(c=t.UNSIGNED_BYTE,l=!1);var f,g,y=e.size;if(l)f=0===e.offset&&e.data.length===y?e.data:e.data.subarray(e.offset,e.offset+y);else{var v=[o[2],o[2]*o[0],1];g=a.malloc(y,r);var x=n(g,o,v,0);"float32"!==r&&"float64"!==r||c!==t.UNSIGNED_BYTE?i.assign(x,e):u(x,e),f=g.subarray(0,y)}var _=m(t);return t.texImage2D(t.TEXTURE_2D,0,h,o[0],o[1],0,h,c,f),l||a.free(g),new p(t,_,o[0],o[1],h,c)}(t,e)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")};var o=null,s=null,l=null;function c(t){return typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement||typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement||typeof HTMLVideoElement<"u"&&t instanceof HTMLVideoElement||typeof ImageData<"u"&&t instanceof ImageData}var u=function(t,e){i.muls(t,e,255)};function h(t,e,r){var n=t.gl,i=n.getParameter(n.MAX_TEXTURE_SIZE);if(e<0||e>i||r<0||r>i)throw new Error("gl-texture2d: Invalid texture size");return t._shape=[e,r],t.bind(),n.texImage2D(n.TEXTURE_2D,0,t.format,e,r,0,t.format,t.type,null),t._mipLevels=[0],t}function p(t,e,r,n,i,a){this.gl=t,this.handle=e,this.format=i,this.type=a,this._shape=[r,n],this._mipLevels=[0],this._magFilter=t.NEAREST,this._minFilter=t.NEAREST,this._wrapS=t.CLAMP_TO_EDGE,this._wrapT=t.CLAMP_TO_EDGE,this._anisoSamples=1;var o=this,s=[this._wrapS,this._wrapT];Object.defineProperties(s,[{get:function(){return o._wrapS},set:function(t){return o.wrapS=t}},{get:function(){return o._wrapT},set:function(t){return o.wrapT=t}}]),this._wrapVector=s;var l=[this._shape[0],this._shape[1]];Object.defineProperties(l,[{get:function(){return o._shape[0]},set:function(t){return o.width=t}},{get:function(){return o._shape[1]},set:function(t){return o.height=t}}]),this._shapeVector=l}var f=p.prototype;function d(t,e){return 3===t.length?1===e[2]&&e[1]===t[0]*t[2]&&e[0]===t[2]:1===e[0]&&e[1]===t[0]}function m(t){var e=t.createTexture();return t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),e}function g(t,e,r,n,i){var a=t.getParameter(t.MAX_TEXTURE_SIZE);if(e<0||e>a||r<0||r>a)throw new Error("gl-texture2d: Invalid texture shape");if(i===t.FLOAT&&!t.getExtension("OES_texture_float"))throw new Error("gl-texture2d: Floating point textures not supported on this platform");var o=m(t);return t.texImage2D(t.TEXTURE_2D,0,n,e,r,0,n,i,null),new p(t,o,e,r,n,i)}Object.defineProperties(f,{minFilter:{get:function(){return this._minFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&o.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),s.indexOf(t)<0)throw new Error("gl-texture2d: Unknown filter mode "+t);return e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t),this._minFilter=t}},magFilter:{get:function(){return this._magFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&o.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),s.indexOf(t)<0)throw new Error("gl-texture2d: Unknown filter mode "+t);return e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,t),this._magFilter=t}},mipSamples:{get:function(){return this._anisoSamples},set:function(t){var e=this._anisoSamples;if(this._anisoSamples=0|Math.max(t,1),e!==this._anisoSamples){var r=this.gl.getExtension("EXT_texture_filter_anisotropic");r&&this.gl.texParameterf(this.gl.TEXTURE_2D,r.TEXTURE_MAX_ANISOTROPY_EXT,this._anisoSamples)}return this._anisoSamples}},wrapS:{get:function(){return this._wrapS},set:function(t){if(this.bind(),l.indexOf(t)<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,t),this._wrapS=t}},wrapT:{get:function(){return this._wrapT},set:function(t){if(this.bind(),l.indexOf(t)<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,t),this._wrapT=t}},wrap:{get:function(){return this._wrapVector},set:function(t){if(Array.isArray(t)||(t=[t,t]),2!==t.length)throw new Error("gl-texture2d: Must specify wrap mode for rows and columns");for(var e=0;e<2;++e)if(l.indexOf(t[e])<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);this._wrapS=t[0],this._wrapT=t[1];var r=this.gl;return this.bind(),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,this._wrapS),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,this._wrapT),t}},shape:{get:function(){return this._shapeVector},set:function(t){if(Array.isArray(t)){if(2!==t.length)throw new Error("gl-texture2d: Invalid texture shape")}else t=[0|t,0|t];return h(this,0|t[0],0|t[1]),[0|t[0],0|t[1]]}},width:{get:function(){return this._shape[0]},set:function(t){return h(this,t|=0,this._shape[1]),t}},height:{get:function(){return this._shape[1]},set:function(t){return t|=0,h(this,this._shape[0],t),t}}}),f.bind=function(t){var e=this.gl;return void 0!==t&&e.activeTexture(e.TEXTURE0+(0|t)),e.bindTexture(e.TEXTURE_2D,this.handle),void 0!==t?0|t:e.getParameter(e.ACTIVE_TEXTURE)-e.TEXTURE0},f.dispose=function(){this.gl.deleteTexture(this.handle)},f.generateMipmap=function(){this.bind(),this.gl.generateMipmap(this.gl.TEXTURE_2D);for(var t=Math.min(this._shape[0],this._shape[1]),e=0;t>0;++e,t>>>=1)this._mipLevels.indexOf(e)<0&&this._mipLevels.push(e)},f.setPixels=function(t,e,r,o){var s=this.gl;this.bind(),Array.isArray(e)?(o=r,r=0|e[1],e=0|e[0]):(e=e||0,r=r||0),o=o||0;var l=c(t)?t:t.raw;if(l)this._mipLevels.indexOf(o)<0?(s.texImage2D(s.TEXTURE_2D,0,this.format,this.format,this.type,l),this._mipLevels.push(o)):s.texSubImage2D(s.TEXTURE_2D,o,e,r,this.format,this.type,l);else{if(!(t.shape&&t.stride&&t.data))throw new Error("gl-texture2d: Unsupported data type");if(t.shape.length<2||e+t.shape[1]>this._shape[1]>>>o||r+t.shape[0]>this._shape[0]>>>o||e<0||r<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");!function(t,e,r,o,s,l,c,h){var p=h.dtype,f=h.shape.slice();if(f.length<2||f.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var m=0,g=0,y=d(f,h.stride.slice());if("float32"===p?m=t.FLOAT:"float64"===p?(m=t.FLOAT,y=!1,p="float32"):"uint8"===p?m=t.UNSIGNED_BYTE:(m=t.UNSIGNED_BYTE,y=!1,p="uint8"),2===f.length)g=t.LUMINANCE,f=[f[0],f[1],1],h=n(h.data,f,[h.stride[0],h.stride[1],1],h.offset);else{if(3!==f.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===f[2])g=t.ALPHA;else if(2===f[2])g=t.LUMINANCE_ALPHA;else if(3===f[2])g=t.RGB;else{if(4!==f[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");g=t.RGBA}f[2]}if((g===t.LUMINANCE||g===t.ALPHA)&&(s===t.LUMINANCE||s===t.ALPHA)&&(g=s),g!==s)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var v=h.size,x=c.indexOf(o)<0;if(x&&c.push(o),m===l&&y)0===h.offset&&h.data.length===v?x?t.texImage2D(t.TEXTURE_2D,o,s,f[0],f[1],0,s,l,h.data):t.texSubImage2D(t.TEXTURE_2D,o,e,r,f[0],f[1],s,l,h.data):x?t.texImage2D(t.TEXTURE_2D,o,s,f[0],f[1],0,s,l,h.data.subarray(h.offset,h.offset+v)):t.texSubImage2D(t.TEXTURE_2D,o,e,r,f[0],f[1],s,l,h.data.subarray(h.offset,h.offset+v));else{var _;_=l===t.FLOAT?a.mallocFloat32(v):a.mallocUint8(v);var b=n(_,f,[f[2],f[2]*f[0],1]);m===t.FLOAT&&l===t.UNSIGNED_BYTE?u(b,h):i.assign(b,h),x?t.texImage2D(t.TEXTURE_2D,o,s,f[0],f[1],0,s,l,_.subarray(0,v)):t.texSubImage2D(t.TEXTURE_2D,o,e,r,f[0],f[1],s,l,_.subarray(0,v)),l===t.FLOAT?a.freeFloat32(_):a.freeUint8(_)}}(s,e,r,o,this.format,this.type,this._mipLevels,t)}}},1433:function(t){t.exports=function(t,e,r){e?e.bind():t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null);var n=0|t.getParameter(t.MAX_VERTEX_ATTRIBS);if(r){if(r.length>n)throw new Error("gl-vao: Too many vertex attributes");for(var i=0;i1?0:Math.acos(s)};var n=r(2825),i=r(3536),a=r(244)},9226:function(t){t.exports=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}},3126:function(t){t.exports=function(t){var e=new Float32Array(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}},3990:function(t){t.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}},1091:function(t){t.exports=function(){var t=new Float32Array(3);return t[0]=0,t[1]=0,t[2]=0,t}},5911:function(t){t.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2];return t[0]=i*l-a*s,t[1]=a*o-n*l,t[2]=n*s-i*o,t}},5455:function(t,e,r){t.exports=r(7056)},7056:function(t){t.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return Math.sqrt(r*r+n*n+i*i)}},4008:function(t,e,r){t.exports=r(6690)},6690:function(t){t.exports=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t}},244:function(t){t.exports=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}},2613:function(t){t.exports=1e-6},9922:function(t,e,r){t.exports=function(t,e){var r=t[0],i=t[1],a=t[2],o=e[0],s=e[1],l=e[2];return Math.abs(r-o)<=n*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(i-s)<=n*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(a-l)<=n*Math.max(1,Math.abs(a),Math.abs(l))};var n=r(2613)},9265:function(t){t.exports=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}},2681:function(t){t.exports=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}},5137:function(t,e,r){t.exports=function(t,e,r,i,a,o){var s,l;for(e||(e=3),r||(r=0),l=i?Math.min(i*e+r,t.length):t.length,s=r;s0&&(a=1/Math.sqrt(a),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a),t}},7636:function(t){t.exports=function(t,e){e=e||1;var r=2*Math.random()*Math.PI,n=2*Math.random()-1,i=Math.sqrt(1-n*n)*e;return t[0]=Math.cos(r)*i,t[1]=Math.sin(r)*i,t[2]=n*e,t}},6894:function(t){t.exports=function(t,e,r,n){var i=r[1],a=r[2],o=e[1]-i,s=e[2]-a,l=Math.sin(n),c=Math.cos(n);return t[0]=e[0],t[1]=i+o*c-s*l,t[2]=a+o*l+s*c,t}},109:function(t){t.exports=function(t,e,r,n){var i=r[0],a=r[2],o=e[0]-i,s=e[2]-a,l=Math.sin(n),c=Math.cos(n);return t[0]=i+s*l+o*c,t[1]=e[1],t[2]=a+s*c-o*l,t}},8692:function(t){t.exports=function(t,e,r,n){var i=r[0],a=r[1],o=e[0]-i,s=e[1]-a,l=Math.sin(n),c=Math.cos(n);return t[0]=i+o*c-s*l,t[1]=a+o*l+s*c,t[2]=e[2],t}},2447:function(t){t.exports=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t}},6621:function(t){t.exports=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}},8489:function(t){t.exports=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t}},1463:function(t){t.exports=function(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t}},6141:function(t,e,r){t.exports=r(2953)},5486:function(t,e,r){t.exports=r(3066)},2953:function(t){t.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return r*r+n*n+i*i}},3066:function(t){t.exports=function(t){var e=t[0],r=t[1],n=t[2];return e*e+r*r+n*n}},2229:function(t,e,r){t.exports=r(6843)},6843:function(t){t.exports=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}},492:function(t){t.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2];return t[0]=n*r[0]+i*r[3]+a*r[6],t[1]=n*r[1]+i*r[4]+a*r[7],t[2]=n*r[2]+i*r[5]+a*r[8],t}},5673:function(t){t.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[3]*n+r[7]*i+r[11]*a+r[15];return o=o||1,t[0]=(r[0]*n+r[4]*i+r[8]*a+r[12])/o,t[1]=(r[1]*n+r[5]*i+r[9]*a+r[13])/o,t[2]=(r[2]*n+r[6]*i+r[10]*a+r[14])/o,t}},264:function(t){t.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2],c=r[3],u=c*n+s*a-l*i,h=c*i+l*n-o*a,p=c*a+o*i-s*n,f=-o*n-s*i-l*a;return t[0]=u*c+f*-o+h*-l-p*-s,t[1]=h*c+f*-s+p*-o-u*-l,t[2]=p*c+f*-l+u*-s-h*-o,t}},4361:function(t){t.exports=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t}},2335:function(t){t.exports=function(t){var e=new Float32Array(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}},2933:function(t){t.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}},7536:function(t){t.exports=function(){var t=new Float32Array(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}},4691:function(t){t.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],a=e[3]-t[3];return Math.sqrt(r*r+n*n+i*i+a*a)}},1373:function(t){t.exports=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t[3]=e[3]/r[3],t}},3750:function(t){t.exports=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}},3390:function(t){t.exports=function(t,e,r,n){var i=new Float32Array(4);return i[0]=t,i[1]=e,i[2]=r,i[3]=n,i}},9970:function(t,e,r){t.exports={create:r(7536),clone:r(2335),fromValues:r(3390),copy:r(2933),set:r(4578),add:r(4361),subtract:r(6860),multiply:r(3576),divide:r(1373),min:r(2334),max:r(160),scale:r(9288),scaleAndAdd:r(4844),distance:r(4691),squaredDistance:r(7960),length:r(6808),squaredLength:r(483),negate:r(1498),inverse:r(4494),normalize:r(5177),dot:r(3750),lerp:r(2573),random:r(9131),transformMat4:r(5352),transformQuat:r(4041)}},4494:function(t){t.exports=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t}},6808:function(t){t.exports=function(t){var e=t[0],r=t[1],n=t[2],i=t[3];return Math.sqrt(e*e+r*r+n*n+i*i)}},2573:function(t){t.exports=function(t,e,r,n){var i=e[0],a=e[1],o=e[2],s=e[3];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t[2]=o+n*(r[2]-o),t[3]=s+n*(r[3]-s),t}},160:function(t){t.exports=function(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t[3]=Math.max(e[3],r[3]),t}},2334:function(t){t.exports=function(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t[3]=Math.min(e[3],r[3]),t}},3576:function(t){t.exports=function(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t[3]=e[3]*r[3],t}},1498:function(t){t.exports=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t}},5177:function(t){t.exports=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r*r+n*n+i*i+a*a;return o>0&&(o=1/Math.sqrt(o),t[0]=r*o,t[1]=n*o,t[2]=i*o,t[3]=a*o),t}},9131:function(t,e,r){var n=r(5177),i=r(9288);t.exports=function(t,e){return e=e||1,t[0]=Math.random(),t[1]=Math.random(),t[2]=Math.random(),t[3]=Math.random(),n(t,t),i(t,t,e),t}},9288:function(t){t.exports=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}},4844:function(t){t.exports=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t}},4578:function(t){t.exports=function(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}},7960:function(t){t.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],a=e[3]-t[3];return r*r+n*n+i*i+a*a}},483:function(t){t.exports=function(t){var e=t[0],r=t[1],n=t[2],i=t[3];return e*e+r*r+n*n+i*i}},6860:function(t){t.exports=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t}},5352:function(t){t.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,t}},4041:function(t){t.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2],c=r[3],u=c*n+s*a-l*i,h=c*i+l*n-o*a,p=c*a+o*i-s*n,f=-o*n-s*i-l*a;return t[0]=u*c+f*-o+h*-l-p*-s,t[1]=h*c+f*-s+p*-o-u*-l,t[2]=p*c+f*-l+u*-s-h*-o,t[3]=e[3],t}},1848:function(t,e,r){var n=r(4905),i=r(6468);t.exports=function(t){for(var e=Array.isArray(t)?t:n(t),r=0;r0)continue;r=t.slice(0,1).join("")}return j(r),L+=r.length,(S=S.slice(r.length)).length}}function q(){if(/[^\d\w_]/.test(e)){var t=S.join("");return M=B[t]?v:F[t]?y:g,j(S.join("")),M=l,A}return S.push(e),r=e,A+1}};var n=r(620),i=r(7827),a=r(6852),o=r(7932),s=r(3508),l=999,c=9999,u=0,h=1,p=2,f=3,d=4,m=5,g=6,y=7,v=8,x=9,_=10,b=11,w=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"]},3508:function(t,e,r){var n=r(6852);n=n.slice().filter((function(t){return!/^(gl\_|texture)/.test(t)})),t.exports=n.concat(["gl_VertexID","gl_InstanceID","gl_Position","gl_PointSize","gl_FragCoord","gl_FrontFacing","gl_FragDepth","gl_PointCoord","gl_MaxVertexAttribs","gl_MaxVertexUniformVectors","gl_MaxVertexOutputVectors","gl_MaxFragmentInputVectors","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformVectors","gl_MaxDrawBuffers","gl_MinProgramTexelOffset","gl_MaxProgramTexelOffset","gl_DepthRangeParameters","gl_DepthRange","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"])},6852:function(t){t.exports=["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT"]},7932:function(t,e,r){var n=r(620);t.exports=n.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray"])},620:function(t){t.exports=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","uint","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"]},7827:function(t){t.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},4905:function(t,e,r){var n=r(5874);t.exports=function(t,e){var r=n(e),i=[];return(i=i.concat(r(t))).concat(r(null))}},3236:function(t){t.exports=function(t){"string"==typeof t&&(t=[t]);for(var e=[].slice.call(arguments,1),r=[],n=0;n>1,u=-7,h=r?i-1:0,p=r?-1:1,f=t[e+h];for(h+=p,a=f&(1<<-u)-1,f>>=-u,u+=s;u>0;a=256*a+t[e+h],h+=p,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=n;u>0;o=256*o+t[e+h],h+=p,u-=8);if(0===a)a=1-c;else{if(a===l)return o?NaN:1/0*(f?-1:1);o+=Math.pow(2,n),a-=c}return(f?-1:1)*o*Math.pow(2,a-n)},e.write=function(t,e,r,n,i,a){var o,s,l,c=8*a-i-1,u=(1<>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:a-1,d=n?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=u):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),(e+=o+h>=1?p/l:p*Math.pow(2,1-h))*l>=2&&(o++,l/=2),o+h>=u?(s=0,o=u):o+h>=1?(s=(e*l-1)*Math.pow(2,i),o+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;t[r+f]=255&s,f+=d,s/=256,i-=8);for(o=o<0;t[r+f]=255&o,f+=d,o/=256,c-=8);t[r+f-d]|=128*m}},8954:function(t,e,r){t.exports=function(t,e){var r=t.length;if(0===r)throw new Error("Must have at least d+1 points");var i=t[0].length;if(r<=i)throw new Error("Must input at least d+1 points");var o=t.slice(0,i+1),s=n.apply(void 0,o);if(0===s)throw new Error("Input not in general position");for(var l=new Array(i+1),u=0;u<=i;++u)l[u]=u;s<0&&(l[0]=1,l[1]=0);var h=new a(l,new Array(i+1),!1),p=h.adjacent,f=new Array(i+2);for(u=0;u<=i;++u){for(var d=l.slice(),m=0;m<=i;++m)m===u&&(d[m]=-1);var g=d[0];d[0]=d[1],d[1]=g;var y=new a(d,new Array(i+1),!0);p[u]=y,f[u]=y}for(f[i+1]=h,u=0;u<=i;++u){d=p[u].vertices;var v=p[u].adjacent;for(m=0;m<=i;++m){var x=d[m];if(x<0)v[m]=h;else for(var _=0;_<=i;++_)p[_].vertices.indexOf(x)<0&&(v[m]=p[_])}}var b=new c(i,o,f),w=!!e;for(u=i+1;u0;)for(var s=(t=o.pop()).adjacent,l=0;l<=r;++l){var c=s[l];if(c.boundary&&!(c.lastVisited<=-n)){for(var u=c.vertices,h=0;h<=r;++h){var p=u[h];i[h]=p<0?e:a[p]}var f=this.orient();if(f>0)return c;c.lastVisited=-n,0===f&&o.push(c)}}return null},u.walk=function(t,e){var r=this.vertices.length-1,n=this.dimension,i=this.vertices,a=this.tuple,o=e?this.interior.length*Math.random()|0:this.interior.length-1,s=this.interior[o];t:for(;!s.boundary;){for(var l=s.vertices,c=s.adjacent,u=0;u<=n;++u)a[u]=i[l[u]];for(s.lastVisited=r,u=0;u<=n;++u){var h=c[u];if(!(h.lastVisited>=r)){var p=a[u];a[u]=t;var f=this.orient();if(a[u]=p,f<0){s=h;continue t}h.boundary?h.lastVisited=-r:h.lastVisited=r}}return}return s},u.addPeaks=function(t,e){var r=this.vertices.length-1,n=this.dimension,i=this.vertices,l=this.tuple,c=this.interior,u=this.simplices,h=[e];e.lastVisited=r,e.vertices[e.vertices.indexOf(-1)]=r,e.boundary=!1,c.push(e);for(var p=[];h.length>0;){var f=(e=h.pop()).vertices,d=e.adjacent,m=f.indexOf(r);if(!(m<0))for(var g=0;g<=n;++g)if(g!==m){var y=d[g];if(y.boundary&&!(y.lastVisited>=r)){var v=y.vertices;if(y.lastVisited!==-r){for(var x=0,_=0;_<=n;++_)v[_]<0?(x=_,l[_]=t):l[_]=i[v[_]];if(this.orient()>0){v[x]=r,y.boundary=!1,c.push(y),h.push(y),y.lastVisited=r;continue}y.lastVisited=-r}var b=y.adjacent,w=f.slice(),T=d.slice(),A=new a(w,T,!0);u.push(A);var k=b.indexOf(e);if(!(k<0))for(b[k]=A,T[m]=y,w[g]=-1,T[g]=e,d[g]=A,A.flip(),_=0;_<=n;++_){var M=w[_];if(!(M<0||M===r)){for(var S=new Array(n-1),E=0,C=0;C<=n;++C){var I=w[C];I<0||C===_||(S[E++]=I)}p.push(new o(S,A,_))}}}}}for(p.sort(s),g=0;g+1=0?o[l++]=s[u]:c=1&u;if(c===(1&t)){var h=o[0];o[0]=o[1],o[1]=h}e.push(o)}}return e}},3352:function(t,e,r){var n=r(2478);function i(t,e,r,n,i){this.mid=t,this.left=e,this.right=r,this.leftPoints=n,this.rightPoints=i,this.count=(e?e.count:0)+(r?r.count:0)+n.length}t.exports=function(t){return t&&0!==t.length?new y(g(t)):new y(null)};var a=i.prototype;function o(t,e){t.mid=e.mid,t.left=e.left,t.right=e.right,t.leftPoints=e.leftPoints,t.rightPoints=e.rightPoints,t.count=e.count}function s(t,e){var r=g(e);t.mid=r.mid,t.left=r.left,t.right=r.right,t.leftPoints=r.leftPoints,t.rightPoints=r.rightPoints,t.count=r.count}function l(t,e){var r=t.intervals([]);r.push(e),s(t,r)}function c(t,e){var r=t.intervals([]),n=r.indexOf(e);return n<0?0:(r.splice(n,1),s(t,r),1)}function u(t,e,r){for(var n=0;n=0&&t[n][1]>=e;--n){var i=r(t[n]);if(i)return i}}function p(t,e){for(var r=0;r>1],a=[],o=[],s=[];for(r=0;r3*(e+1)?l(this,t):this.left.insert(t):this.left=g([t]);else if(t[0]>this.mid)this.right?4*(this.right.count+1)>3*(e+1)?l(this,t):this.right.insert(t):this.right=g([t]);else{var r=n.ge(this.leftPoints,t,d),i=n.ge(this.rightPoints,t,m);this.leftPoints.splice(r,0,t),this.rightPoints.splice(i,0,t)}},a.remove=function(t){var e=this.count-this.leftPoints;if(t[1]3*(e-1)?c(this,t):2===(s=this.left.remove(t))?(this.left=null,this.count-=1,1):(1===s&&(this.count-=1),s):0;if(t[0]>this.mid)return this.right?4*(this.left?this.left.count:0)>3*(e-1)?c(this,t):2===(s=this.right.remove(t))?(this.right=null,this.count-=1,1):(1===s&&(this.count-=1),s):0;if(1===this.count)return this.leftPoints[0]===t?2:0;if(1===this.leftPoints.length&&this.leftPoints[0]===t){if(this.left&&this.right){for(var r=this,i=this.left;i.right;)r=i,i=i.right;if(r===this)i.right=this.right;else{var a=this.left,s=this.right;r.count-=i.count,r.right=i.left,i.left=a,i.right=s}o(this,i),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?o(this,this.left):o(this,this.right);return 1}for(a=n.ge(this.leftPoints,t,d);athis.mid?this.right&&(r=this.right.queryPoint(t,e))?r:h(this.rightPoints,t,e):p(this.leftPoints,e);var r},a.queryInterval=function(t,e,r){var n;return tthis.mid&&this.right&&(n=this.right.queryInterval(t,e,r))?n:ethis.mid?h(this.rightPoints,t,r):p(this.leftPoints,r)};var v=y.prototype;v.insert=function(t){this.root?this.root.insert(t):this.root=new i(t[0],null,null,[t],[t])},v.remove=function(t){if(this.root){var e=this.root.remove(t);return 2===e&&(this.root=null),0!==e}return!1},v.queryPoint=function(t,e){if(this.root)return this.root.queryPoint(t,e)},v.queryInterval=function(t,e,r){if(t<=e&&this.root)return this.root.queryInterval(t,e,r)},Object.defineProperty(v,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(v,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}})},9507:function(t){t.exports=!0},7163:function(t){function e(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}t.exports=function(t){return null!=t&&(e(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&e(t.slice(0,0))}(t)||!!t._isBuffer)}},5219:function(t){t.exports=function(t){for(var e,r=t.length,n=0;n13)&&32!==e&&133!==e&&160!==e&&5760!==e&&6158!==e&&(e<8192||e>8205)&&8232!==e&&8233!==e&&8239!==e&&8287!==e&&8288!==e&&12288!==e&&65279!==e)return!1;return!0}},395:function(t){t.exports=function(t,e,r){return t*(1-r)+e*r}},2652:function(t,e,r){var n=r(4335),i=r(6864),a=r(1903),o=r(9921),s=r(7608),l=r(5665),c={length:r(1387),normalize:r(3536),dot:r(244),cross:r(5911)},u=i(),h=i(),p=[0,0,0,0],f=[[0,0,0],[0,0,0],[0,0,0]],d=[0,0,0];function m(t,e,r,n,i){t[0]=e[0]*n+r[0]*i,t[1]=e[1]*n+r[1]*i,t[2]=e[2]*n+r[2]*i}t.exports=function(t,e,r,i,g,y){if(e||(e=[0,0,0]),r||(r=[0,0,0]),i||(i=[0,0,0]),g||(g=[0,0,0,1]),y||(y=[0,0,0,1]),!n(u,t)||(a(h,u),h[3]=0,h[7]=0,h[11]=0,h[15]=1,Math.abs(o(h)<1e-8)))return!1;var v=u[3],x=u[7],_=u[11],b=u[12],w=u[13],T=u[14],A=u[15];if(0!==v||0!==x||0!==_){if(p[0]=v,p[1]=x,p[2]=_,p[3]=A,!s(h,h))return!1;l(h,h),function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3];t[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o}(g,p,h)}else g[0]=g[1]=g[2]=0,g[3]=1;if(e[0]=b,e[1]=w,e[2]=T,function(t,e){t[0][0]=e[0],t[0][1]=e[1],t[0][2]=e[2],t[1][0]=e[4],t[1][1]=e[5],t[1][2]=e[6],t[2][0]=e[8],t[2][1]=e[9],t[2][2]=e[10]}(f,u),r[0]=c.length(f[0]),c.normalize(f[0],f[0]),i[0]=c.dot(f[0],f[1]),m(f[1],f[1],f[0],1,-i[0]),r[1]=c.length(f[1]),c.normalize(f[1],f[1]),i[0]/=r[1],i[1]=c.dot(f[0],f[2]),m(f[2],f[2],f[0],1,-i[1]),i[2]=c.dot(f[1],f[2]),m(f[2],f[2],f[1],1,-i[2]),r[2]=c.length(f[2]),c.normalize(f[2],f[2]),i[1]/=r[2],i[2]/=r[2],c.cross(d,f[1],f[2]),c.dot(f[0],d)<0)for(var k=0;k<3;k++)r[k]*=-1,f[k][0]*=-1,f[k][1]*=-1,f[k][2]*=-1;return y[0]=.5*Math.sqrt(Math.max(1+f[0][0]-f[1][1]-f[2][2],0)),y[1]=.5*Math.sqrt(Math.max(1-f[0][0]+f[1][1]-f[2][2],0)),y[2]=.5*Math.sqrt(Math.max(1-f[0][0]-f[1][1]+f[2][2],0)),y[3]=.5*Math.sqrt(Math.max(1+f[0][0]+f[1][1]+f[2][2],0)),f[2][1]>f[1][2]&&(y[0]=-y[0]),f[0][2]>f[2][0]&&(y[1]=-y[1]),f[1][0]>f[0][1]&&(y[2]=-y[2]),!0}},4335:function(t){t.exports=function(t,e){var r=e[15];if(0===r)return!1;for(var n=1/r,i=0;i<16;i++)t[i]=e[i]*n;return!0}},7442:function(t,e,r){var n=r(6658),i=r(7182),a=r(2652),o=r(9921),s=r(8648),l=h(),c=h(),u=h();function h(){return{translate:p(),scale:p(1),skew:p(),perspective:[0,0,0,1],quaternion:[0,0,0,1]}}function p(t){return[t||0,t||0,t||0]}t.exports=function(t,e,r,h){if(0===o(e)||0===o(r))return!1;var p=a(e,l.translate,l.scale,l.skew,l.perspective,l.quaternion),f=a(r,c.translate,c.scale,c.skew,c.perspective,c.quaternion);return!(!p||!f||(n(u.translate,l.translate,c.translate,h),n(u.skew,l.skew,c.skew,h),n(u.scale,l.scale,c.scale,h),n(u.perspective,l.perspective,c.perspective,h),s(u.quaternion,l.quaternion,c.quaternion,h),i(t,u.translate,u.scale,u.skew,u.perspective,u.quaternion),0))}},7182:function(t,e,r){var n={identity:r(7894),translate:r(7656),multiply:r(6760),create:r(6864),scale:r(2504),fromRotationTranslation:r(6743)},i=(n.create(),n.create());t.exports=function(t,e,r,a,o,s){return n.identity(t),n.fromRotationTranslation(t,s,e),t[3]=o[0],t[7]=o[1],t[11]=o[2],t[15]=o[3],n.identity(i),0!==a[2]&&(i[9]=a[2],n.multiply(t,t,i)),0!==a[1]&&(i[9]=0,i[8]=a[1],n.multiply(t,t,i)),0!==a[0]&&(i[8]=0,i[4]=a[0],n.multiply(t,t,i)),n.scale(t,t,r),t}},1811:function(t,e,r){var n=r(2478),i=r(7442),a=r(7608),o=r(5567),s=r(2408),l=r(7089),c=r(6582),u=r(7656),h=(r(2504),r(3536)),p=[0,0,0];function f(t){this._components=t.slice(),this._time=[0],this.prevMatrix=t.slice(),this.nextMatrix=t.slice(),this.computedMatrix=t.slice(),this.computedInverse=t.slice(),this.computedEye=[0,0,0],this.computedUp=[0,0,0],this.computedCenter=[0,0,0],this.computedRadius=[0],this._limits=[-1/0,1/0]}t.exports=function(t){return new f((t=t||{}).matrix||[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])};var d=f.prototype;d.recalcMatrix=function(t){var e=this._time,r=n.le(e,t),o=this.computedMatrix;if(!(r<0)){var s=this._components;if(r===e.length-1)for(var l=16*r,c=0;c<16;++c)o[c]=s[l++];else{var u=e[r+1]-e[r],p=(l=16*r,this.prevMatrix),f=!0;for(c=0;c<16;++c)p[c]=s[l++];var d=this.nextMatrix;for(c=0;c<16;++c)d[c]=s[l++],f=f&&p[c]===d[c];if(u<1e-6||f)for(c=0;c<16;++c)o[c]=p[c];else i(o,p,d,(t-e[r])/u)}var m=this.computedUp;m[0]=o[1],m[1]=o[5],m[2]=o[9],h(m,m);var g=this.computedInverse;a(g,o);var y=this.computedEye,v=g[15];y[0]=g[12]/v,y[1]=g[13]/v,y[2]=g[14]/v;var x=this.computedCenter,_=Math.exp(this.computedRadius[0]);for(c=0;c<3;++c)x[c]=y[c]-o[2+4*c]*_}},d.idle=function(t){if(!(t1&&n(t[o[u-2]],t[o[u-1]],c)<=0;)u-=1,o.pop();for(o.push(l),u=s.length;u>1&&n(t[s[u-2]],t[s[u-1]],c)>=0;)u-=1,s.pop();s.push(l)}r=new Array(s.length+o.length-2);for(var h=0,p=(i=0,o.length);i0;--f)r[h++]=s[f];return r};var n=r(3250)[3]},351:function(t,e,r){t.exports=function(t,e){e||(e=t,t=window);var r=0,i=0,a=0,o={shift:!1,alt:!1,control:!1,meta:!1},s=!1;function l(t){var e=!1;return"altKey"in t&&(e=e||t.altKey!==o.alt,o.alt=!!t.altKey),"shiftKey"in t&&(e=e||t.shiftKey!==o.shift,o.shift=!!t.shiftKey),"ctrlKey"in t&&(e=e||t.ctrlKey!==o.control,o.control=!!t.ctrlKey),"metaKey"in t&&(e=e||t.metaKey!==o.meta,o.meta=!!t.metaKey),e}function c(t,s){var c=n.x(s),u=n.y(s);"buttons"in s&&(t=0|s.buttons),(t!==r||c!==i||u!==a||l(s))&&(r=0|t,i=c||0,a=u||0,e&&e(r,i,a,o))}function u(t){c(0,t)}function h(){(r||i||a||o.shift||o.alt||o.meta||o.control)&&(i=a=0,r=0,o.shift=o.alt=o.control=o.meta=!1,e&&e(0,0,0,o))}function p(t){l(t)&&e&&e(r,i,a,o)}function f(t){0===n.buttons(t)?c(0,t):c(r,t)}function d(t){c(r|n.buttons(t),t)}function m(t){c(r&~n.buttons(t),t)}function g(){s||(s=!0,t.addEventListener("mousemove",f),t.addEventListener("mousedown",d),t.addEventListener("mouseup",m),t.addEventListener("mouseleave",u),t.addEventListener("mouseenter",u),t.addEventListener("mouseout",u),t.addEventListener("mouseover",u),t.addEventListener("blur",h),t.addEventListener("keyup",p),t.addEventListener("keydown",p),t.addEventListener("keypress",p),t!==window&&(window.addEventListener("blur",h),window.addEventListener("keyup",p),window.addEventListener("keydown",p),window.addEventListener("keypress",p)))}g();var y={element:t};return Object.defineProperties(y,{enabled:{get:function(){return s},set:function(e){e?g():s&&(s=!1,t.removeEventListener("mousemove",f),t.removeEventListener("mousedown",d),t.removeEventListener("mouseup",m),t.removeEventListener("mouseleave",u),t.removeEventListener("mouseenter",u),t.removeEventListener("mouseout",u),t.removeEventListener("mouseover",u),t.removeEventListener("blur",h),t.removeEventListener("keyup",p),t.removeEventListener("keydown",p),t.removeEventListener("keypress",p),t!==window&&(window.removeEventListener("blur",h),window.removeEventListener("keyup",p),window.removeEventListener("keydown",p),window.removeEventListener("keypress",p)))},enumerable:!0},buttons:{get:function(){return r},enumerable:!0},x:{get:function(){return i},enumerable:!0},y:{get:function(){return a},enumerable:!0},mods:{get:function(){return o},enumerable:!0}}),y};var n=r(4687)},24:function(t){var e={left:0,top:0};t.exports=function(t,r,n){r=r||t.currentTarget||t.srcElement,Array.isArray(n)||(n=[0,0]);var i=t.clientX||0,a=t.clientY||0,o=function(t){return t===window||t===document||t===document.body?e:t.getBoundingClientRect()}(r);return n[0]=i-o.left,n[1]=a-o.top,n}},4687:function(t,e){function r(t){return t.target||t.srcElement||window}e.buttons=function(t){if("object"==typeof t){if("buttons"in t)return t.buttons;if("which"in t){if(2===(e=t.which))return 4;if(3===e)return 2;if(e>0)return 1<=0)return 1< 0"),"function"!=typeof t.vertex&&e("Must specify vertex creation function"),"function"!=typeof t.cell&&e("Must specify cell creation function"),"function"!=typeof t.phase&&e("Must specify phase function");for(var o=t.getters||[],s=new Array(a),l=0;l=0?s[l]=!0:s[l]=!1;return function(t,e,r,a,o,s){var l=[s,o].join(",");return(0,i[l])(t,e,r,n.mallocUint32,n.freeUint32)}(t.vertex,t.cell,t.phase,0,r,s)};var i={"false,0,1":function(t,e,r,n,i){return function(a,o,s,l){var c,u=0|a.shape[0],h=0|a.shape[1],p=a.data,f=0|a.offset,d=0|a.stride[0],m=0|a.stride[1],g=f,y=0|-d,v=0,x=0|-m,_=0,b=-d-m|0,w=0,T=0|d,A=m-d*u|0,k=0,M=0,S=0,E=2*u|0,C=n(E),I=n(E),L=0,P=0,z=-1,D=-1,O=0,R=0|-u,F=0|u,B=0,j=-u-1|0,N=u-1|0,U=0,V=0,q=0;for(k=0;k0){if(M=1,C[L++]=r(p[g],o,s,l),g+=T,u>0)for(k=1,c=p[g],P=C[L]=r(c,o,s,l),O=C[L+z],B=C[L+R],U=C[L+j],(P!==O||P!==B||P!==U)&&(v=p[g+y],_=p[g+x],w=p[g+b],t(k,M,c,v,_,w,P,O,B,U,o,s,l),V=I[L]=S++),L+=1,g+=T,k=2;k0)for(k=1,c=p[g],P=C[L]=r(c,o,s,l),O=C[L+z],B=C[L+R],U=C[L+j],(P!==O||P!==B||P!==U)&&(v=p[g+y],_=p[g+x],w=p[g+b],t(k,M,c,v,_,w,P,O,B,U,o,s,l),V=I[L]=S++,U!==B&&e(I[L+R],V,_,w,B,U,o,s,l)),L+=1,g+=T,k=2;k0){if(k=1,C[L++]=r(p[g],o,s,l),g+=T,h>0)for(M=1,c=p[g],P=C[L]=r(c,o,s,l),B=C[L+R],O=C[L+z],U=C[L+j],(P!==B||P!==O||P!==U)&&(v=p[g+y],_=p[g+x],w=p[g+b],t(k,M,c,v,_,w,P,B,O,U,o,s,l),V=I[L]=S++),L+=1,g+=T,M=2;M0)for(M=1,c=p[g],P=C[L]=r(c,o,s,l),B=C[L+R],O=C[L+z],U=C[L+j],(P!==B||P!==O||P!==U)&&(v=p[g+y],_=p[g+x],w=p[g+b],t(k,M,c,v,_,w,P,B,O,U,o,s,l),V=I[L]=S++,U!==B&&e(I[L+R],V,w,v,U,B,o,s,l)),L+=1,g+=T,M=2;M2&&a[1]>2&&n(i.pick(-1,-1).lo(1,1).hi(a[0]-2,a[1]-2),t.pick(-1,-1,0).lo(1,1).hi(a[0]-2,a[1]-2),t.pick(-1,-1,1).lo(1,1).hi(a[0]-2,a[1]-2)),a[1]>2&&(r(i.pick(0,-1).lo(1).hi(a[1]-2),t.pick(0,-1,1).lo(1).hi(a[1]-2)),e(t.pick(0,-1,0).lo(1).hi(a[1]-2))),a[1]>2&&(r(i.pick(a[0]-1,-1).lo(1).hi(a[1]-2),t.pick(a[0]-1,-1,1).lo(1).hi(a[1]-2)),e(t.pick(a[0]-1,-1,0).lo(1).hi(a[1]-2))),a[0]>2&&(r(i.pick(-1,0).lo(1).hi(a[0]-2),t.pick(-1,0,0).lo(1).hi(a[0]-2)),e(t.pick(-1,0,1).lo(1).hi(a[0]-2))),a[0]>2&&(r(i.pick(-1,a[1]-1).lo(1).hi(a[0]-2),t.pick(-1,a[1]-1,0).lo(1).hi(a[0]-2)),e(t.pick(-1,a[1]-1,1).lo(1).hi(a[0]-2))),t.set(0,0,0,0),t.set(0,0,1,0),t.set(a[0]-1,0,0,0),t.set(a[0]-1,0,1,0),t.set(0,a[1]-1,0,0),t.set(0,a[1]-1,1,0),t.set(a[0]-1,a[1]-1,0,0),t.set(a[0]-1,a[1]-1,1,0),t}}t.exports=function(t,e,r){if(Array.isArray(r)||(r=n(e.dimension,"string"==typeof r?r:"clamp")),0===e.size)return t;if(0===e.dimension)return t.set(0),t;var i=function(t){var e=t.join();if(a=u[e])return a;for(var r=t.length,n=[h,p],i=1;i<=r;++i)n.push(f(i));var a=d.apply(void 0,n);return u[e]=a,a}(r);return i(t,e)}},4317:function(t){function e(t,e){var r=Math.floor(e),n=e-r,i=0<=r&&r0;){x<64?(l=x,x=0):(l=64,x-=64);for(var _=0|t[1];_>0;){_<64?(c=_,_=0):(c=64,_-=64),n=y+x*h+_*p,o=v+x*d+_*m;var b=0,w=0,T=0,A=f,k=h-u*f,M=p-l*h,S=g,E=d-u*g,C=m-l*d;for(T=0;T0;){m<64?(l=m,m=0):(l=64,m-=64);for(var g=0|t[0];g>0;){g<64?(s=g,g=0):(s=64,g-=64),n=f+m*u+g*c,o=d+m*p+g*h;var y=0,v=0,x=u,_=c-l*u,b=p,w=h-l*p;for(v=0;v0;){v<64?(c=v,v=0):(c=64,v-=64);for(var x=0|t[0];x>0;){x<64?(s=x,x=0):(s=64,x-=64);for(var _=0|t[1];_>0;){_<64?(l=_,_=0):(l=64,_-=64),n=g+v*p+x*u+_*h,o=y+v*m+x*f+_*d;var b=0,w=0,T=0,A=p,k=u-c*p,M=h-s*u,S=m,E=f-c*m,C=d-s*f;for(T=0;Tr;){y=0,v=m-o;e:for(g=0;g_)break e;v+=h,y+=p}for(y=m,v=m-o,g=0;g>1,H=q-N,G=q+N,W=U,Z=H,Y=q,X=G,$=V,K=i+1,J=a-1,Q=!0,tt=0,et=0,rt=0,nt=h,it=e(nt),at=e(nt);k=l*W,M=l*Z,j=s;t:for(A=0;A0){g=W,W=Z,Z=g;break t}if(rt<0)break t;j+=f}k=l*X,M=l*$,j=s;t:for(A=0;A0){g=X,X=$,$=g;break t}if(rt<0)break t;j+=f}k=l*W,M=l*Y,j=s;t:for(A=0;A0){g=W,W=Y,Y=g;break t}if(rt<0)break t;j+=f}k=l*Z,M=l*Y,j=s;t:for(A=0;A0){g=Z,Z=Y,Y=g;break t}if(rt<0)break t;j+=f}k=l*W,M=l*X,j=s;t:for(A=0;A0){g=W,W=X,X=g;break t}if(rt<0)break t;j+=f}k=l*Y,M=l*X,j=s;t:for(A=0;A0){g=Y,Y=X,X=g;break t}if(rt<0)break t;j+=f}k=l*Z,M=l*$,j=s;t:for(A=0;A0){g=Z,Z=$,$=g;break t}if(rt<0)break t;j+=f}k=l*Z,M=l*Y,j=s;t:for(A=0;A0){g=Z,Z=Y,Y=g;break t}if(rt<0)break t;j+=f}k=l*X,M=l*$,j=s;t:for(A=0;A0){g=X,X=$,$=g;break t}if(rt<0)break t;j+=f}for(k=l*W,M=l*Z,S=l*Y,E=l*X,C=l*$,I=l*U,L=l*q,P=l*V,B=0,j=s,A=0;A0)){if(rt<0){for(k=l*_,M=l*K,S=l*J,j=s,A=0;A0)for(;;){for(b=s+J*l,B=0,A=0;A0)){for(b=s+J*l,B=0,A=0;AV){t:for(;;){for(b=s+K*l,B=0,j=s,A=0;A1&&n?s(r,n[0],n[1]):s(r)}(t,e,l);return n(l,c)}},446:function(t,e,r){var n=r(7640),i={};t.exports=function(t){var e=t.order,r=t.dtype,a=[e,r].join(":"),o=i[a];return o||(i[a]=o=n(e,r)),o(t),t}},9618:function(t,e,r){var n=r(7163),i=typeof Float64Array<"u";function a(t,e){return t[0]-e[0]}function o(){var t,e=this.stride,r=new Array(e.length);for(t=0;t=0&&(e+=a*(r=0|t),i-=r),new n(this.data,i,a,e)},i.step=function(t){var e=this.shape[0],r=this.stride[0],i=this.offset,a=0,o=Math.ceil;return"number"==typeof t&&((a=0|t)<0?(i+=r*(e-1),e=o(-e/a)):e=o(e/a),r*=a),new n(this.data,e,r,i)},i.transpose=function(t){t=void 0===t?0:0|t;var e=this.shape,r=this.stride;return new n(this.data,e[t],r[t],this.offset)},i.pick=function(t){var r=[],n=[],i=this.offset;return"number"==typeof t&&t>=0?i=i+this.stride[0]*t|0:(r.push(this.shape[0]),n.push(this.stride[0])),(0,e[r.length+1])(this.data,r,n,i)},function(t,e,r,i){return new n(t,e[0],r[0],i)}},2:function(t,e,r){function n(t,e,r,n,i,a){this.data=t,this.shape=[e,r],this.stride=[n,i],this.offset=0|a}var i=n.prototype;return i.dtype=t,i.dimension=2,Object.defineProperty(i,"size",{get:function(){return this.shape[0]*this.shape[1]}}),Object.defineProperty(i,"order",{get:function(){return Math.abs(this.stride[0])>Math.abs(this.stride[1])?[1,0]:[0,1]}}),i.set=function(e,r,n){return"generic"===t?this.data.set(this.offset+this.stride[0]*e+this.stride[1]*r,n):this.data[this.offset+this.stride[0]*e+this.stride[1]*r]=n},i.get=function(e,r){return"generic"===t?this.data.get(this.offset+this.stride[0]*e+this.stride[1]*r):this.data[this.offset+this.stride[0]*e+this.stride[1]*r]},i.index=function(t,e){return this.offset+this.stride[0]*t+this.stride[1]*e},i.hi=function(t,e){return new n(this.data,"number"!=typeof t||t<0?this.shape[0]:0|t,"number"!=typeof e||e<0?this.shape[1]:0|e,this.stride[0],this.stride[1],this.offset)},i.lo=function(t,e){var r=this.offset,i=0,a=this.shape[0],o=this.shape[1],s=this.stride[0],l=this.stride[1];return"number"==typeof t&&t>=0&&(r+=s*(i=0|t),a-=i),"number"==typeof e&&e>=0&&(r+=l*(i=0|e),o-=i),new n(this.data,a,o,s,l,r)},i.step=function(t,e){var r=this.shape[0],i=this.shape[1],a=this.stride[0],o=this.stride[1],s=this.offset,l=0,c=Math.ceil;return"number"==typeof t&&((l=0|t)<0?(s+=a*(r-1),r=c(-r/l)):r=c(r/l),a*=l),"number"==typeof e&&((l=0|e)<0?(s+=o*(i-1),i=c(-i/l)):i=c(i/l),o*=l),new n(this.data,r,i,a,o,s)},i.transpose=function(t,e){t=void 0===t?0:0|t,e=void 0===e?1:0|e;var r=this.shape,i=this.stride;return new n(this.data,r[t],r[e],i[t],i[e],this.offset)},i.pick=function(t,r){var n=[],i=[],a=this.offset;return"number"==typeof t&&t>=0?a=a+this.stride[0]*t|0:(n.push(this.shape[0]),i.push(this.stride[0])),"number"==typeof r&&r>=0?a=a+this.stride[1]*r|0:(n.push(this.shape[1]),i.push(this.stride[1])),(0,e[n.length+1])(this.data,n,i,a)},function(t,e,r,i){return new n(t,e[0],e[1],r[0],r[1],i)}},3:function(t,e,r){function n(t,e,r,n,i,a,o,s){this.data=t,this.shape=[e,r,n],this.stride=[i,a,o],this.offset=0|s}var i=n.prototype;return i.dtype=t,i.dimension=3,Object.defineProperty(i,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]}}),Object.defineProperty(i,"order",{get:function(){var t=Math.abs(this.stride[0]),e=Math.abs(this.stride[1]),r=Math.abs(this.stride[2]);return t>e?e>r?[2,1,0]:t>r?[1,2,0]:[1,0,2]:t>r?[2,0,1]:r>e?[0,1,2]:[0,2,1]}}),i.set=function(e,r,n,i){return"generic"===t?this.data.set(this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n,i):this.data[this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n]=i},i.get=function(e,r,n){return"generic"===t?this.data.get(this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n):this.data[this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n]},i.index=function(t,e,r){return this.offset+this.stride[0]*t+this.stride[1]*e+this.stride[2]*r},i.hi=function(t,e,r){return new n(this.data,"number"!=typeof t||t<0?this.shape[0]:0|t,"number"!=typeof e||e<0?this.shape[1]:0|e,"number"!=typeof r||r<0?this.shape[2]:0|r,this.stride[0],this.stride[1],this.stride[2],this.offset)},i.lo=function(t,e,r){var i=this.offset,a=0,o=this.shape[0],s=this.shape[1],l=this.shape[2],c=this.stride[0],u=this.stride[1],h=this.stride[2];return"number"==typeof t&&t>=0&&(i+=c*(a=0|t),o-=a),"number"==typeof e&&e>=0&&(i+=u*(a=0|e),s-=a),"number"==typeof r&&r>=0&&(i+=h*(a=0|r),l-=a),new n(this.data,o,s,l,c,u,h,i)},i.step=function(t,e,r){var i=this.shape[0],a=this.shape[1],o=this.shape[2],s=this.stride[0],l=this.stride[1],c=this.stride[2],u=this.offset,h=0,p=Math.ceil;return"number"==typeof t&&((h=0|t)<0?(u+=s*(i-1),i=p(-i/h)):i=p(i/h),s*=h),"number"==typeof e&&((h=0|e)<0?(u+=l*(a-1),a=p(-a/h)):a=p(a/h),l*=h),"number"==typeof r&&((h=0|r)<0?(u+=c*(o-1),o=p(-o/h)):o=p(o/h),c*=h),new n(this.data,i,a,o,s,l,c,u)},i.transpose=function(t,e,r){t=void 0===t?0:0|t,e=void 0===e?1:0|e,r=void 0===r?2:0|r;var i=this.shape,a=this.stride;return new n(this.data,i[t],i[e],i[r],a[t],a[e],a[r],this.offset)},i.pick=function(t,r,n){var i=[],a=[],o=this.offset;return"number"==typeof t&&t>=0?o=o+this.stride[0]*t|0:(i.push(this.shape[0]),a.push(this.stride[0])),"number"==typeof r&&r>=0?o=o+this.stride[1]*r|0:(i.push(this.shape[1]),a.push(this.stride[1])),"number"==typeof n&&n>=0?o=o+this.stride[2]*n|0:(i.push(this.shape[2]),a.push(this.stride[2])),(0,e[i.length+1])(this.data,i,a,o)},function(t,e,r,i){return new n(t,e[0],e[1],e[2],r[0],r[1],r[2],i)}},4:function(t,e,r){function n(t,e,r,n,i,a,o,s,l,c){this.data=t,this.shape=[e,r,n,i],this.stride=[a,o,s,l],this.offset=0|c}var i=n.prototype;return i.dtype=t,i.dimension=4,Object.defineProperty(i,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]}}),Object.defineProperty(i,"order",{get:r}),i.set=function(e,r,n,i,a){return"generic"===t?this.data.set(this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i,a):this.data[this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i]=a},i.get=function(e,r,n,i){return"generic"===t?this.data.get(this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i):this.data[this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i]},i.index=function(t,e,r,n){return this.offset+this.stride[0]*t+this.stride[1]*e+this.stride[2]*r+this.stride[3]*n},i.hi=function(t,e,r,i){return new n(this.data,"number"!=typeof t||t<0?this.shape[0]:0|t,"number"!=typeof e||e<0?this.shape[1]:0|e,"number"!=typeof r||r<0?this.shape[2]:0|r,"number"!=typeof i||i<0?this.shape[3]:0|i,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.offset)},i.lo=function(t,e,r,i){var a=this.offset,o=0,s=this.shape[0],l=this.shape[1],c=this.shape[2],u=this.shape[3],h=this.stride[0],p=this.stride[1],f=this.stride[2],d=this.stride[3];return"number"==typeof t&&t>=0&&(a+=h*(o=0|t),s-=o),"number"==typeof e&&e>=0&&(a+=p*(o=0|e),l-=o),"number"==typeof r&&r>=0&&(a+=f*(o=0|r),c-=o),"number"==typeof i&&i>=0&&(a+=d*(o=0|i),u-=o),new n(this.data,s,l,c,u,h,p,f,d,a)},i.step=function(t,e,r,i){var a=this.shape[0],o=this.shape[1],s=this.shape[2],l=this.shape[3],c=this.stride[0],u=this.stride[1],h=this.stride[2],p=this.stride[3],f=this.offset,d=0,m=Math.ceil;return"number"==typeof t&&((d=0|t)<0?(f+=c*(a-1),a=m(-a/d)):a=m(a/d),c*=d),"number"==typeof e&&((d=0|e)<0?(f+=u*(o-1),o=m(-o/d)):o=m(o/d),u*=d),"number"==typeof r&&((d=0|r)<0?(f+=h*(s-1),s=m(-s/d)):s=m(s/d),h*=d),"number"==typeof i&&((d=0|i)<0?(f+=p*(l-1),l=m(-l/d)):l=m(l/d),p*=d),new n(this.data,a,o,s,l,c,u,h,p,f)},i.transpose=function(t,e,r,i){t=void 0===t?0:0|t,e=void 0===e?1:0|e,r=void 0===r?2:0|r,i=void 0===i?3:0|i;var a=this.shape,o=this.stride;return new n(this.data,a[t],a[e],a[r],a[i],o[t],o[e],o[r],o[i],this.offset)},i.pick=function(t,r,n,i){var a=[],o=[],s=this.offset;return"number"==typeof t&&t>=0?s=s+this.stride[0]*t|0:(a.push(this.shape[0]),o.push(this.stride[0])),"number"==typeof r&&r>=0?s=s+this.stride[1]*r|0:(a.push(this.shape[1]),o.push(this.stride[1])),"number"==typeof n&&n>=0?s=s+this.stride[2]*n|0:(a.push(this.shape[2]),o.push(this.stride[2])),"number"==typeof i&&i>=0?s=s+this.stride[3]*i|0:(a.push(this.shape[3]),o.push(this.stride[3])),(0,e[a.length+1])(this.data,a,o,s)},function(t,e,r,i){return new n(t,e[0],e[1],e[2],e[3],r[0],r[1],r[2],r[3],i)}},5:function(t,e,r){function n(t,e,r,n,i,a,o,s,l,c,u,h){this.data=t,this.shape=[e,r,n,i,a],this.stride=[o,s,l,c,u],this.offset=0|h}var i=n.prototype;return i.dtype=t,i.dimension=5,Object.defineProperty(i,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]*this.shape[4]}}),Object.defineProperty(i,"order",{get:r}),i.set=function(e,r,n,i,a,o){return"generic"===t?this.data.set(this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i+this.stride[4]*a,o):this.data[this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i+this.stride[4]*a]=o},i.get=function(e,r,n,i,a){return"generic"===t?this.data.get(this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i+this.stride[4]*a):this.data[this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i+this.stride[4]*a]},i.index=function(t,e,r,n,i){return this.offset+this.stride[0]*t+this.stride[1]*e+this.stride[2]*r+this.stride[3]*n+this.stride[4]*i},i.hi=function(t,e,r,i,a){return new n(this.data,"number"!=typeof t||t<0?this.shape[0]:0|t,"number"!=typeof e||e<0?this.shape[1]:0|e,"number"!=typeof r||r<0?this.shape[2]:0|r,"number"!=typeof i||i<0?this.shape[3]:0|i,"number"!=typeof a||a<0?this.shape[4]:0|a,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.stride[4],this.offset)},i.lo=function(t,e,r,i,a){var o=this.offset,s=0,l=this.shape[0],c=this.shape[1],u=this.shape[2],h=this.shape[3],p=this.shape[4],f=this.stride[0],d=this.stride[1],m=this.stride[2],g=this.stride[3],y=this.stride[4];return"number"==typeof t&&t>=0&&(o+=f*(s=0|t),l-=s),"number"==typeof e&&e>=0&&(o+=d*(s=0|e),c-=s),"number"==typeof r&&r>=0&&(o+=m*(s=0|r),u-=s),"number"==typeof i&&i>=0&&(o+=g*(s=0|i),h-=s),"number"==typeof a&&a>=0&&(o+=y*(s=0|a),p-=s),new n(this.data,l,c,u,h,p,f,d,m,g,y,o)},i.step=function(t,e,r,i,a){var o=this.shape[0],s=this.shape[1],l=this.shape[2],c=this.shape[3],u=this.shape[4],h=this.stride[0],p=this.stride[1],f=this.stride[2],d=this.stride[3],m=this.stride[4],g=this.offset,y=0,v=Math.ceil;return"number"==typeof t&&((y=0|t)<0?(g+=h*(o-1),o=v(-o/y)):o=v(o/y),h*=y),"number"==typeof e&&((y=0|e)<0?(g+=p*(s-1),s=v(-s/y)):s=v(s/y),p*=y),"number"==typeof r&&((y=0|r)<0?(g+=f*(l-1),l=v(-l/y)):l=v(l/y),f*=y),"number"==typeof i&&((y=0|i)<0?(g+=d*(c-1),c=v(-c/y)):c=v(c/y),d*=y),"number"==typeof a&&((y=0|a)<0?(g+=m*(u-1),u=v(-u/y)):u=v(u/y),m*=y),new n(this.data,o,s,l,c,u,h,p,f,d,m,g)},i.transpose=function(t,e,r,i,a){t=void 0===t?0:0|t,e=void 0===e?1:0|e,r=void 0===r?2:0|r,i=void 0===i?3:0|i,a=void 0===a?4:0|a;var o=this.shape,s=this.stride;return new n(this.data,o[t],o[e],o[r],o[i],o[a],s[t],s[e],s[r],s[i],s[a],this.offset)},i.pick=function(t,r,n,i,a){var o=[],s=[],l=this.offset;return"number"==typeof t&&t>=0?l=l+this.stride[0]*t|0:(o.push(this.shape[0]),s.push(this.stride[0])),"number"==typeof r&&r>=0?l=l+this.stride[1]*r|0:(o.push(this.shape[1]),s.push(this.stride[1])),"number"==typeof n&&n>=0?l=l+this.stride[2]*n|0:(o.push(this.shape[2]),s.push(this.stride[2])),"number"==typeof i&&i>=0?l=l+this.stride[3]*i|0:(o.push(this.shape[3]),s.push(this.stride[3])),"number"==typeof a&&a>=0?l=l+this.stride[4]*a|0:(o.push(this.shape[4]),s.push(this.stride[4])),(0,e[o.length+1])(this.data,o,s,l)},function(t,e,r,i){return new n(t,e[0],e[1],e[2],e[3],e[4],r[0],r[1],r[2],r[3],r[4],i)}}};function l(t,e){var r=-1===e?"T":String(e),n=s[r];return-1===e?n(t):0===e?n(t,c[t][0]):n(t,c[t],o)}var c={generic:[],buffer:[],array:[],float32:[],float64:[],int8:[],int16:[],int32:[],uint8_clamped:[],uint8:[],uint16:[],uint32:[],bigint64:[],biguint64:[]};t.exports=function(t,e,r,a){if(void 0===t)return(0,c.array[0])([]);"number"==typeof t&&(t=[t]),void 0===e&&(e=[t.length]);var o=e.length;if(void 0===r){r=new Array(o);for(var s=o-1,u=1;s>=0;--s)r[s]=u,u*=e[s]}if(void 0===a)for(a=0,s=0;s>>0;t.exports=function(t,e){if(isNaN(t)||isNaN(e))return NaN;if(t===e)return t;if(0===t)return e<0?-i:i;var r=n.hi(t),o=n.lo(t);return e>t==t>0?o===a?(r+=1,o=0):o+=1:0===o?(o=a,r-=1):o-=1,n.pack(o,r)}},8406:function(t,e){e.vertexNormals=function(t,e,r){for(var n=e.length,i=new Array(n),a=void 0===r?1e-6:r,o=0;oa){var _=i[c],b=1/Math.sqrt(g*v);for(x=0;x<3;++x){var w=(x+1)%3,T=(x+2)%3;_[x]+=b*(y[w]*m[T]-y[T]*m[w])}}}for(o=0;oa)for(b=1/Math.sqrt(A),x=0;x<3;++x)_[x]*=b;else for(x=0;x<3;++x)_[x]=0}return i},e.faceNormals=function(t,e,r){for(var n=t.length,i=new Array(n),a=void 0===r?1e-6:r,o=0;oa?1/Math.sqrt(f):0,c=0;c<3;++c)p[c]*=f;i[o]=p}return i}},4081:function(t){t.exports=function(t,e,r,n,i,a,o,s,l,c){var u=e+a+c;if(h>0){var h=Math.sqrt(u+1);t[0]=.5*(o-l)/h,t[1]=.5*(s-n)/h,t[2]=.5*(r-a)/h,t[3]=.5*h}else{var p=Math.max(e,a,c);h=Math.sqrt(2*p-u+1),e>=p?(t[0]=.5*h,t[1]=.5*(i+r)/h,t[2]=.5*(s+n)/h,t[3]=.5*(o-l)/h):a>=p?(t[0]=.5*(r+i)/h,t[1]=.5*h,t[2]=.5*(l+o)/h,t[3]=.5*(s-n)/h):(t[0]=.5*(n+s)/h,t[1]=.5*(o+l)/h,t[2]=.5*h,t[3]=.5*(r-i)/h)}return t}},9977:function(t,e,r){t.exports=function(t){var e=(t=t||{}).center||[0,0,0],r=t.rotation||[0,0,0,1],n=t.radius||1;e=[].slice.call(e,0,3),u(r=[].slice.call(r,0,4),r);var i=new h(r,e,Math.log(n));return i.setDistanceLimits(t.zoomMin,t.zoomMax),("eye"in t||"up"in t)&&i.lookAt(0,t.eye,t.center,t.up),i};var n=r(9215),i=r(6582),a=r(7399),o=r(7608),s=r(4081);function l(t,e,r){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2))}function c(t,e,r,n){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2)+Math.pow(n,2))}function u(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=c(r,n,i,a);o>1e-6?(t[0]=r/o,t[1]=n/o,t[2]=i/o,t[3]=a/o):(t[0]=t[1]=t[2]=0,t[3]=1)}function h(t,e,r){this.radius=n([r]),this.center=n(e),this.rotation=n(t),this.computedRadius=this.radius.curve(0),this.computedCenter=this.center.curve(0),this.computedRotation=this.rotation.curve(0),this.computedUp=[.1,0,0],this.computedEye=[.1,0,0],this.computedMatrix=[.1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.recalcMatrix(0)}var p=h.prototype;p.lastT=function(){return Math.max(this.radius.lastT(),this.center.lastT(),this.rotation.lastT())},p.recalcMatrix=function(t){this.radius.curve(t),this.center.curve(t),this.rotation.curve(t);var e=this.computedRotation;u(e,e);var r=this.computedMatrix;a(r,e);var n=this.computedCenter,i=this.computedEye,o=this.computedUp,s=Math.exp(this.computedRadius[0]);i[0]=n[0]+s*r[2],i[1]=n[1]+s*r[6],i[2]=n[2]+s*r[10],o[0]=r[1],o[1]=r[5],o[2]=r[9];for(var l=0;l<3;++l){for(var c=0,h=0;h<3;++h)c+=r[l+4*h]*i[h];r[12+l]=-c}},p.getMatrix=function(t,e){this.recalcMatrix(t);var r=this.computedMatrix;if(e){for(var n=0;n<16;++n)e[n]=r[n];return e}return r},p.idle=function(t){this.center.idle(t),this.radius.idle(t),this.rotation.idle(t)},p.flush=function(t){this.center.flush(t),this.radius.flush(t),this.rotation.flush(t)},p.pan=function(t,e,r,n){e=e||0,r=r||0,n=n||0,this.recalcMatrix(t);var i=this.computedMatrix,a=i[1],o=i[5],s=i[9],c=l(a,o,s);a/=c,o/=c,s/=c;var u=i[0],h=i[4],p=i[8],f=u*a+h*o+p*s,d=l(u-=a*f,h-=o*f,p-=s*f);u/=d,h/=d,p/=d;var m=i[2],g=i[6],y=i[10],v=m*a+g*o+y*s,x=m*u+g*h+y*p,_=l(m-=v*a+x*u,g-=v*o+x*h,y-=v*s+x*p);m/=_,g/=_,y/=_;var b=u*e+a*r,w=h*e+o*r,T=p*e+s*r;this.center.move(t,b,w,T);var A=Math.exp(this.computedRadius[0]);A=Math.max(1e-4,A+n),this.radius.set(t,Math.log(A))},p.rotate=function(t,e,r,n){this.recalcMatrix(t),e=e||0,r=r||0;var i=this.computedMatrix,a=i[0],o=i[4],s=i[8],u=i[1],h=i[5],p=i[9],f=i[2],d=i[6],m=i[10],g=e*a+r*u,y=e*o+r*h,v=e*s+r*p,x=-(d*v-m*y),_=-(m*g-f*v),b=-(f*y-d*g),w=Math.sqrt(Math.max(0,1-Math.pow(x,2)-Math.pow(_,2)-Math.pow(b,2))),T=c(x,_,b,w);T>1e-6?(x/=T,_/=T,b/=T,w/=T):(x=_=b=0,w=1);var A=this.computedRotation,k=A[0],M=A[1],S=A[2],E=A[3],C=k*w+E*x+M*b-S*_,I=M*w+E*_+S*x-k*b,L=S*w+E*b+k*_-M*x,P=E*w-k*x-M*_-S*b;if(n){x=f,_=d,b=m;var z=Math.sin(n)/l(x,_,b);x*=z,_*=z,b*=z,P=P*(w=Math.cos(e))-(C=C*w+P*x+I*b-L*_)*x-(I=I*w+P*_+L*x-C*b)*_-(L=L*w+P*b+C*_-I*x)*b}var D=c(C,I,L,P);D>1e-6?(C/=D,I/=D,L/=D,P/=D):(C=I=L=0,P=1),this.rotation.set(t,C,I,L,P)},p.lookAt=function(t,e,r,n){this.recalcMatrix(t),r=r||this.computedCenter,e=e||this.computedEye,n=n||this.computedUp;var a=this.computedMatrix;i(a,e,r,n);var o=this.computedRotation;s(o,a[0],a[1],a[2],a[4],a[5],a[6],a[8],a[9],a[10]),u(o,o),this.rotation.set(t,o[0],o[1],o[2],o[3]);for(var l=0,c=0;c<3;++c)l+=Math.pow(r[c]-e[c],2);this.radius.set(t,.5*Math.log(Math.max(l,1e-6))),this.center.set(t,r[0],r[1],r[2])},p.translate=function(t,e,r,n){this.center.move(t,e||0,r||0,n||0)},p.setMatrix=function(t,e){var r=this.computedRotation;s(r,e[0],e[1],e[2],e[4],e[5],e[6],e[8],e[9],e[10]),u(r,r),this.rotation.set(t,r[0],r[1],r[2],r[3]);var n=this.computedMatrix;o(n,e);var i=n[15];if(Math.abs(i)>1e-6){var a=n[12]/i,l=n[13]/i,c=n[14]/i;this.recalcMatrix(t);var h=Math.exp(this.computedRadius[0]);this.center.set(t,a-n[2]*h,l-n[6]*h,c-n[10]*h),this.radius.idle(t)}else this.center.idle(t),this.radius.idle(t)},p.setDistance=function(t,e){e>0&&this.radius.set(t,Math.log(e))},p.setDistanceLimits=function(t,e){t=t>0?Math.log(t):-1/0,e=e>0?Math.log(e):1/0,e=Math.max(e,t),this.radius.bounds[0][0]=t,this.radius.bounds[1][0]=e},p.getDistanceLimits=function(t){var e=this.radius.bounds;return t?(t[0]=Math.exp(e[0][0]),t[1]=Math.exp(e[1][0]),t):[Math.exp(e[0][0]),Math.exp(e[1][0])]},p.toJSON=function(){return this.recalcMatrix(this.lastT()),{center:this.computedCenter.slice(),rotation:this.computedRotation.slice(),distance:Math.log(this.computedRadius[0]),zoomMin:this.radius.bounds[0][0],zoomMax:this.radius.bounds[1][0]}},p.fromJSON=function(t){var e=this.lastT(),r=t.center;r&&this.center.set(e,r[0],r[1],r[2]);var n=t.rotation;n&&this.rotation.set(e,n[0],n[1],n[2],n[3]);var i=t.distance;i&&i>0&&this.radius.set(e,Math.log(i)),this.setDistanceLimits(t.zoomMin,t.zoomMax)}},1371:function(t,e,r){var n=r(3233);t.exports=function(t,e,r){return n(r=typeof r<"u"?r+"":" ",e)+t}},3202:function(t){t.exports=function(t,e){e||(e=[0,""]),t=String(t);var r=parseFloat(t,10);return e[0]=r,e[1]=t.match(/[\d.\-\+]*\s*(.*)/)[1]||"",e}},3088:function(t,e,r){t.exports=function(t,e){for(var r=0|e.length,i=t.length,a=[new Array(r),new Array(r)],o=0;o0){o=a[c][r][0],l=c;break}s=o[1^l];for(var h=0;h<2;++h)for(var p=a[h][r],f=0;f0&&(o=d,s=m,l=h)}return i||o&&u(o,l),s}function p(t,r){var i=a[r][t][0],o=[t];u(i,r);for(var s=i[1^r];;){for(;s!==t;)o.push(s),s=h(o[o.length-2],s,!1);if(a[0][t].length+a[1][t].length===0)break;var l=o[o.length-1],c=t,p=o[1],f=h(l,c,!0);if(n(e[l],e[c],e[p],e[f])<0)break;o.push(t),s=h(l,c)}return o}for(o=0;o0;){a[0][o].length;var m=p(o,f);(l=m)[1]===l[l.length-1]?d.push.apply(d,m):(d.length>0&&c.push(d),d=m)}d.length>0&&c.push(d)}return c};var n=r(3140)},5609:function(t,e,r){t.exports=function(t,e){for(var r=n(t,e.length),i=new Array(e.length),a=new Array(e.length),o=[],s=0;s0;){i[f=o.pop()]=!1;var c=r[f];for(s=0;s0}))).length,g=new Array(m),y=new Array(m);for(f=0;f0;){var B=R.pop(),j=E[B];l(j,(function(t,e){return t-e}));var N,U=j.length,V=F[B];for(0===V&&(N=[q=d[B]]),f=0;f=0||(F[H]=1^V,R.push(H),0!==V)||O(q=d[H])||(q.reverse(),N.push(q))}0===V&&r.push(N)}return r};var n=r(3134),i=r(3088),a=r(5085),o=r(5250),s=r(8210),l=r(1682),c=r(5609);function u(t,e){for(var r=new Array(t),n=0;n0&&e[i]===r[0]))return 1;a=t[i-1]}for(var s=1;a;){var l=a.key,c=n(r,l[0],l[1]);if(l[0][0]0))return 0;s=-1,a=a.right}else if(c>0)a=a.left;else{if(!(c<0))return 0;s=1,a=a.right}}return s}}(g.slabs,g.coordinates);return 0===a.length?y:function(t,e){return function(r){return t(r[0],r[1])?0:e(r)}}(l(a),y)};var n=r(3250)[3],i=r(4209),a=r(3352),o=r(2478);function s(){return!0}function l(t){for(var e={},r=0;r=c?(A=1,v=c+2*p+d):v=p*(A=-p/c)+d):(A=0,f>=0?(k=0,v=d):-f>=h?(k=1,v=h+2*f+d):v=f*(k=-f/h)+d);else if(k<0)k=0,p>=0?(A=0,v=d):-p>=c?(A=1,v=c+2*p+d):v=p*(A=-p/c)+d;else{var M=1/T;v=(A*=M)*(c*A+u*(k*=M)+2*p)+k*(u*A+h*k+2*f)+d}else A<0?(_=h+f)>(x=u+p)?(b=_-x)>=(w=c-2*u+h)?(A=1,k=0,v=c+2*p+d):v=(A=b/w)*(c*A+u*(k=1-A)+2*p)+k*(u*A+h*k+2*f)+d:(A=0,_<=0?(k=1,v=h+2*f+d):f>=0?(k=0,v=d):v=f*(k=-f/h)+d):k<0?(_=c+p)>(x=u+f)?(b=_-x)>=(w=c-2*u+h)?(k=1,A=0,v=h+2*f+d):v=(A=1-(k=b/w))*(c*A+u*k+2*p)+k*(u*A+h*k+2*f)+d:(k=0,_<=0?(A=1,v=c+2*p+d):p>=0?(A=0,v=d):v=p*(A=-p/c)+d):(b=h+f-u-p)<=0?(A=0,k=1,v=h+2*f+d):b>=(w=c-2*u+h)?(A=1,k=0,v=c+2*p+d):v=(A=b/w)*(c*A+u*(k=1-A)+2*p)+k*(u*A+h*k+2*f)+d;var S=1-A-k;for(l=0;l0){var c=t[r-1];if(0===n(s,c)&&a(c)!==l){r-=1;continue}}t[r++]=s}}return t.length=r,t}},3233:function(t){var e,r="";t.exports=function(t,n){if("string"!=typeof t)throw new TypeError("expected a string");if(1===n)return t;if(2===n)return t+t;var i=t.length*n;if(e!==t||typeof e>"u")e=t,r="";else if(r.length>=i)return r.substr(0,i);for(;i>r.length&&n>1;)1&n&&(r+=t),n>>=1,t+=t;return r=(r+=t).substr(0,i)}},3025:function(t,e,r){t.exports=r.g.performance&&r.g.performance.now?function(){return performance.now()}:Date.now||function(){return+new Date}},7004:function(t){t.exports=function(t){for(var e=t.length,r=t[t.length-1],n=e,i=e-2;i>=0;--i){var a=r;(l=(s=t[i])-((r=a+s)-a))&&(t[--n]=r,r=l)}var o=0;for(i=n;i0){if(a<=0)return o;n=i+a}else{if(!(i<0))return o;if(a>=0)return o;n=-(i+a)}var s=l*n;return o>=s||o<=-s?o:d(t,e,r)},function(t,e,r,n){var i=t[0]-n[0],a=e[0]-n[0],o=r[0]-n[0],s=t[1]-n[1],l=e[1]-n[1],u=r[1]-n[1],h=t[2]-n[2],p=e[2]-n[2],f=r[2]-n[2],d=a*u,g=o*l,y=o*s,v=i*u,x=i*l,_=a*s,b=h*(d-g)+p*(y-v)+f*(x-_),w=(Math.abs(d)+Math.abs(g))*Math.abs(h)+(Math.abs(y)+Math.abs(v))*Math.abs(p)+(Math.abs(x)+Math.abs(_))*Math.abs(f),T=c*w;return b>T||-b>T?b:m(t,e,r,n)}];function y(t){var e=g[t.length];return e||(e=g[t.length]=f(t.length)),e.apply(void 0,t)}function v(t,e,r,n,i,a,o){return function(e,r,s,l,c){switch(arguments.length){case 0:case 1:return 0;case 2:return n(e,r);case 3:return i(e,r,s);case 4:return a(e,r,s,l);case 5:return o(e,r,s,l,c)}for(var u=new Array(arguments.length),h=0;h0&&o>0||a<0&&o<0)return!1;var s=n(r,t,e),l=n(i,t,e);return!(s>0&&l>0||s<0&&l<0)&&(0!==a||0!==o||0!==s||0!==l||function(t,e,r,n){for(var i=0;i<2;++i){var a=t[i],o=e[i],s=Math.min(a,o),l=Math.max(a,o),c=r[i],u=n[i],h=Math.min(c,u);if(Math.max(c,u)=n?(i=h,(l+=1)=n?(i=h,(l+=1)"u"&&(s=function(t){for(var e=t.length,r=0,n=0;n>1,c=e[2*l+1];if(c===a)return l;a>1,c=e[2*l+1];if(c===a)return l;a>1,c=e[2*l+1];if(c===a)return l;a0)-(t<0)},e.abs=function(t){var e=t>>31;return(t^e)-e},e.min=function(t,e){return e^(t^e)&-(t65535)<<4,e|=r=((t>>>=e)>255)<<3,e|=r=((t>>>=r)>15)<<2,(e|=r=((t>>>=r)>3)<<1)|(t>>>=r)>>1},e.log10=function(t){return t>=1e9?9:t>=1e8?8:t>=1e7?7:t>=1e6?6:t>=1e5?5:t>=1e4?4:t>=1e3?3:t>=100?2:t>=10?1:0},e.popCount=function(t){return 16843009*((t=(858993459&(t-=t>>>1&1431655765))+(t>>>2&858993459))+(t>>>4)&252645135)>>>24},e.countTrailingZeros=r,e.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,1+((t|=t>>>8)|t>>>16)},e.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)-(t>>>1)},e.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,27030>>>(t&=15)&1};var n=new Array(256);(function(t){for(var e=0;e<256;++e){var r=e,n=e,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;t[e]=n<>>8&255]<<16|n[t>>>16&255]<<8|n[t>>>24&255]},e.interleave2=function(t,e){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))<<1},e.deinterleave2=function(t,e){return(t=65535&((t=16711935&((t=252645135&((t=858993459&((t=t>>>e&1431655765)|t>>>1))|t>>>2))|t>>>4))|t>>>16))<<16>>16},e.interleave3=function(t,e,r){return t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2),(t|=(e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},e.deinterleave3=function(t,e){return(t=1023&((t=4278190335&((t=251719695&((t=3272356035&((t=t>>>e&1227133513)|t>>>2))|t>>>4))|t>>>8))|t>>>16))<<22>>22},e.nextCombination=function(t){var e=t|t-1;return e+1|(~e&-~e)-1>>>r(t)+1}},2014:function(t,e,r){var n=r(3105),i=r(4623);function a(t,e){var r=t.length,n=t.length-e.length,i=Math.min;if(n)return n;switch(r){case 0:return 0;case 1:return t[0]-e[0];case 2:return(s=t[0]+t[1]-e[0]-e[1])||i(t[0],t[1])-i(e[0],e[1]);case 3:var a=t[0]+t[1],o=e[0]+e[1];if(s=a+t[2]-(o+e[2]))return s;var s,l=i(t[0],t[1]),c=i(e[0],e[1]);return(s=i(l,t[2])-i(c,e[2]))||i(l+t[2],a)-i(c+e[2],o);default:var u=t.slice(0);u.sort();var h=e.slice(0);h.sort();for(var p=0;p>1,s=a(t[o],e);s<=0?(0===s&&(i=o),r=o+1):s>0&&(n=o-1)}return i}function u(t,e){for(var r=new Array(t.length),i=0,o=r.length;i=t.length||0!==a(t[g],s)););}return r}function h(t,e){if(e<0)return[];for(var r=[],i=(1<>>u&1&&c.push(i[u]);e.push(c)}return s(e)},e.skeleton=h,e.boundary=function(t){for(var e=[],r=0,n=t.length;r>1:(t>>1)-1}function x(t){for(var e=y(t);;){var r=e,n=2*t+1,i=2*(t+1),a=t;if(n0;){var r=v(t);if(!(r>=0&&e0){var t=A[0];return g(0,M-1),M-=1,x(0),t}return-1}function w(t,e){var r=A[t];return c[r]===e?t:(c[r]=-1/0,_(t),b(),c[r]=e,_((M+=1)-1))}function T(t){if(!u[t]){u[t]=!0;var e=s[t],r=l[t];s[r]>=0&&(s[r]=e),l[e]>=0&&(l[e]=r),k[e]>=0&&w(k[e],m(e)),k[r]>=0&&w(k[r],m(r))}}var A=[],k=new Array(a);for(h=0;h>1;h>=0;--h)x(h);for(;;){var S=b();if(S<0||c[S]>r)break;T(S)}var E=[];for(h=0;h=0&&r>=0&&e!==r){var n=k[e],i=k[r];n!==i&&I.push([n,i])}})),i.unique(i.normalize(I)),{positions:E,edges:I}};var n=r(3250),i=r(2014)},1303:function(t,e,r){t.exports=function(t,e){var r,a,o,s;if(e[0][0]e[1][0]))return i(e,t);r=e[1],a=e[0]}if(t[0][0]t[1][0]))return-i(t,e);o=t[1],s=t[0]}var l=n(r,a,s),c=n(r,a,o);if(l<0){if(c<=0)return l}else if(l>0){if(c>=0)return l}else if(c)return c;if(l=n(s,o,a),c=n(s,o,r),l<0){if(c<=0)return l}else if(l>0){if(c>=0)return l}else if(c)return c;return a[0]-s[0]};var n=r(3250);function i(t,e){var r,i,a,o;if(e[0][0]e[1][0])){var s=Math.min(t[0][1],t[1][1]),l=Math.max(t[0][1],t[1][1]),c=Math.min(e[0][1],e[1][1]),u=Math.max(e[0][1],e[1][1]);return lu?s-u:l-u}r=e[1],i=e[0]}t[0][1]0)if(e[0]!==o[1][0])r=t,t=t.right;else{if(l=c(t.right,e))return l;t=t.left}else{if(e[0]!==o[1][0])return t;var l;if(l=c(t.right,e))return l;t=t.left}}return r}function u(t,e,r,n){this.y=t,this.index=e,this.start=r,this.closed=n}function h(t,e,r,n){this.x=t,this.segment=e,this.create=r,this.index=n}s.prototype.castUp=function(t){var e=n.le(this.coordinates,t[0]);if(e<0)return-1;this.slabs[e];var r=c(this.slabs[e],t),i=-1;if(r&&(i=r.value),this.coordinates[e]===t[0]){var s=null;if(r&&(s=r.key),e>0){var u=c(this.slabs[e-1],t);u&&(s?o(u.key,s)>0&&(s=u.key,i=u.value):(i=u.value,s=u.key))}var h=this.horizontal[e];if(h.length>0){var p=n.ge(h,t[1],l);if(p=h.length)return i;f=h[p]}}if(f.start)if(s){var d=a(s[0],s[1],[t[0],f.y]);s[0][0]>s[1][0]&&(d=-d),d>0&&(i=f.index)}else i=f.index;else f.y!==t[1]&&(i=f.index)}}}return i}},5202:function(t,e,r){var n=r(1944),i=r(8210);function a(t,e){var r=i(n(t,e),[e[e.length-1]]);return r[r.length-1]}function o(t,e,r,n){var i=-e/(n-e);i<0?i=0:i>1&&(i=1);for(var a=1-i,o=t.length,s=new Array(o),l=0;l0||i>0&&u<0){var h=o(s,u,l,i);r.push(h),n.push(h.slice())}u<0?n.push(l.slice()):u>0?r.push(l.slice()):(r.push(l.slice()),n.push(l.slice())),i=u}return{positive:r,negative:n}},t.exports.positive=function(t,e){for(var r=[],n=a(t[t.length-1],e),i=t[t.length-1],s=t[0],l=0;l0||n>0&&c<0)&&r.push(o(i,c,s,n)),c>=0&&r.push(s.slice()),n=c}return r},t.exports.negative=function(t,e){for(var r=[],n=a(t[t.length-1],e),i=t[t.length-1],s=t[0],l=0;l0||n>0&&c<0)&&r.push(o(i,c,s,n)),c<=0&&r.push(s.slice()),n=c}return r}},3387:function(t,e,r){var n;!function(){var i={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function a(t){return function(t,e){var r,n,o,s,l,c,u,h,p,f=1,d=t.length,m="";for(n=0;n=0),s.type){case"b":r=parseInt(r,10).toString(2);break;case"c":r=String.fromCharCode(parseInt(r,10));break;case"d":case"i":r=parseInt(r,10);break;case"j":r=JSON.stringify(r,null,s.width?parseInt(s.width):0);break;case"e":r=s.precision?parseFloat(r).toExponential(s.precision):parseFloat(r).toExponential();break;case"f":r=s.precision?parseFloat(r).toFixed(s.precision):parseFloat(r);break;case"g":r=s.precision?String(Number(r.toPrecision(s.precision))):parseFloat(r);break;case"o":r=(parseInt(r,10)>>>0).toString(8);break;case"s":r=String(r),r=s.precision?r.substring(0,s.precision):r;break;case"t":r=String(!!r),r=s.precision?r.substring(0,s.precision):r;break;case"T":r=Object.prototype.toString.call(r).slice(8,-1).toLowerCase(),r=s.precision?r.substring(0,s.precision):r;break;case"u":r=parseInt(r,10)>>>0;break;case"v":r=r.valueOf(),r=s.precision?r.substring(0,s.precision):r;break;case"x":r=(parseInt(r,10)>>>0).toString(16);break;case"X":r=(parseInt(r,10)>>>0).toString(16).toUpperCase()}i.json.test(s.type)?m+=r:(!i.number.test(s.type)||h&&!s.sign?p="":(p=h?"+":"-",r=r.toString().replace(i.sign,"")),c=s.pad_char?"0"===s.pad_char?"0":s.pad_char.charAt(1):" ",u=s.width-(p+r).length,l=s.width&&u>0?c.repeat(u):"",m+=s.align?p+r+l:"0"===c?p+l+r:l+p+r)}return m}(function(t){if(s[t])return s[t];for(var e,r=t,n=[],a=0;r;){if(null!==(e=i.text.exec(r)))n.push(e[0]);else if(null!==(e=i.modulo.exec(r)))n.push("%");else{if(null===(e=i.placeholder.exec(r)))throw new SyntaxError("[sprintf] unexpected placeholder");if(e[2]){a|=1;var o=[],l=e[2],c=[];if(null===(c=i.key.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(o.push(c[1]);""!==(l=l.substring(c[0].length));)if(null!==(c=i.key_access.exec(l)))o.push(c[1]);else{if(null===(c=i.index_access.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");o.push(c[1])}e[2]=o}else a|=2;if(3===a)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");n.push({placeholder:e[0],param_no:e[1],keys:e[2],sign:e[3],pad_char:e[4],align:e[5],width:e[6],precision:e[7],type:e[8]})}r=r.substring(e[0].length)}return s[t]=n}(t),arguments)}function o(t,e){return a.apply(null,[t].concat(e||[]))}var s=Object.create(null);e.sprintf=a,e.vsprintf=o,typeof window<"u"&&(window.sprintf=a,window.vsprintf=o,void 0!==(n=function(){return{sprintf:a,vsprintf:o}}.call(e,r,e,t))&&(t.exports=n))}()},3711:function(t,e,r){t.exports=function(t,e){if(t.dimension<=0)return{positions:[],cells:[]};if(1===t.dimension)return function(t,e){for(var r=i(t,e),n=r.length,a=new Array(n),o=new Array(n),s=0;sn|0},vertex:function(t,e,r,n,i,a,o,s,l,c,u,h,p){var f=(0|o)+(s<<1)+(l<<2)+(c<<3)|0;if(0!==f&&15!==f)switch(f){case 0:case 15:u.push([t-.5,e-.5]);break;case 1:u.push([t-.25-.25*(n+r-2*p)/(r-n),e-.25-.25*(i+r-2*p)/(r-i)]);break;case 2:u.push([t-.75-.25*(-n-r+2*p)/(n-r),e-.25-.25*(a+n-2*p)/(n-a)]);break;case 3:u.push([t-.5,e-.5-.5*(i+r+a+n-4*p)/(r-i+n-a)]);break;case 4:u.push([t-.25-.25*(a+i-2*p)/(i-a),e-.75-.25*(-i-r+2*p)/(i-r)]);break;case 5:u.push([t-.5-.5*(n+r+a+i-4*p)/(r-n+i-a),e-.5]);break;case 6:u.push([t-.5-.25*(-n-r+a+i)/(n-r+i-a),e-.5-.25*(-i-r+a+n)/(i-r+n-a)]);break;case 7:u.push([t-.75-.25*(a+i-2*p)/(i-a),e-.75-.25*(a+n-2*p)/(n-a)]);break;case 8:u.push([t-.75-.25*(-a-i+2*p)/(a-i),e-.75-.25*(-a-n+2*p)/(a-n)]);break;case 9:u.push([t-.5-.25*(n+r+-a-i)/(r-n+a-i),e-.5-.25*(i+r+-a-n)/(r-i+a-n)]);break;case 10:u.push([t-.5-.5*(-n-r-a-i+4*p)/(n-r+a-i),e-.5]);break;case 11:u.push([t-.25-.25*(-a-i+2*p)/(a-i),e-.75-.25*(i+r-2*p)/(r-i)]);break;case 12:u.push([t-.5,e-.5-.5*(-i-r-a-n+4*p)/(i-r+a-n)]);break;case 13:u.push([t-.75-.25*(n+r-2*p)/(r-n),e-.25-.25*(-a-n+2*p)/(a-n)]);break;case 14:u.push([t-.25-.25*(-n-r+2*p)/(n-r),e-.25-.25*(-i-r+2*p)/(i-r)])}},cell:function(t,e,r,n,i,a,o,s,l){i?s.push([t,e]):s.push([e,t])}});return function(t,e){var r=[],i=[];return n(t,r,i,e),{positions:r,cells:i}}}},o={}},665:function(t,e,r){var n=r(3202);t.exports=o;var i=96;function a(t,e){var r=n(getComputedStyle(t).getPropertyValue(e));return r[0]*o(r[1],t)}function o(t,e){switch(e=e||document.body,t=(t||"px").trim().toLowerCase(),(e===window||e===document)&&(e=document.body),t){case"%":return e.clientHeight/100;case"ch":case"ex":return function(t,e){var r=document.createElement("div");r.style["font-size"]="128"+t,e.appendChild(r);var n=a(r,"font-size")/128;return e.removeChild(r),n}(t,e);case"em":return a(e,"font-size");case"rem":return a(document.body,"font-size");case"vw":return window.innerWidth/100;case"vh":return window.innerHeight/100;case"vmin":return Math.min(window.innerWidth,window.innerHeight)/100;case"vmax":return Math.max(window.innerWidth,window.innerHeight)/100;case"in":return i;case"cm":return i/2.54;case"mm":return i/25.4;case"pt":return i/72;case"pc":return i/6}return 1}},7261:function(t,e,r){t.exports=function(t){var e=(t=t||{}).center||[0,0,0],r=t.up||[0,1,0],n=t.right||h(r),i=t.radius||1,a=t.theta||0,u=t.phi||0;if(e=[].slice.call(e,0,3),r=[].slice.call(r,0,3),s(r,r),n=[].slice.call(n,0,3),s(n,n),"eye"in t){var f=t.eye,d=[f[0]-e[0],f[1]-e[1],f[2]-e[2]];o(n,d,r),c(n[0],n[1],n[2])<1e-6?n=h(r):s(n,n),i=c(d[0],d[1],d[2]);var m=l(r,d)/i,g=l(n,d)/i;u=Math.acos(m),a=Math.acos(g)}return i=Math.log(i),new p(t.zoomMin,t.zoomMax,e,r,n,i,a,u)};var n=r(9215),i=r(7608),a=r(6079),o=r(5911),s=r(3536),l=r(244);function c(t,e,r){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2))}function u(t){return Math.min(1,Math.max(-1,t))}function h(t){var e=Math.abs(t[0]),r=Math.abs(t[1]),n=Math.abs(t[2]),i=[0,0,0];e>Math.max(r,n)?i[2]=1:r>Math.max(e,n)?i[0]=1:i[1]=1;for(var a=0,o=0,l=0;l<3;++l)a+=t[l]*t[l],o+=i[l]*t[l];for(l=0;l<3;++l)i[l]-=o/a*t[l];return s(i,i),i}function p(t,e,r,i,a,o,s,l){this.center=n(r),this.up=n(i),this.right=n(a),this.radius=n([o]),this.angle=n([s,l]),this.angle.bounds=[[-1/0,-Math.PI/2],[1/0,Math.PI/2]],this.setDistanceLimits(t,e),this.computedCenter=this.center.curve(0),this.computedUp=this.up.curve(0),this.computedRight=this.right.curve(0),this.computedRadius=this.radius.curve(0),this.computedAngle=this.angle.curve(0),this.computedToward=[0,0,0],this.computedEye=[0,0,0],this.computedMatrix=new Array(16);for(var c=0;c<16;++c)this.computedMatrix[c]=.5;this.recalcMatrix(0)}var f=p.prototype;f.setDistanceLimits=function(t,e){t=t>0?Math.log(t):-1/0,e=e>0?Math.log(e):1/0,e=Math.max(e,t),this.radius.bounds[0][0]=t,this.radius.bounds[1][0]=e},f.getDistanceLimits=function(t){var e=this.radius.bounds[0];return t?(t[0]=Math.exp(e[0][0]),t[1]=Math.exp(e[1][0]),t):[Math.exp(e[0][0]),Math.exp(e[1][0])]},f.recalcMatrix=function(t){this.center.curve(t),this.up.curve(t),this.right.curve(t),this.radius.curve(t),this.angle.curve(t);for(var e=this.computedUp,r=this.computedRight,n=0,i=0,a=0;a<3;++a)i+=e[a]*r[a],n+=e[a]*e[a];var l=Math.sqrt(n),u=0;for(a=0;a<3;++a)r[a]-=e[a]*i/n,u+=r[a]*r[a],e[a]/=l;var h=Math.sqrt(u);for(a=0;a<3;++a)r[a]/=h;var p=this.computedToward;o(p,e,r),s(p,p);var f=Math.exp(this.computedRadius[0]),d=this.computedAngle[0],m=this.computedAngle[1],g=Math.cos(d),y=Math.sin(d),v=Math.cos(m),x=Math.sin(m),_=this.computedCenter,b=g*v,w=y*v,T=x,A=-g*x,k=-y*x,M=v,S=this.computedEye,E=this.computedMatrix;for(a=0;a<3;++a){var C=b*r[a]+w*p[a]+T*e[a];E[4*a+1]=A*r[a]+k*p[a]+M*e[a],E[4*a+2]=C,E[4*a+3]=0}var I=E[1],L=E[5],P=E[9],z=E[2],D=E[6],O=E[10],R=L*O-P*D,F=P*z-I*O,B=I*D-L*z,j=c(R,F,B);for(R/=j,F/=j,B/=j,E[0]=R,E[4]=F,E[8]=B,a=0;a<3;++a)S[a]=_[a]+E[2+4*a]*f;for(a=0;a<3;++a){u=0;for(var N=0;N<3;++N)u+=E[a+4*N]*S[N];E[12+a]=-u}E[15]=1},f.getMatrix=function(t,e){this.recalcMatrix(t);var r=this.computedMatrix;if(e){for(var n=0;n<16;++n)e[n]=r[n];return e}return r};var d=[0,0,0];f.rotate=function(t,e,r,n){if(this.angle.move(t,e,r),n){this.recalcMatrix(t);var i=this.computedMatrix;d[0]=i[2],d[1]=i[6],d[2]=i[10];for(var o=this.computedUp,s=this.computedRight,l=this.computedToward,c=0;c<3;++c)i[4*c]=o[c],i[4*c+1]=s[c],i[4*c+2]=l[c];for(a(i,i,n,d),c=0;c<3;++c)o[c]=i[4*c],s[c]=i[4*c+1];this.up.set(t,o[0],o[1],o[2]),this.right.set(t,s[0],s[1],s[2])}},f.pan=function(t,e,r,n){e=e||0,r=r||0,n=n||0,this.recalcMatrix(t);var i=this.computedMatrix,a=(Math.exp(this.computedRadius[0]),i[1]),o=i[5],s=i[9],l=c(a,o,s);a/=l,o/=l,s/=l;var u=i[0],h=i[4],p=i[8],f=u*a+h*o+p*s,d=c(u-=a*f,h-=o*f,p-=s*f),m=(u/=d)*e+a*r,g=(h/=d)*e+o*r,y=(p/=d)*e+s*r;this.center.move(t,m,g,y);var v=Math.exp(this.computedRadius[0]);v=Math.max(1e-4,v+n),this.radius.set(t,Math.log(v))},f.translate=function(t,e,r,n){this.center.move(t,e||0,r||0,n||0)},f.setMatrix=function(t,e,r,n){var a=1;"number"==typeof r&&(a=0|r),(a<0||a>3)&&(a=1);var o=(a+2)%3;e||(this.recalcMatrix(t),e=this.computedMatrix);var s=e[a],l=e[a+4],h=e[a+8];if(n){var p=Math.abs(s),f=Math.abs(l),d=Math.abs(h),m=Math.max(p,f,d);p===m?(s=s<0?-1:1,l=h=0):d===m?(h=h<0?-1:1,s=l=0):(l=l<0?-1:1,s=h=0)}else{var g=c(s,l,h);s/=g,l/=g,h/=g}var y,v,x=e[o],_=e[o+4],b=e[o+8],w=x*s+_*l+b*h,T=c(x-=s*w,_-=l*w,b-=h*w),A=l*(b/=T)-h*(_/=T),k=h*(x/=T)-s*b,M=s*_-l*x,S=c(A,k,M);if(A/=S,k/=S,M/=S,this.center.jump(t,H,G,W),this.radius.idle(t),this.up.jump(t,s,l,h),this.right.jump(t,x,_,b),2===a){var E=e[1],C=e[5],I=e[9],L=E*x+C*_+I*b,P=E*A+C*k+I*M;y=R<0?-Math.PI/2:Math.PI/2,v=Math.atan2(P,L)}else{var z=e[2],D=e[6],O=e[10],R=z*s+D*l+O*h,F=z*x+D*_+O*b,B=z*A+D*k+O*M;y=Math.asin(u(R)),v=Math.atan2(B,F)}this.angle.jump(t,v,y),this.recalcMatrix(t);var j=e[2],N=e[6],U=e[10],V=this.computedMatrix;i(V,e);var q=V[15],H=V[12]/q,G=V[13]/q,W=V[14]/q,Z=Math.exp(this.computedRadius[0]);this.center.jump(t,H-j*Z,G-N*Z,W-U*Z)},f.lastT=function(){return Math.max(this.center.lastT(),this.up.lastT(),this.right.lastT(),this.radius.lastT(),this.angle.lastT())},f.idle=function(t){this.center.idle(t),this.up.idle(t),this.right.idle(t),this.radius.idle(t),this.angle.idle(t)},f.flush=function(t){this.center.flush(t),this.up.flush(t),this.right.flush(t),this.radius.flush(t),this.angle.flush(t)},f.setDistance=function(t,e){e>0&&this.radius.set(t,Math.log(e))},f.lookAt=function(t,e,r,n){this.recalcMatrix(t),e=e||this.computedEye,r=r||this.computedCenter;var i=(n=n||this.computedUp)[0],a=n[1],o=n[2],s=c(i,a,o);if(!(s<1e-6)){i/=s,a/=s,o/=s;var l=e[0]-r[0],h=e[1]-r[1],p=e[2]-r[2],f=c(l,h,p);if(!(f<1e-6)){l/=f,h/=f,p/=f;var d=this.computedRight,m=d[0],g=d[1],y=d[2],v=i*m+a*g+o*y,x=c(m-=v*i,g-=v*a,y-=v*o);if(!(x<.01&&(m=a*p-o*h,g=o*l-i*p,y=i*h-a*l,x=c(m,g,y),x<1e-6))){m/=x,g/=x,y/=x,this.up.set(t,i,a,o),this.right.set(t,m,g,y),this.center.set(t,r[0],r[1],r[2]),this.radius.set(t,Math.log(f));var _=a*y-o*g,b=o*m-i*y,w=i*g-a*m,T=c(_,b,w),A=i*l+a*h+o*p,k=m*l+g*h+y*p,M=(_/=T)*l+(b/=T)*h+(w/=T)*p,S=Math.asin(u(A)),E=Math.atan2(M,k),C=this.angle._state,I=C[C.length-1],L=C[C.length-2];I%=2*Math.PI;var P=Math.abs(I+2*Math.PI-E),z=Math.abs(I-E),D=Math.abs(I-2*Math.PI-E);P0?r.pop():new ArrayBuffer(t)}function d(t){return new Uint8Array(f(t),0,t)}function m(t){return new Uint16Array(f(2*t),0,t)}function g(t){return new Uint32Array(f(4*t),0,t)}function y(t){return new Int8Array(f(t),0,t)}function v(t){return new Int16Array(f(2*t),0,t)}function x(t){return new Int32Array(f(4*t),0,t)}function _(t){return new Float32Array(f(4*t),0,t)}function b(t){return new Float64Array(f(8*t),0,t)}function w(t){return o?new Uint8ClampedArray(f(t),0,t):d(t)}function T(t){return s?new BigUint64Array(f(8*t),0,t):null}function A(t){return l?new BigInt64Array(f(8*t),0,t):null}function k(t){return new DataView(f(t),0,t)}function M(t){t=n.nextPow2(t);var e=n.log2(t),r=h[e];return r.length>0?r.pop():new a(t)}e.free=function(t){if(a.isBuffer(t))h[n.log2(t.length)].push(t);else{if("[object ArrayBuffer]"!==Object.prototype.toString.call(t)&&(t=t.buffer),!t)return;var e=t.length||t.byteLength,r=0|n.log2(e);u[r].push(t)}},e.freeUint8=e.freeUint16=e.freeUint32=e.freeBigUint64=e.freeInt8=e.freeInt16=e.freeInt32=e.freeBigInt64=e.freeFloat32=e.freeFloat=e.freeFloat64=e.freeDouble=e.freeUint8Clamped=e.freeDataView=function(t){p(t.buffer)},e.freeArrayBuffer=p,e.freeBuffer=function(t){h[n.log2(t.length)].push(t)},e.malloc=function(t,e){if(void 0===e||"arraybuffer"===e)return f(t);switch(e){case"uint8":return d(t);case"uint16":return m(t);case"uint32":return g(t);case"int8":return y(t);case"int16":return v(t);case"int32":return x(t);case"float":case"float32":return _(t);case"double":case"float64":return b(t);case"uint8_clamped":return w(t);case"bigint64":return A(t);case"biguint64":return T(t);case"buffer":return M(t);case"data":case"dataview":return k(t);default:return null}return null},e.mallocArrayBuffer=f,e.mallocUint8=d,e.mallocUint16=m,e.mallocUint32=g,e.mallocInt8=y,e.mallocInt16=v,e.mallocInt32=x,e.mallocFloat32=e.mallocFloat=_,e.mallocFloat64=e.mallocDouble=b,e.mallocUint8Clamped=w,e.mallocBigUint64=T,e.mallocBigInt64=A,e.mallocDataView=k,e.mallocBuffer=M,e.clearCache=function(){for(var t=0;t<32;++t)c.UINT8[t].length=0,c.UINT16[t].length=0,c.UINT32[t].length=0,c.INT8[t].length=0,c.INT16[t].length=0,c.INT32[t].length=0,c.FLOAT[t].length=0,c.DOUBLE[t].length=0,c.BIGUINT64[t].length=0,c.BIGINT64[t].length=0,c.UINT8C[t].length=0,u[t].length=0,h[t].length=0}},1755:function(t){function e(t){this.roots=new Array(t),this.ranks=new Array(t);for(var e=0;e0&&(a=n.size),n.lineSpacing&&n.lineSpacing>0&&(o=n.lineSpacing),n.styletags&&n.styletags.breaklines&&(s.breaklines=!!n.styletags.breaklines),n.styletags&&n.styletags.bolds&&(s.bolds=!!n.styletags.bolds),n.styletags&&n.styletags.italics&&(s.italics=!!n.styletags.italics),n.styletags&&n.styletags.subscripts&&(s.subscripts=!!n.styletags.subscripts),n.styletags&&n.styletags.superscripts&&(s.superscripts=!!n.styletags.superscripts)),r.font=[n.fontStyle,n.fontVariant,n.fontWeight,a+"px",n.font].filter((function(t){return t})).join(" "),r.textAlign="start",r.textBaseline="alphabetic",r.direction="ltr",b(function(t,e,r,n,a,o){r=r.replace(/\n/g,""),r=!0===o.breaklines?r.replace(/\/g,"\n"):r.replace(/\/g," ");var s="",l=[];for(I=0;I-1?parseInt(t[1+i]):0,l=a>-1?parseInt(r[1+a]):0;s!==l&&(n=n.replace(F(),"?px "),z*=Math.pow(.75,l-s),n=n.replace("?px ",F())),P+=.25*A*(l-s)}if(!0===o.superscripts){var c=t.indexOf(d),h=r.indexOf(d),f=c>-1?parseInt(t[1+c]):0,m=h>-1?parseInt(r[1+h]):0;f!==m&&(n=n.replace(F(),"?px "),z*=Math.pow(.75,m-f),n=n.replace("?px ",F())),P-=.25*A*(m-f)}if(!0===o.bolds){var g=t.indexOf(u)>-1,v=r.indexOf(u)>-1;!g&&v&&(n=x?n.replace("italic ","italic bold "):"bold "+n),g&&!v&&(n=n.replace("bold ",""))}if(!0===o.italics){var x=t.indexOf(p)>-1,_=r.indexOf(p)>-1;!x&&_&&(n="italic "+n),x&&!_&&(n=n.replace("italic ",""))}e.font=n}for(C=0;C",a="",o=i.length,s=a.length,l=e[0]===d||e[0]===y,c=0,u=-s;c>-1&&!(-1===(c=r.indexOf(i,c))||(u=r.indexOf(a,c+o),-1===u)||u<=c);){for(var h=c;h=u)n[h]=null,r=r.substr(0,h)+" "+r.substr(h+1);else if(null!==n[h]){var p=n[h].indexOf(e[0]);-1===p?n[h]+=e:l&&(n[h]=n[h].substr(0,p+1)+(1+parseInt(n[h][p+1]))+n[h].substr(p+2))}var f=c+o,m=r.substr(f,u-f).indexOf(i);c=-1!==m?m:u+s}return n}function _(t,e,r,i){var c=function(t,e){var r=n(t,128);return e?a(r.cells,r.positions,.25):{edges:r.cells,positions:r.positions}}(t,i),u=function(t,e,r){for(var n=e.textAlign||"start",i=e.textBaseline||"alphabetic",a=[1<<30,1<<30],o=[0,0],s=t.length,l=0;l=0?e[a]:i}))},has___:{value:x((function(e){var n=v(e);return n?r in n:t.indexOf(e)>=0}))},set___:{value:x((function(n,i){var a,o=v(n);return o?o[r]=i:(a=t.indexOf(n))>=0?e[a]=i:(a=t.length,e[a]=i,t[a]=n),this}))},delete___:{value:x((function(n){var i,a,o=v(n);return o?r in o&&delete o[r]:!((i=t.indexOf(n))<0||(a=t.length-1,t[i]=void 0,e[i]=e[a],t[i]=t[a],t.length=a,e.length=a,0))}))}})};m.prototype=Object.create(Object.prototype,{get:{value:function(t,e){return this.get___(t,e)},writable:!0,configurable:!0},has:{value:function(t){return this.has___(t)},writable:!0,configurable:!0},set:{value:function(t,e){return this.set___(t,e)},writable:!0,configurable:!0},delete:{value:function(t){return this.delete___(t)},writable:!0,configurable:!0}}),"function"==typeof r?function(){function n(){this instanceof m||_();var t,n=new r,i=void 0,a=!1;return t=e?function(t,e){return n.set(t,e),n.has(t)||(i||(i=new m),i.set(t,e)),this}:function(t,e){if(a)try{n.set(t,e)}catch{i||(i=new m),i.set___(t,e)}else n.set(t,e);return this},Object.create(m.prototype,{get___:{value:x((function(t,e){return i?n.has(t)?n.get(t):i.get___(t,e):n.get(t,e)}))},has___:{value:x((function(t){return n.has(t)||!!i&&i.has___(t)}))},set___:{value:x(t)},delete___:{value:x((function(t){var e=!!n.delete(t);return i&&i.delete___(t)||e}))},permitHostObjects___:{value:x((function(t){if(t!==g)throw new Error("bogus call to permitHostObjects___");a=!0}))}})}e&&typeof Proxy<"u"&&(Proxy=void 0),n.prototype=m.prototype,t.exports=n,Object.defineProperty(WeakMap.prototype,"constructor",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})}():(typeof Proxy<"u"&&(Proxy=void 0),t.exports=m)}function g(t){t.permitHostObjects___&&t.permitHostObjects___(g)}function y(t){return!(t.substr(0,8)==l&&"___"===t.substr(t.length-3))}function v(t){if(t!==Object(t))throw new TypeError("Not an object: "+t);var e=t[c];if(e&&e.key===t)return e;if(s(t)){e={key:t};try{return o(t,c,{value:e,writable:!1,enumerable:!1,configurable:!1}),e}catch{return}}}function x(t){return t.prototype=null,Object.freeze(t)}function _(){!f&&typeof console<"u"&&(f=!0,console.warn("WeakMap should be invoked as new WeakMap(), not WeakMap(). This will be an error in the future."))}}()},236:function(t,e,r){var n=r(8284);t.exports=function(){var t={};return function(e){if(("object"!=typeof e||null===e)&&"function"!=typeof e)throw new Error("Weakmap-shim: Key must be object");var r=e.valueOf(t);return r&&r.identity===t?r:n(e,t)}}},8284:function(t){t.exports=function(t,e){var r={identity:e},n=t.valueOf;return Object.defineProperty(t,"valueOf",{value:function(t){return t!==e?n.apply(this,arguments):r},writable:!0}),r}},606:function(t,e,r){var n=r(236);t.exports=function(){var t=n();return{get:function(e,r){var n=t(e);return n.hasOwnProperty("value")?n.value:r},set:function(e,r){return t(e).value=r,this},has:function(e){return"value"in t(e)},delete:function(e){return delete t(e).value}}}},3349:function(t){var e,r,n=function(){return function(t,e,r,n,i,a){var o=t[0],s=r[0],l=[0],c=s;n|=0;var u=0,h=s;for(u=0;u=0!=f>=0&&i.push(l[0]+.5+.5*(p+f)/(p-f)),n+=h,++l[0]}}};t.exports=(e=n.bind(void 0,{funcName:"zeroCrossings"}),r={},function(t,n,i){var a=t.dtype,o=t.order,s=[a,o.join()].join(),l=r[s];return l||(r[s]=l=e([a,o])),l(t.shape.slice(0),t.data,t.stride,0|t.offset,n,i)})},781:function(t,e,r){t.exports=function(t,e){var r=[];return e=+e||0,n(t.hi(t.shape[0]-1),r,e),r};var n=r(3349)},7790:function(){}},r={};function n(e){var i=r[e];if(void 0!==i)return i.exports;var a=r[e]={id:e,loaded:!1,exports:{}};return t[e].call(a.exports,a,a.exports,n),a.loaded=!0,a.exports}n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch{if("object"==typeof window)return window}}(),n.nmd=function(t){return t.paths=[],t.children||(t.children=[]),t};var i=n(1964);e.exports=i}()}}),Id=f({"node_modules/color-name/index.js"(t,e){e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}}}),Ld=f({"node_modules/color-normalize/node_modules/color-parse/index.js"(t,e){var r=Id();e.exports=function(t){var e,i,a=[],o=1;if("string"==typeof t)if(t=t.toLowerCase(),r[t])a=r[t].slice(),i="rgb";else if("transparent"===t)o=0,i="rgb",a=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(t)){var s=t.slice(1);o=1,(u=s.length)<=4?(a=[parseInt(s[0]+s[0],16),parseInt(s[1]+s[1],16),parseInt(s[2]+s[2],16)],4===u&&(o=parseInt(s[3]+s[3],16)/255)):(a=[parseInt(s[0]+s[1],16),parseInt(s[2]+s[3],16),parseInt(s[4]+s[5],16)],8===u&&(o=parseInt(s[6]+s[7],16)/255)),a[0]||(a[0]=0),a[1]||(a[1]=0),a[2]||(a[2]=0),i="rgb"}else if(e=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(t)){var l=e[1],c="rgb"===l;i=s=l.replace(/a$/,"");var u="cmyk"===s?4:"gray"===s?1:3;a=e[2].trim().split(/\s*[,\/]\s*|\s+/).map((function(t,e){if(/%$/.test(t))return e===u?parseFloat(t)/100:"rgb"===s?255*parseFloat(t)/100:parseFloat(t);if("h"===s[e]){if(/deg$/.test(t))return parseFloat(t);if(void 0!==n[t])return n[t]}return parseFloat(t)})),l===s&&a.push(1),o=c||void 0===a[u]?1:a[u],a=a.slice(0,u)}else t.length>10&&/[0-9](?:\s|\/)/.test(t)&&(a=t.match(/([0-9]+)/g).map((function(t){return parseFloat(t)})),i=t.match(/([a-z])/gi).join("").toLowerCase());else isNaN(t)?Array.isArray(t)||t.length?(a=[t[0],t[1],t[2]],i="rgb",o=4===t.length?t[3]:1):t instanceof Object&&(null!=t.r||null!=t.red||null!=t.R?(i="rgb",a=[t.r||t.red||t.R||0,t.g||t.green||t.G||0,t.b||t.blue||t.B||0]):(i="hsl",a=[t.h||t.hue||t.H||0,t.s||t.saturation||t.S||0,t.l||t.lightness||t.L||t.b||t.brightness]),o=t.a||t.alpha||t.opacity||1,null!=t.opacity&&(o/=100)):(i="rgb",a=[t>>>16,(65280&t)>>>8,255&t]);return{space:i,values:a,alpha:o}};var n={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}}),Pd=f({"node_modules/color-normalize/node_modules/color-rgba/index.js"(t,e){var r=Ld();e.exports=function(t){Array.isArray(t)&&t.raw&&(t=String.raw.apply(null,arguments));var e,n=r(t);if(!n.space)return[];var i=[0,0,0],a="h"===n.space[0]?[360,100,100]:[255,255,255];return(e=Array(3))[0]=Math.min(Math.max(n.values[0],i[0]),a[0]),e[1]=Math.min(Math.max(n.values[1],i[1]),a[1]),e[2]=Math.min(Math.max(n.values[2],i[2]),a[2]),"h"===n.space[0]&&(e=function(t){var e,r,n,i,a,o=t[0]/360,s=t[1]/100,l=t[2]/100,c=0;if(0===s)return[a=255*l,a,a];for(e=2*l-(r=l<.5?l*(1+s):l+s-l*s),i=[0,0,0];c<3;)(n=o+1/3*-(c-1))<0?n++:n>1&&n--,a=6*n<1?e+6*(r-e)*n:2*n<1?r:3*n<2?e+(r-e)*(2/3-n)*6:e,i[c++]=255*a;return i}(e)),e.push(Math.min(Math.max(n.alpha,0),1)),e}}}),zd=f({"node_modules/clamp/index.js"(t,e){e.exports=function(t,e,r){return er?r:t:te?e:t}}}),Dd=f({"node_modules/dtype/index.js"(t,e){e.exports=function(t){switch(t){case"int8":return Int8Array;case"int16":return Int16Array;case"int32":return Int32Array;case"uint8":return Uint8Array;case"uint16":return Uint16Array;case"uint32":return Uint32Array;case"float32":return Float32Array;case"float64":return Float64Array;case"array":return Array;case"uint8_clamped":return Uint8ClampedArray}}}}),Od=f({"node_modules/color-normalize/index.js"(t,e){var r=Pd(),n=zd(),i=Dd();e.exports=function(t,e){("float"===e||!e)&&(e="array"),"uint"===e&&(e="uint8"),"uint_clamped"===e&&(e="uint8_clamped");var a,o=new(i(e))(4),s="uint8"!==e&&"uint8_clamped"!==e;return(!t.length||"string"==typeof t)&&((t=r(t))[0]/=255,t[1]/=255,t[2]/=255),(a=t)instanceof Uint8Array||a instanceof Uint8ClampedArray||Array.isArray(a)&&(a[0]>1||0===a[0])&&(a[1]>1||0===a[1])&&(a[2]>1||0===a[2])&&(!a[3]||a[3]>1)?(o[0]=t[0],o[1]=t[1],o[2]=t[2],o[3]=null!=t[3]?t[3]:255,s&&(o[0]/=255,o[1]/=255,o[2]/=255,o[3]/=255),o):(s?(o[0]=t[0],o[1]=t[1],o[2]=t[2],o[3]=null!=t[3]?t[3]:1):(o[0]=n(Math.floor(255*t[0]),0,255),o[1]=n(Math.floor(255*t[1]),0,255),o[2]=n(Math.floor(255*t[2]),0,255),o[3]=null==t[3]?255:n(Math.floor(255*t[3]),0,255)),o)}}}),Rd=f({"src/lib/str2rgbarray.js"(t,e){var r=Od();e.exports=function(t){return t?r(t):[0,0,0,1]}}}),Fd=f({"src/lib/gl_format_color.js"(t,e){var r=A(),n=O(),i=Od(),a=Ze(),o=q().defaultLine,s=E().isArrayOrTypedArray,l=i(o);function c(t,e){var r=t;return r[3]*=e,r}function u(t){if(r(t))return l;var e=i(t);return e.length?e:l}function h(t){return r(t)?t:1}e.exports={formatColor:function(t,e,r){var n=t.color;n&&n._inputArray&&(n=n._inputArray);var o,p,f,d,m,g=s(n),y=s(e),v=a.extractOpts(t),x=[];if(o=void 0!==v.colorscale?a.makeColorScaleFuncFromTrace(t):u,p=g?function(t,e){return void 0===t[e]?l:i(o(t[e]))}:u,f=y?function(t,e){return void 0===t[e]?1:h(t[e])}:h,g||y)for(var _=0;_0){var p=i.c2l(u);i._lowerLogErrorBound||(i._lowerLogErrorBound=p),i._lowerErrorBound=Math.min(i._lowerLogErrorBound,p)}}else o[s]=[-l[0]*n,l[1]*n]}return o}e.exports=function(t,e,r){var i=[n(t.x,t.error_x,e[0],r.xaxis),n(t.y,t.error_y,e[1],r.yaxis),n(t.z,t.error_z,e[2],r.zaxis)],a=function(t){for(var e=0;e-1?-1:t.indexOf("right")>-1?1:0}function x(t){return null==t?0:t.indexOf("top")>-1?-1:t.indexOf("bottom")>-1?1:0}function _(t,e){return e(4*t)}function b(t){return p[t]}function w(t,e,r,n,i){var a=null;if(s.isArrayOrTypedArray(t)){a=[];for(var o=0;o=0){var E=function(t,e,r){var n,i=(r+1)%3,a=(r+2)%3,s=[],l=[];for(n=0;n=0&&h("surfacecolor",f||d);for(var m=["x","y","z"],g=0;g<3;++g){var y="projection."+m[g];h(y+".show")&&(h(y+".opacity"),h(y+".scale"))}var v=r.getComponentMethod("errorbars","supplyDefaults");v(t,e,f||d||c,{axis:"z"}),v(t,e,f||d||c,{axis:"y",inherit:"z"}),v(t,e,f||d||c,{axis:"x",inherit:"z"})}else e.visible=!1}}}),Hd=f({"src/traces/scatter3d/calc.js"(t,e){var r=ii(),n=ni();e.exports=function(t,e){var i=[{x:!1,y:!1,trace:e,t:{}}];return r(i,e),n(t,e),i}}}),Gd=f({"node_modules/get-canvas-context/index.js"(t,e){e.exports=function(t,e){if("string"!=typeof t)throw new TypeError("must specify type string");if(e=e||{},typeof document>"u"&&!e.canvas)return null;var r=e.canvas||document.createElement("canvas");"number"==typeof e.width&&(r.width=e.width),"number"==typeof e.height&&(r.height=e.height);var n,i=e;try{var a=[t];0===t.indexOf("webgl")&&a.push("experimental-"+t);for(var o=0;o/g," "));l[c]=f,u.tickmode=h}}for(e.ticks=l,c=0;c<3;++c)for(a[c]=.5*(t.glplot.bounds[0][c]+t.glplot.bounds[1][c]),d=0;d<2;++d)e.bounds[d][c]=t.glplot.bounds[d][c];t.contourLevels=function(t){for(var e=new Array(3),r=0;r<3;++r){for(var n=t[r],i=new Array(n.length),a=0;ar.deltaY?1.1:.9090909090909091,a=t.glplot.getAspectratio();t.glplot.setAspectratio({x:n*a.x,y:n*a.y,z:n*a.z})}i(t)}}),!!l&&{passive:!1}),t.glplot.canvas.addEventListener("mousemove",(function(){if(!1!==t.fullSceneLayout.dragmode&&0!==t.camera.mouseListener.buttons){var e=n();t.graphDiv.emit("plotly_relayouting",e)}})),t.staticMode||t.glplot.canvas.addEventListener("webglcontextlost",(function(r){e&&e.emit&&e.emit("plotly_webglcontextlost",{event:r,layer:t.id})}),!1)),t.glplot.oncontextloss=function(){t.recoverContext()},t.glplot.onrender=function(){t.render()},!0},T.render=function(){var t,e=this,r=e.graphDiv,n=e.svgContainer,i=e.container.getBoundingClientRect();r._fullLayout._calcInverseTransform(r);var a=r._fullLayout._invScaleX,o=r._fullLayout._invScaleY,s=i.width*a,l=i.height*o;n.setAttributeNS(null,"viewBox","0 0 "+s+" "+l),n.setAttributeNS(null,"width",s),n.setAttributeNS(null,"height",l),x(e),e.glplot.axes.update(e.axesOptions);for(var c=Object.keys(e.traces),h=null,d=e.glplot.selection,m=0;m")):"isosurface"===t.type||"volume"===t.type?(T.valueLabel=p.hoverLabelText(e._mockAxis,e._mockAxis.d2l(d.traceCoordinate[3]),t.valuehoverformat),E.push("value: "+T.valueLabel),d.textLabel&&E.push(d.textLabel),S=E.join("
")):S=d.textLabel;var C={x:d.traceCoordinate[0],y:d.traceCoordinate[1],z:d.traceCoordinate[2],data:_._input,fullData:_,curveNumber:_.index,pointNumber:w};f.appendArrayPointValue(C,_,w),t._module.eventData&&(C=_._module.eventData(C,d,_,{},w));var I={points:[C]};if(e.fullSceneLayout.hovermode){var L=[];f.loneHover({trace:_,x:(.5+.5*v[0]/v[3])*s,y:(.5-.5*v[1]/v[3])*l,xLabel:T.xLabel,yLabel:T.yLabel,zLabel:T.zLabel,text:S,name:h.name,color:f.castHoverOption(_,w,"bgcolor")||h.color,borderColor:f.castHoverOption(_,w,"bordercolor"),fontFamily:f.castHoverOption(_,w,"font.family"),fontSize:f.castHoverOption(_,w,"font.size"),fontColor:f.castHoverOption(_,w,"font.color"),nameLength:f.castHoverOption(_,w,"namelength"),textAlign:f.castHoverOption(_,w,"align"),hovertemplate:u.castOption(_,w,"hovertemplate"),hovertemplateLabels:u.extendFlat({},C,T),eventData:[C]},{container:n,gd:r,inOut_bbox:L}),C.bbox=L[0]}d.distance<5&&(d.buttons||b)?r.emit("plotly_click",I):r.emit("plotly_hover",I),this.oldEventData=I}else f.loneUnhover(n),this.oldEventData&&r.emit("plotly_unhover",this.oldEventData),this.oldEventData=void 0;e.drawAnnotations(e)},T.recoverContext=function(){var t=this;t.glplot.dispose();var e=function(){t.glplot.gl.isContextLost()?requestAnimationFrame(e):t.initializeGLPlot()?t.plot.apply(t,t.plotArgs):u.error("Catastrophic and unrecoverable WebGL error. Context lost.")};requestAnimationFrame(e)};var k=["xaxis","yaxis","zaxis"];function M(t,e,r){for(var n=t.fullSceneLayout,i=0;i<3;i++){var a=k[i],o=a.charAt(0),s=n[a],l=e[o],c=e[o+"calendar"],h=e["_"+o+"length"];if(u.isArrayOrTypedArray(l))for(var p,f=0;f<(h||l.length);f++)if(u.isArrayOrTypedArray(l[f]))for(var d=0;dg[1][o])g[0][o]=-1,g[1][o]=1;else{var L=g[1][o]-g[0][o];g[0][o]-=L/32,g[1][o]+=L/32}if(x=[g[0][o],g[1][o]],x=_(x,l),g[0][o]=x[0],g[1][o]=x[1],l.isReversed()){var P=g[0][o];g[0][o]=g[1][o],g[1][o]=P}}else x=l.range,g[0][o]=l.r2l(x[0]),g[1][o]=l.r2l(x[1]);g[0][o]===g[1][o]&&(g[0][o]-=1,g[1][o]+=1),y[o]=g[1][o]-g[0][o],l.range=[g[0][o],g[1][o]],l.limitRange(),n.glplot.setBounds(o,{min:l.range[0]*f[o],max:l.range[1]*f[o]})}var z,D=u.aspectmode;if("cube"===D)z=[1,1,1];else if("manual"===D){var O=u.aspectratio;z=[O.x,O.y,O.z]}else{if("auto"!==D&&"data"!==D)throw new Error("scene.js aspectRatio was not one of the enumerated types");var R=[1,1,1];for(o=0;o<3;++o){var F=v[c=(l=u[k[o]]).type];R[o]=Math.pow(F.acc,1/F.count)/f[o]}z="data"===D||Math.max.apply(null,R)/Math.min.apply(null,R)<=4?R:[1,1,1]}u.aspectratio.x=h.aspectratio.x=z[0],u.aspectratio.y=h.aspectratio.y=z[1],u.aspectratio.z=h.aspectratio.z=z[2],n.glplot.setAspectratio(u.aspectratio),n.viewInitial.aspectratio||(n.viewInitial.aspectratio={x:u.aspectratio.x,y:u.aspectratio.y,z:u.aspectratio.z}),n.viewInitial.aspectmode||(n.viewInitial.aspectmode=u.aspectmode);var B=u.domain||null,j=e._size||null;if(B&&j){var N=n.container.style;N.position="absolute",N.left=j.l+B.x[0]*j.w+"px",N.top=j.t+(1-B.y[1])*j.h+"px",N.width=j.w*(B.x[1]-B.x[0])+"px",N.height=j.h*(B.y[1]-B.y[0])+"px"}n.glplot.redraw()}},T.destroy=function(){var t=this;t.glplot&&(t.camera.mouseListener.enabled=!1,t.container.removeEventListener("wheel",t.camera.wheelListener),t.camera=null,t.glplot.dispose(),t.container.parentNode.removeChild(t.container),t.glplot=null)},T.getCamera=function(){var t=this;return t.camera.view.recalcMatrix(t.camera.view.lastT()),function(t){return{up:{x:t.up[0],y:t.up[1],z:t.up[2]},center:{x:t.center[0],y:t.center[1],z:t.center[2]},eye:{x:t.eye[0],y:t.eye[1],z:t.eye[2]},projection:{type:!0===t._ortho?"orthographic":"perspective"}}}(t.camera)},T.setViewport=function(t){var e=this,r=t.camera;e.camera.lookAt.apply(this,function(t){return[[t.eye.x,t.eye.y,t.eye.z],[t.center.x,t.center.y,t.center.z],[t.up.x,t.up.y,t.up.z]]}(r)),e.glplot.setAspectratio(t.aspectratio),"orthographic"===r.projection.type!==e.camera._ortho&&(e.glplot.redraw(),e.glplot.clearRGBA(),e.glplot.dispose(),e.initializeGLPlot())},T.isCameraChanged=function(t){var e,r,n,i,a,o,s=this.getCamera(),l=u.nestedProperty(t,this.id+".camera").get(),c=!1;if(void 0===l)c=!0;else{for(var h=0;h<3;h++)for(var p=0;p<3;p++)if(e=s,i=p,void 0,void 0,o=["x","y","z"],!(r=l)[(a=["up","center","eye"])[n=h]]||e[a[n]][o[i]]!==r[a[n]][o[i]]){c=!0;break}(!l.projection||s.projection&&s.projection.type!==l.projection.type)&&(c=!0)}return c},T.isAspectChanged=function(t){var e=this.glplot.getAspectratio(),r=u.nestedProperty(t,this.id+".aspectratio").get();return void 0===r||r.x!==e.x||r.y!==e.y||r.z!==e.z},T.saveLayout=function(t){var e,r,n,i,a,o,s=this,l=s.fullLayout,h=s.isCameraChanged(t),p=s.isAspectChanged(t),f=h||p;if(f){var d={};h&&(e=s.getCamera(),n=(r=u.nestedProperty(t,s.id+".camera")).get(),d[s.id+".camera"]=n),p&&(i=s.glplot.getAspectratio(),o=(a=u.nestedProperty(t,s.id+".aspectratio")).get(),d[s.id+".aspectratio"]=o),c.call("_storeDirectGUIEdit",t,l._preGUI,d),h&&(r.set(e),u.nestedProperty(l,s.id+".camera").set(e)),p&&(a.set(i),u.nestedProperty(l,s.id+".aspectratio").set(i),s.glplot.redraw())}return f},T.updateFx=function(t,e){var r=this,n=r.camera;if(n)if("orbit"===t)n.mode="orbit",n.keyBindingMode="rotate";else if("turntable"===t){n.up=[0,0,1],n.mode="turntable",n.keyBindingMode="rotate";var i=r.graphDiv,a=i._fullLayout,o=r.fullSceneLayout.camera,s=o.up.x,l=o.up.y,h=o.up.z;if(h/Math.sqrt(s*s+l*l+h*h)<.999){var p=r.id+".camera.up",f={x:0,y:0,z:1},d={};d[p]=f;var m=i.layout;c.call("_storeDirectGUIEdit",m,a._preGUI,d),o.up=f,u.nestedProperty(m,p).set(f)}}else n.keyBindingMode=t;r.fullSceneLayout.hovermode=e},T.toImage=function(t){var e=this;t||(t="png"),e.staticMode&&e.container.appendChild(r),e.glplot.redraw();var n=e.glplot.gl,i=n.drawingBufferWidth,a=n.drawingBufferHeight;n.bindFramebuffer(n.FRAMEBUFFER,null);var o=new Uint8Array(i*a*4);n.readPixels(0,0,i,a,n.RGBA,n.UNSIGNED_BYTE,o),function(t,e,r){for(var n=0,i=r-1;n0)for(var s=255/o,l=0;l<3;++l)t[a+l]=Math.min(s*t[a+l],255)}}(o,i,a);var s=document.createElement("canvas");s.width=i,s.height=a;var l,c=s.getContext("2d",{willReadFrequently:!0}),u=c.createImageData(i,a);switch(u.data.set(o),c.putImageData(u,0,0),t){case"jpeg":l=s.toDataURL("image/jpeg");break;case"webp":l=s.toDataURL("image/webp");break;default:l=s.toDataURL("image/png")}return e.staticMode&&e.container.removeChild(r),l},T.setConvert=function(){for(var t=0;t<3;t++){var e=this.fullSceneLayout[k[t]];p.setConvert(e,this.fullLayout),e.setScale=u.noop}},T.make4thDimension=function(){var t=this,e=t.graphDiv._fullLayout;t._mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},p.setConvert(t._mockAxis,e)},e.exports=w}}),Jd=f({"src/plots/gl3d/layout/attributes.js"(t,e){e.exports={scene:{valType:"subplotid",dflt:"scene",editType:"calc+clearAxisTypes"}}}}),Qd=f({"src/plots/gl3d/layout/axis_attributes.js"(t,e){var r=H(),n=Ie(),i=R().extendFlat,a=Pt().overrideAll;e.exports=a({visible:n.visible,showspikes:{valType:"boolean",dflt:!0},spikesides:{valType:"boolean",dflt:!0},spikethickness:{valType:"number",min:0,dflt:2},spikecolor:{valType:"color",dflt:r.defaultLine},showbackground:{valType:"boolean",dflt:!1},backgroundcolor:{valType:"color",dflt:"rgba(204, 204, 204, 0.5)"},showaxeslabels:{valType:"boolean",dflt:!0},color:n.color,categoryorder:n.categoryorder,categoryarray:n.categoryarray,title:{text:n.title.text,font:n.title.font},type:i({},n.type,{values:["-","linear","log","date","category"]}),autotypenumbers:n.autotypenumbers,autorange:n.autorange,autorangeoptions:{minallowed:n.autorangeoptions.minallowed,maxallowed:n.autorangeoptions.maxallowed,clipmin:n.autorangeoptions.clipmin,clipmax:n.autorangeoptions.clipmax,include:n.autorangeoptions.include,editType:"plot"},rangemode:n.rangemode,minallowed:n.minallowed,maxallowed:n.maxallowed,range:i({},n.range,{items:[{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}}],anim:!1}),tickmode:n.minor.tickmode,nticks:n.nticks,tick0:n.tick0,dtick:n.dtick,tickvals:n.tickvals,ticktext:n.ticktext,ticks:n.ticks,mirror:n.mirror,ticklen:n.ticklen,tickwidth:n.tickwidth,tickcolor:n.tickcolor,showticklabels:n.showticklabels,labelalias:n.labelalias,tickfont:n.tickfont,tickangle:n.tickangle,tickprefix:n.tickprefix,showtickprefix:n.showtickprefix,ticksuffix:n.ticksuffix,showticksuffix:n.showticksuffix,showexponent:n.showexponent,exponentformat:n.exponentformat,minexponent:n.minexponent,separatethousands:n.separatethousands,tickformat:n.tickformat,tickformatstops:n.tickformatstops,hoverformat:n.hoverformat,showline:n.showline,linecolor:n.linecolor,linewidth:n.linewidth,showgrid:n.showgrid,gridcolor:i({},n.gridcolor,{dflt:"rgb(204, 204, 204)"}),gridwidth:n.gridwidth,zeroline:n.zeroline,zerolinecolor:n.zerolinecolor,zerolinewidth:n.zerolinewidth},"plot","from-root")}}),tm=f({"src/plots/gl3d/layout/layout_attributes.js"(t,e){var r=Qd(),n=Aa().attributes,i=R().extendFlat,a=le().counterRegex;function o(t,e,r){return{x:{valType:"number",dflt:t,editType:"camera"},y:{valType:"number",dflt:e,editType:"camera"},z:{valType:"number",dflt:r,editType:"camera"},editType:"camera"}}e.exports={_arrayAttrRegexps:[a("scene",".annotations",!0)],bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"plot"},camera:{up:i(o(0,0,1),{}),center:i(o(0,0,0),{}),eye:i(o(1.25,1.25,1.25),{}),projection:{type:{valType:"enumerated",values:["perspective","orthographic"],dflt:"perspective",editType:"calc"},editType:"calc"},editType:"camera"},domain:n({name:"scene",editType:"plot"}),aspectmode:{valType:"enumerated",values:["auto","cube","data","manual"],dflt:"auto",editType:"plot",impliedEdits:{"aspectratio.x":void 0,"aspectratio.y":void 0,"aspectratio.z":void 0}},aspectratio:{x:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},y:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},z:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},editType:"plot",impliedEdits:{aspectmode:"manual"}},xaxis:r,yaxis:r,zaxis:r,dragmode:{valType:"enumerated",values:["orbit","turntable","zoom","pan",!1],editType:"plot"},hovermode:{valType:"enumerated",values:["closest",!1],dflt:"closest",editType:"modebar"},uirevision:{valType:"any",editType:"none"},editType:"plot"}}}),em=f({"src/plots/gl3d/layout/axis_defaults.js"(t,e){var r=O().mix,n=le(),i=ye(),a=Qd(),o=_i(),s=Ti(),l=["xaxis","yaxis","zaxis"],c=13600/187;e.exports=function(t,e,u){var h,p;function f(t,e){return n.coerce(h,p,a,t,e)}for(var d=0;d.999)&&(g="turntable")}else g="turntable";r("dragmode",g),r("hovermode",a.getDfltFromLayout("hovermode"))}e.exports=function(t,e,n){var i=e._basePlotModules.length>1;a(t,e,n,{type:c,attributes:s,handleDefaults:u,fullLayout:e,font:e.font,fullData:n,getDfltFromLayout:function(e){if(!i&&r.validate(t[e],s[e]))return t[e]},autotypenumbersDflt:e.autotypenumbers,paper_bgcolor:e.paper_bgcolor,calendar:e.calendar})}}}),nm=f({"src/plots/gl3d/index.js"(t){var e=Pt().overrideAll,r=j(),n=Kd(),i=we().getSubplotData,a=le(),o=ke(),s="gl3d",l="scene";t.name=s,t.attr=l,t.idRoot=l,t.idRegex=t.attrRegex=a.counterRegex("scene"),t.attributes=Jd(),t.layoutAttributes=tm(),t.baseLayoutAttrOverrides=e({hoverlabel:r.hoverlabel},"plot","nested"),t.supplyLayoutDefaults=rm(),t.plot=function(t){for(var e=t._fullLayout,r=t._fullData,a=e._subplots[s],o=0;o0){r=f[n];break}return r}function y(t,e){if(!(t<1||e<1)){for(var r=m(t),n=m(e),i=1,a=0;a_;)r--,r/=g(r),++r1?n:1},p.refineCoords=function(t){for(var e=this.dataScaleX,r=this.dataScaleY,i=t[0].shape[0],a=t[0].shape[1],o=0|Math.floor(t[0].shape[0]*e+1),s=0|Math.floor(t[0].shape[1]*r+1),l=1+i+1,c=1+a+1,u=n(new Float32Array(l*c),[l,c]),h=[1/e,0,0,0,1/r,0,0,0,1],p=0;p0&&null!==this.contourStart[t]&&null!==this.contourEnd[t]&&this.contourEnd[t]>this.contourStart[t]))for(i[t]=!0,e=this.contourStart[t];ev&&(this.minValues[m]=v),this.maxValues[m]l&&(e.isomin=null,e.isomax=null);var c=o("x"),u=o("y"),h=o("z"),p=o("value");c&&c.length&&u&&u.length&&h&&h.length&&p&&p.length?(n.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y","z"],i),o("valuehoverformat"),["x","y","z"].forEach((function(t){o(t+"hoverformat");var e="caps."+t;o(e+".show")&&o(e+".fill");var r="slices."+t;o(r+".show")&&(o(r+".fill"),o(r+".locations"))})),o("spaceframe.show")&&o("spaceframe.fill"),o("surface.show")&&(o("surface.count"),o("surface.fill"),o("surface.pattern")),o("contour.show")&&(o("contour.color"),o("contour.width")),["text","hovertext","hovertemplate","lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","flatshading","opacity"].forEach((function(t){o(t)})),a(t,e,i,o,{prefix:"",cLetter:"c"}),e._length=null):e.visible=!1}e.exports={supplyDefaults:function(t,e,n,a){o(t,e,0,a,(function(n,a){return r.coerce(t,e,i,n,a)}))},supplyIsoDefaults:o}}}),mm=f({"src/traces/streamtube/calc.js"(t,e){var r=le(),n=We();function i(t){var e,n,i,o,s,l,c,u,h,p,f,d,m=t._x,g=t._y,y=t._z,v=t._len,x=-1/0,_=1/0,b=-1/0,w=1/0,T=-1/0,A=1/0,k="";for(v&&(c=m[0],h=g[0],f=y[0]),v>1&&(u=m[v-1],p=g[v-1],d=y[v-1]),e=0;eu?"-":"+")+"x")).replace("y",(h>p?"-":"+")+"y")).replace("z",(f>d?"-":"+")+"z");var C=function(){v=0,M=[],S=[],E=[]};(!v||v0;r--){var n=Math.min(e[r],e[r-1]),i=Math.max(e[r],e[r-1]);if(i>n&&n-1}function F(t,e){return null===t?e:t}function B(t,e,r){I();var n=[e],i=[r];if(s>=1)n=[e],i=[r];else if(s>0){var a=function(t,e){var r=t[0],n=t[1],i=t[2],a=function(t,e,r){for(var n=[],i=0;i-1?r[c]:C(u,h,p);l[c]=d>-1?d:P(u,h,p,F(t,f))}z(l[0],l[1],l[2])}}function j(t,e,r,n){var i=t[3];in&&(i=n);for(var a=(t[3]-i)/(t[3]-e[3]+1e-9),o=[],s=0;s<4;s++)o[s]=(1-a)*t[s]+a*e[s];return o}function N(t,e,r){return t>=e&&t<=r}function U(t){var e=.001*(E-S);return t>=S-e&&t<=E+e}function V(e){for(var r=[],n=0;n<4;n++){var i=e[n];r.push([t._x[i],t._y[i],t._z[i],t._value[i]])}return r}function q(t,e,r,n,i,a){a||(a=1),r=[-1,-1,-1];var o=!1,s=[N(e[0][3],n,i),N(e[1][3],n,i),N(e[2][3],n,i)];if(!s[0]&&!s[1]&&!s[2])return!1;var l=function(t,e,r){return U(e[0][3])&&U(e[1][3])&&U(e[2][3])?(B(t,e,r),!0):a<3&&q(t,e,r,S,E,++a)};if(s[0]&&s[1]&&s[2])return l(t,e,r)||o;var c=!1;return[[0,1,2],[2,0,1],[1,2,0]].forEach((function(a){if(s[a[0]]&&s[a[1]]&&!s[a[2]]){var u=e[a[0]],h=e[a[1]],p=e[a[2]],f=j(p,u,n,i),d=j(p,h,n,i);o=l(t,[d,f,u],[-1,-1,r[a[0]]])||o,o=l(t,[u,h,d],[r[a[0]],r[a[1]],-1])||o,c=!0}})),c||[[0,1,2],[1,2,0],[2,0,1]].forEach((function(a){if(s[a[0]]&&!s[a[1]]&&!s[a[2]]){var u=e[a[0]],h=e[a[1]],p=e[a[2]],f=j(h,u,n,i),d=j(p,u,n,i);o=l(t,[d,f,u],[-1,-1,r[a[0]]])||o,c=!0}})),o}function H(t,e,r,n){var i=!1,a=V(e),o=[N(a[0][3],r,n),N(a[1][3],r,n),N(a[2][3],r,n),N(a[3][3],r,n)];if(!(o[0]||o[1]||o[2]||o[3]))return i;if(o[0]&&o[1]&&o[2]&&o[3])return m&&(i=function(t,e,r){var n=function(n,i,a){B(t,[e[n],e[i],e[a]],[r[n],r[i],r[a]])};n(0,1,2),n(3,0,1),n(2,3,0),n(1,2,3)}(t,a,e)||i),i;var s=!1;return[[0,1,2,3],[3,0,1,2],[2,3,0,1],[1,2,3,0]].forEach((function(l){if(o[l[0]]&&o[l[1]]&&o[l[2]]&&!o[l[3]]){var c=a[l[0]],u=a[l[1]],h=a[l[2]],p=a[l[3]];if(m)i=B(t,[c,u,h],[e[l[0]],e[l[1]],e[l[2]]])||i;else{var f=j(p,c,r,n),d=j(p,u,r,n),g=j(p,h,r,n);i=B(null,[f,d,g],[-1,-1,-1])||i}s=!0}})),s||([[0,1,2,3],[1,2,3,0],[2,3,0,1],[3,0,1,2],[0,2,3,1],[1,3,2,0]].forEach((function(l){if(o[l[0]]&&o[l[1]]&&!o[l[2]]&&!o[l[3]]){var c=a[l[0]],u=a[l[1]],h=a[l[2]],p=a[l[3]],f=j(h,c,r,n),d=j(h,u,r,n),g=j(p,u,r,n),y=j(p,c,r,n);m?(i=B(t,[c,y,f],[e[l[0]],-1,-1])||i,i=B(t,[u,d,g],[e[l[1]],-1,-1])||i):i=function(t,e,r){var n=function(t,n,i){B(null,[e[t],e[n],e[i]],[r[t],r[n],r[i]])};n(0,1,2),n(2,3,0)}(0,[f,d,g,y],[-1,-1,-1,-1])||i,s=!0}})),s)||[[0,1,2,3],[1,2,3,0],[2,3,0,1],[3,0,1,2]].forEach((function(l){if(o[l[0]]&&!o[l[1]]&&!o[l[2]]&&!o[l[3]]){var c=a[l[0]],u=a[l[1]],h=a[l[2]],p=a[l[3]],f=j(u,c,r,n),d=j(h,c,r,n),g=j(p,c,r,n);m?(i=B(t,[c,f,d],[e[l[0]],-1,-1])||i,i=B(t,[c,d,g],[e[l[0]],-1,-1])||i,i=B(t,[c,g,f],[e[l[0]],-1,-1])||i):i=B(null,[f,d,g],[-1,-1,-1])||i,s=!0}})),i}function G(t,e,r,n,i,a,o,s,l,c,u){var h=!1;return d&&(R(t,"A")&&(h=H(null,[e,r,n,a],c,u)||h),R(t,"B")&&(h=H(null,[r,n,i,l],c,u)||h),R(t,"C")&&(h=H(null,[r,a,o,l],c,u)||h),R(t,"D")&&(h=H(null,[n,a,s,l],c,u)||h),R(t,"E")&&(h=H(null,[r,n,a,l],c,u)||h)),m&&(h=H(t,[r,n,a,l],c,u)||h),h}function W(t,e,r,n,i,a,o,s){return[!0===s[0]||q(t,V([e,r,n]),[e,r,n],a,o),!0===s[1]||q(t,V([n,i,e]),[n,i,e],a,o)]}function Z(t,e,r,n,i,a,o,s,l){return s?W(t,e,r,i,n,a,o,l):W(t,r,i,n,e,a,o,l)}function Y(t,e,r,n,i,a,o){var s,l,c,u,h=!1,p=function(){h=q(t,[s,l,c],[-1,-1,-1],i,a)||h,h=q(t,[c,u,s],[-1,-1,-1],i,a)||h},f=o[0],d=o[1],m=o[2];return f&&(s=D(V([A(e,r-0,n-0)])[0],V([A(e-1,r-0,n-0)])[0],f),l=D(V([A(e,r-0,n-1)])[0],V([A(e-1,r-0,n-1)])[0],f),c=D(V([A(e,r-1,n-1)])[0],V([A(e-1,r-1,n-1)])[0],f),u=D(V([A(e,r-1,n-0)])[0],V([A(e-1,r-1,n-0)])[0],f),p()),d&&(s=D(V([A(e-0,r,n-0)])[0],V([A(e-0,r-1,n-0)])[0],d),l=D(V([A(e-0,r,n-1)])[0],V([A(e-0,r-1,n-1)])[0],d),c=D(V([A(e-1,r,n-1)])[0],V([A(e-1,r-1,n-1)])[0],d),u=D(V([A(e-1,r,n-0)])[0],V([A(e-1,r-1,n-0)])[0],d),p()),m&&(s=D(V([A(e-0,r-0,n)])[0],V([A(e-0,r-0,n-1)])[0],m),l=D(V([A(e-0,r-1,n)])[0],V([A(e-0,r-1,n-1)])[0],m),c=D(V([A(e-1,r-1,n)])[0],V([A(e-1,r-1,n-1)])[0],m),u=D(V([A(e-1,r-0,n)])[0],V([A(e-1,r-0,n-1)])[0],m),p()),h}function X(t,e,r,n,i,a,o,s,l,c,u,h){var p=t;return h?(d&&"even"===t&&(p=null),G(p,e,r,n,i,a,o,s,l,c,u)):(d&&"odd"===t&&(p=null),G(p,l,s,o,a,i,n,r,e,c,u))}function $(t,e,r,n,i){for(var a=[],o=0,s=0;sMath.abs(T-M)?[k,T]:[T,M];tt(r,C[0],C[1])}}var I=[[Math.min(S,M),Math.max(S,M)],[Math.min(k,E),Math.max(k,E)]];["x","y","z"].forEach((function(r){for(var n=[],i=0;i0&&(h.push(d.id),"x"===r?p.push([d.distRatio,0,0]):"y"===r?p.push([0,d.distRatio,0]):p.push([0,0,d.distRatio]))}else u=it(1,"x"===r?_-1:"y"===r?b-1:w-1);h.length>0&&(n[a]="x"===r?et(e,h,o,s,p,n[a]):"y"===r?rt(e,h,o,s,p,n[a]):nt(e,h,o,s,p,n[a]),a++),u.length>0&&(n[a]="x"===r?$(e,u,o,s,n[a]):"y"===r?K(e,u,o,s,n[a]):J(e,u,o,s,n[a]),a++)}var m=t.caps[r];m.show&&m.fill&&(O(m.fill),n[a]="x"===r?$(e,[0,_-1],o,s,n[a]):"y"===r?K(e,[0,b-1],o,s,n[a]):J(e,[0,w-1],o,s,n[a]),a++)}})),0===g&&L(),t._meshX=n,t._meshY=i,t._meshZ=a,t._meshIntensity=o,t._Xs=y,t._Ys=v,t._Zs=x}(),t}e.exports={findNearestOnAxis:l,generateIsoMeshes:p,createIsosurfaceTrace:function(t,e){var n=t.glplot.gl,i=r({gl:n}),a=new c(t,i,e.uid);return i._trace=a,a.update(e),t.glplot.add(i),a}}}}),xm=f({"src/traces/isosurface/index.js"(t,e){e.exports={attributes:fm(),supplyDefaults:dm().supplyDefaults,calc:gm(),colorbar:{min:"cmin",max:"cmax"},plot:vm().createIsosurfaceTrace,moduleType:"trace",name:"isosurface",basePlotModule:nm(),categories:["gl3d","showLegend"],meta:{}}}}),_m=f({"lib/isosurface.js"(t,e){e.exports=xm()}}),bm=f({"src/traces/volume/attributes.js"(t,e){var r=Pe(),n=fm(),i=om(),a=U(),o=R().extendFlat,s=Pt().overrideAll,l=e.exports=s(o({x:n.x,y:n.y,z:n.z,value:n.value,isomin:n.isomin,isomax:n.isomax,surface:n.surface,spaceframe:{show:{valType:"boolean",dflt:!1},fill:{valType:"number",min:0,max:1,dflt:1}},slices:n.slices,caps:n.caps,text:n.text,hovertext:n.hovertext,xhoverformat:n.xhoverformat,yhoverformat:n.yhoverformat,zhoverformat:n.zhoverformat,valuehoverformat:n.valuehoverformat,hovertemplate:n.hovertemplate},r("",{colorAttr:"`value`",showScaleDflt:!0,editTypeOverride:"calc"}),{colorbar:n.colorbar,opacity:n.opacity,opacityscale:i.opacityscale,lightposition:n.lightposition,lighting:n.lighting,flatshading:n.flatshading,contour:n.contour,hoverinfo:o({},a.hoverinfo),showlegend:o({},a.showlegend,{dflt:!1})}),"calc","nested");l.x.editType=l.y.editType=l.z.editType=l.value.editType="calc+clearAxisTypes"}}),wm=f({"src/traces/volume/defaults.js"(t,e){var r=le(),n=bm(),i=dm().supplyIsoDefaults,a=sm().opacityscaleDefaults;e.exports=function(t,e,o,s){function l(i,a){return r.coerce(t,e,n,i,a)}i(t,e,o,s,l),a(t,e,s,l)}}}),Tm=f({"src/traces/volume/convert.js"(t,e){var r=Cd().gl_mesh3d,n=Fd().parseColorScale,i=le().isArrayOrTypedArray,a=Rd(),o=Ze().extractOpts,s=ym(),l=vm().findNearestOnAxis,c=vm().generateIsoMeshes;function u(t,e,r){this.scene=t,this.uid=r,this.mesh=e,this.name="",this.data=null,this.showContour=!1}var h=u.prototype;h.handlePick=function(t){if(t.object===this.mesh){var e=t.data.index,r=this.data._meshX[e],n=this.data._meshY[e],a=this.data._meshZ[e],o=this.data._Ys.length,s=this.data._Zs.length,c=l(r,this.data._Xs).id,u=l(n,this.data._Ys).id,h=l(a,this.data._Zs).id,p=t.index=h+s*u+s*o*c;t.traceCoordinate=[this.data._meshX[p],this.data._meshY[p],this.data._meshZ[p],this.data._value[p]];var f=this.data.hovertext||this.data.text;return i(f)&&void 0!==f[p]?t.textLabel=f[p]:f&&(t.textLabel=f),!0}},h.update=function(t){var e=this.scene,r=e.fullSceneLayout;function i(t,e,r,n){return e.map((function(e){return t.d2l(e,0,n)*r}))}this.data=c(t);var l={positions:s(i(r.xaxis,t._meshX,e.dataScale[0],t.xcalendar),i(r.yaxis,t._meshY,e.dataScale[1],t.ycalendar),i(r.zaxis,t._meshZ,e.dataScale[2],t.zcalendar)),cells:s(t._meshI,t._meshJ,t._meshK),lightPosition:[t.lightposition.x,t.lightposition.y,t.lightposition.z],ambient:t.lighting.ambient,diffuse:t.lighting.diffuse,specular:t.lighting.specular,roughness:t.lighting.roughness,fresnel:t.lighting.fresnel,vertexNormalsEpsilon:t.lighting.vertexnormalsepsilon,faceNormalsEpsilon:t.lighting.facenormalsepsilon,opacity:t.opacity,opacityscale:t.opacityscale,contourEnable:t.contour.show,contourColor:a(t.contour.color).slice(0,3),contourWidth:t.contour.width,useFacetNormals:t.flatshading},u=o(t);l.vertexIntensity=t._meshIntensity,l.vertexIntensityBounds=[u.min,u.max],l.colormap=n(t),this.mesh.update(l)},h.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()},e.exports=function(t,e){var n=t.glplot.gl,i=r({gl:n}),a=new u(t,i,e.uid);return i._trace=a,a.update(e),t.glplot.add(i),a}}}),Am=f({"src/traces/volume/index.js"(t,e){e.exports={attributes:bm(),supplyDefaults:wm(),calc:gm(),colorbar:{min:"cmin",max:"cmax"},plot:Tm(),moduleType:"trace",name:"volume",basePlotModule:nm(),categories:["gl3d","showLegend"],meta:{}}}}),km=f({"lib/volume.js"(t,e){e.exports=Am()}}),Mm=f({"src/traces/mesh3d/defaults.js"(t,e){var r=qt(),n=le(),i=qe(),a=pm();e.exports=function(t,e,o,s){function l(r,i){return n.coerce(t,e,a,r,i)}function c(t){var e=t.map((function(t){var e=l(t);return e&&n.isArrayOrTypedArray(e)?e:null}));return e.every((function(t){return t&&t.length===e[0].length}))&&e}c(["x","y","z"])?(c(["i","j","k"]),(!e.i||e.j&&e.k)&&(!e.j||e.k&&e.i)&&(!e.k||e.i&&e.j)?(r.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y","z"],s),["lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","flatshading","alphahull","delaunayaxis","opacity"].forEach((function(t){l(t)})),l("contour.show")&&(l("contour.color"),l("contour.width")),"intensity"in t?(l("intensity"),l("intensitymode"),i(t,e,s,l,{prefix:"",cLetter:"c"})):(e.showscale=!1,"facecolor"in t?l("facecolor"):"vertexcolor"in t?l("vertexcolor"):l("color",o)),l("text"),l("hovertext"),l("hovertemplate"),l("xhoverformat"),l("yhoverformat"),l("zhoverformat"),e._length=null):e.visible=!1):e.visible=!1}}}),Sm=f({"src/traces/mesh3d/calc.js"(t,e){var r=We();e.exports=function(t,e){e.intensity&&r(t,e,{vals:e.intensity,containerStr:"",cLetter:"c"})}}}),Em=f({"src/traces/mesh3d/convert.js"(t,e){var r=Cd().gl_mesh3d,n=Cd().delaunay_triangulate,i=Cd().alpha_shape,a=Cd().convex_hull,o=Fd().parseColorScale,s=le().isArrayOrTypedArray,l=Rd(),c=Ze().extractOpts,u=ym();function h(t,e,r){this.scene=t,this.uid=r,this.mesh=e,this.name="",this.color="#fff",this.data=null,this.showContour=!1}var p=h.prototype;function f(t){for(var e=[],r=t.length,n=0;n=e-.5)return!1;return!0}p.handlePick=function(t){if(t.object===this.mesh){var e=t.index=t.data.index;t.data._cellCenter?t.traceCoordinate=t.data.dataCoordinate:t.traceCoordinate=[this.data.x[e],this.data.y[e],this.data.z[e]];var r=this.data.hovertext||this.data.text;return s(r)&&void 0!==r[e]?t.textLabel=r[e]:r&&(t.textLabel=r),!0}},p.update=function(t){var e=this.scene,r=e.fullSceneLayout;this.data=t;var s,h=t.x.length,p=u(d(r.xaxis,t.x,e.dataScale[0],t.xcalendar),d(r.yaxis,t.y,e.dataScale[1],t.ycalendar),d(r.zaxis,t.z,e.dataScale[2],t.zcalendar));if(t.i&&t.j&&t.k){if(t.i.length!==t.j.length||t.j.length!==t.k.length||!g(t.i,h)||!g(t.j,h)||!g(t.k,h))return;s=u(m(t.i),m(t.j),m(t.k))}else s=0===t.alphahull?a(p):t.alphahull>0?i(t.alphahull,p):function(t,e){for(var r=["x","y","z"].indexOf(t),i=[],a=e.length,o=0;o2?t.slice(1,e-1):2===e?[(t[0]+t[1])/2]:t}function p(t){var e=t.length;return 1===e?[.5,.5]:[t[1]-t[0],t[e-1]-t[e-2]]}function f(t,e){var n=t.fullSceneLayout,c=t.dataScale,u=e._len,f={};function d(t,e){var r=n[e],a=c[l[e]];return i.simpleMap(t,(function(t){return r.d2l(t)*a}))}if(f.vectors=s(d(e._u,"xaxis"),d(e._v,"yaxis"),d(e._w,"zaxis"),u),!u)return{positions:[],cells:[]};var m=d(e._Xs,"xaxis"),g=d(e._Ys,"yaxis"),y=d(e._Zs,"zaxis");if(f.meshgrid=[m,g,y],f.gridFill=e._gridFill,e._slen)f.startingPositions=s(d(e._startsX,"xaxis"),d(e._startsY,"yaxis"),d(e._startsZ,"zaxis"));else{for(var v=g[0],x=h(m),_=h(y),b=new Array(x.length*_.length),w=0,T=0;To&&(o=t[0]),t[1]s&&(s=t[1])}function c(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(c);break;case"Point":l(t.coordinates);break;case"MultiPoint":t.coordinates.forEach(l)}}for(e in t.arcs.forEach((function(t){for(var e,r=-1,l=t.length;++ro&&(o=e[0]),e[1]s&&(s=e[1])})),t.objects)c(t.objects[e]);return[i,a,o,s]}function i(t,e){var r=e.id,n=e.bbox,i=null==e.properties?{}:e.properties,o=a(t,e);return null==r&&null==n?{type:"Feature",properties:i,geometry:o}:null==n?{type:"Feature",id:r,properties:i,geometry:o}:{type:"Feature",id:r,bbox:n,properties:i,geometry:o}}function a(t,e){var n=r(t.transform),i=t.arcs;function a(t,e){e.length&&e.pop();for(var r=i[t<0?~t:t],a=0,o=r.length;a1)n=function(t,e,r){var n,i=[],a=[];function o(t){var e=t<0?~t:t;(a[e]||(a[e]=[])).push({i:t,g:n})}function s(t){t.forEach(o)}function l(t){t.forEach(s)}return function t(e){switch(n=e,e.type){case"GeometryCollection":e.geometries.forEach(t);break;case"LineString":s(e.arcs);break;case"MultiLineString":case"Polygon":l(e.arcs);break;case"MultiPolygon":!function(t){t.forEach(l)}(e.arcs)}}(e),a.forEach(null==r?function(t){i.push(t[0].i)}:function(t){r(t[0].g,t[t.length-1].g)&&i.push(t[0].i)}),i}(0,e,r);else for(i=0,n=new Array(a=t.arcs.length);i1)for(var a,s,c=1,u=l(i[0]);cu&&(s=i[0],i[0]=i[c],i[c]=s,u=a);return i})).filter((function(t){return t.length>0}))}}function c(t,e){for(var r=0,n=t.length;r>>1;t[i]=2))throw new Error("n must be ≥2");var r,i=(l=t.bbox||n(t))[0],a=l[1],o=l[2],s=l[3];e={scale:[o-i?(o-i)/(r-1):1,s-a?(s-a)/(r-1):1],translate:[i,a]}}var l,c,h=u(e),p=t.objects,f={};function d(t){return h(t)}function m(t){var e;switch(t.type){case"GeometryCollection":e={type:"GeometryCollection",geometries:t.geometries.map(m)};break;case"Point":e={type:"Point",coordinates:d(t.coordinates)};break;case"MultiPoint":e={type:"MultiPoint",coordinates:t.coordinates.map(d)};break;default:return t}return null!=t.id&&(e.id=t.id),null!=t.bbox&&(e.bbox=t.bbox),null!=t.properties&&(e.properties=t.properties),e}for(c in p)f[c]=m(p[c]);return{type:"Topology",bbox:l,transform:e,objects:f,arcs:t.arcs.map((function(t){var e,r=0,n=1,i=t.length,a=new Array(i);for(a[0]=h(t[0],0);++r0&&(n.push(i),i=[])}return i.length>0&&n.push(i),n},t.makeLine=function(t){return 1===t.length?{type:"LineString",coordinates:t[0]}:{type:"MultiLineString",coordinates:t}},t.makePolygon=function(t){if(1===t.length)return{type:"Polygon",coordinates:t};for(var e=new Array(t.length),r=0;r0?t>180?t-360:t:t<-180?t+360:t},t.bearingToAzimuth=function(t){let e=t%360;return e<0&&(e+=360),e},t.convertArea=function(t,e="meters",r="kilometers"){if(!(t>=0))throw new Error("area must be a positive number");let i=n[e];if(!i)throw new Error("invalid original units");let a=n[r];if(!a)throw new Error("invalid final units");return t/i*a},t.convertLength=function(t,e="kilometers",r="kilometers"){if(!(t>=0))throw new Error("length must be a positive number");return p(f(t,e),r)},t.degreesToRadians=function(t){return t%360*Math.PI/180},t.earthRadius=e,t.factors=r,t.feature=i,t.featureCollection=l,t.geometry=function(t,e,r={}){switch(t){case"Point":return a(e).geometry;case"LineString":return s(e).geometry;case"Polygon":return o(e).geometry;case"MultiPoint":return u(e).geometry;case"MultiLineString":return c(e).geometry;case"MultiPolygon":return h(e).geometry;default:throw new Error(t+" is invalid")}},t.geometryCollection=function(t,e,r={}){return i({type:"GeometryCollection",geometries:t},e,r)},t.isNumber=m,t.isObject=function(t){return null!==t&&"object"==typeof t&&!Array.isArray(t)},t.lengthToDegrees=function(t,e){return d(f(t,e))},t.lengthToRadians=f,t.lineString=s,t.lineStrings=function(t,e,r={}){return l(t.map((t=>s(t,e))),r)},t.multiLineString=c,t.multiPoint=u,t.multiPolygon=h,t.point=a,t.points=function(t,e,r={}){return l(t.map((t=>a(t,e))),r)},t.polygon=o,t.polygons=function(t,e,r={}){return l(t.map((t=>o(t,e))),r)},t.radiansToDegrees=d,t.radiansToLength=p,t.round=function(t,e=0){if(e&&!(e>=0))throw new Error("precision must be a positive number");let r=Math.pow(10,e||0);return Math.round(t*r)/r},t.validateBBox=function(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach((t=>{if(!m(t))throw new Error("bbox must only contain numbers")}))},t.validateId=function(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof t))throw new Error("id must be a number or a string")}}}),Jm=f({"node_modules/@turf/meta/dist/cjs/index.cjs"(t){Object.defineProperty(t,"__esModule",{value:!0});var e=Km();function r(t,e,n){if(null!==t)for(var i,a,o,s,l,c,u,h,p=0,f=0,d=t.type,m="FeatureCollection"===d,g="Feature"===d,y=m?t.features.length:1,v=0;vc||f>u||d>h)return l=r,c=i,u=f,h=d,void(o=0);var m=e.lineString.call(void 0,[l,r],t.properties);if(!1===n(m,i,a,d,o))return!1;o++,l=r})))return!1}}}))}function l(t,r){if(!t)throw new Error("geojson is required");o(t,(function(t,n,i){if(null!==t.geometry){var a=t.geometry.type,o=t.geometry.coordinates;switch(a){case"LineString":if(!1===r(t,n,i,0,0))return!1;break;case"Polygon":for(var s=0;st+function(t){let e,r=0;switch(t.type){case"Polygon":return i(t.coordinates);case"MultiPolygon":for(e=0;e0){e+=Math.abs(s(t[0]));for(let r=1;r=e?(n+2)%e:n+2],l=i[0]*o,c=a[1]*o;r+=(s[0]*o-l)*Math.sin(c),n++}return r*a}var l=n;t.area=n,t.default=l}}),tg=f({"node_modules/@turf/centroid/dist/cjs/index.cjs"(t){Object.defineProperty(t,"__esModule",{value:!0});var e=Km(),r=Jm();function n(t,n={}){let i=0,a=0,o=0;return r.coordEach.call(void 0,t,(function(t){i+=t[0],a+=t[1],o++}),!0),e.point.call(void 0,[i/o,a/o],n.properties)}var i=n;t.centroid=n,t.default=i}}),eg=f({"node_modules/@turf/bbox/dist/cjs/index.cjs"(t){Object.defineProperty(t,"__esModule",{value:!0});var e=Jm();function r(t,r={}){if(null!=t.bbox&&!0!==r.recompute)return t.bbox;let n=[1/0,1/0,-1/0,-1/0];return e.coordEach.call(void 0,t,(t=>{n[0]>t[0]&&(n[0]=t[0]),n[1]>t[1]&&(n[1]=t[1]),n[2]0&&t[e+1][0]<0)return e;return null}switch(e="RUS"===s||"FJI"===s?function(t){var e;if(null===c(t))e=t;else for(e=new Array(t.length),i=0;ie?r[n++]=[t[i][0]+360,t[i][1]]:i===e?(r[n++]=t[i],r[n++]=[t[i][0],-90]):r[n++]=t[i];var a=h.tester(r);a.pts.pop(),l.push(a)}:function(t){l.push(h.tester(t))},a.type){case"MultiPolygon":for(r=0;r0?h.properties.ct=function(t){var e,r=t.geometry;if("MultiPolygon"===r.type)for(var n=r.coordinates,o=0,s=0;so&&(o=c,e=l)}else e=r;return a(e).geometry.coordinates}(h):h.properties.ct=[NaN,NaN],n.fIn=t,n.fOut=h,s.push(h)}else l.log(["Location",n.loc,"does not have a valid GeoJSON geometry.","Traces with locationmode *geojson-id* only support","*Polygon* and *MultiPolygon* geometries."].join(" "))}delete o[r]}switch(r.type){case"FeatureCollection":var p=r.features;for(n=0;n100?(clearInterval(a),n("Unexpected error while fetching from "+t)):void i++}),50)}))}for(var o=0;o")}function f(t){return t+"°"}}(c,m,t,l[0].t.labels),t.hovertemplate=c.hovertemplate,[t]}}}}),og=f({"src/traces/scattergeo/event_data.js"(t,e){e.exports=function(t,e,r,n,i){t.lon=e.lon,t.lat=e.lat,t.location=e.loc?e.loc:null;var a=n[i];return a.fIn&&a.fIn.properties&&(t.properties=a.fIn.properties),t}}}),sg=f({"src/traces/scattergeo/select.js"(t,e){var r=Ye(),n=k().BADNUM;e.exports=function(t,e){var i,a,o,s,l,c=t.cd,u=t.xaxis,h=t.yaxis,p=[],f=c[0].trace;if(!r.hasMarkers(f)&&!r.hasText(f))return[];if(!1===e)for(l=0;le?1:t>=e?0:NaN}function r(t){return 1===t.length&&(t=function(t){return function(r,n){return e(t(r),n)}}(t)),{left:function(e,r,n,i){for(null==n&&(n=0),null==i&&(i=e.length);n>>1;t(e[a],r)<0?n=a+1:i=a}return n},right:function(e,r,n,i){for(null==n&&(n=0),null==i&&(i=e.length);n>>1;t(e[a],r)>0?i=a:n=a+1}return n}}}var n=r(e),i=n.right,a=n.left;function o(t,e){return[t,e]}function s(t){return null===t?NaN:+t}function l(t,e){var r,n,i=t.length,a=0,o=-1,l=0,c=0;if(null==e)for(;++o1)return c/(a-1)}function c(t,e){var r=l(t,e);return r&&Math.sqrt(r)}function u(t,e){var r,n,i,a=t.length,o=-1;if(null==e){for(;++o=r)for(n=i=r;++or&&(n=r),i=r)for(n=i=r;++or&&(n=r),i=0?(a>=y?10:a>=v?5:a>=x?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(a>=y?10:a>=v?5:a>=x?2:1)}function b(t,e,r){var n=Math.abs(e-t)/Math.max(0,r),i=Math.pow(10,Math.floor(Math.log(n)/Math.LN10)),a=n/i;return a>=y?i*=10:a>=v?i*=5:a>=x&&(i*=2),e=1)return+r(t[n-1],n-1,t);var n,i=(n-1)*e,a=Math.floor(i),o=+r(t[a],a,t);return o+(+r(t[a+1],a+1,t)-o)*(i-a)}}function A(t,e){var r,n,i=t.length,a=-1;if(null==e){for(;++a=r)for(n=r;++ar&&(n=r)}else for(;++a=r)for(n=r;++ar&&(n=r);return n}function k(t){if(!(i=t.length))return[];for(var e=-1,r=A(t,M),n=new Array(r);++et?1:e>=t?0:NaN},t.deviation=c,t.extent=u,t.histogram=function(){var t=m,e=u,r=w;function n(n){var a,o,s=n.length,l=new Array(s);for(a=0;ah;)p.pop(),--f;var d,m=new Array(f+1);for(a=0;a<=f;++a)(d=m[a]=[]).x0=a>0?p[a-1]:u,d.x1=a=r)for(n=r;++an&&(n=r)}else for(;++a=r)for(n=r;++an&&(n=r);return n},t.mean=function(t,e){var r,n=t.length,i=n,a=-1,o=0;if(null==e)for(;++a=0;)for(e=(n=t[i]).length;--e>=0;)r[--o]=n[e];return r},t.min=A,t.pairs=function(t,e){null==e&&(e=o);for(var r=0,n=t.length-1,i=t[0],a=new Array(n<0?0:n);r0)return[t];if((n=e0)for(t=Math.ceil(t/o),e=Math.floor(e/o),a=new Array(i=Math.ceil(e-t+1));++s0?1:t<0?-1:0},A=Math.sqrt,k=Math.tan;function M(t){return t>1?0:t<-1?l:Math.acos(t)}function S(t){return t>1?c:t<-1?-c:Math.asin(t)}function E(t){return(t=w(t/2))*t}function C(){}function I(t,e){t&&P.hasOwnProperty(t.type)&&P[t.type](t,e)}var L={Feature:function(t,e){I(t.geometry,e)},FeatureCollection:function(t,e){for(var r=t.features,n=-1,i=r.length;++n=0?1:-1,i=n*r,a=y(e=(e*=f)/2+u),o=w(e),s=N*o,l=j*a+s*y(i),c=s*n*w(i);U.add(g(c,l)),B=t,j=a,N=o}function Y(t){return[g(t[1],t[0]),S(t[2])]}function X(t){var e=t[0],r=t[1],n=y(r);return[n*y(e),n*w(e),w(r)]}function $(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function K(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 J(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function Q(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function tt(t){var e=A(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}var et,rt,nt,it,at,ot,st,lt,ct,ut,ht=r(),pt={point:ft,lineStart:mt,lineEnd:gt,polygonStart:function(){pt.point=yt,pt.lineStart=vt,pt.lineEnd=xt,ht.reset(),q.polygonStart()},polygonEnd:function(){q.polygonEnd(),pt.point=ft,pt.lineStart=mt,pt.lineEnd=gt,U<0?(et=-(nt=180),rt=-(it=90)):ht>o?it=90:ht<-o&&(rt=-90),ut[0]=et,ut[1]=nt},sphere:function(){et=-(nt=180),rt=-(it=90)}};function ft(t,e){ct.push(ut=[et=t,nt=t]),eit&&(it=e)}function dt(t,e){var r=X([t*f,e*f]);if(lt){var n=K(lt,r),i=K([n[1],-n[0],0],n);tt(i),i=Y(i);var a,o=t-at,s=o>0?1:-1,l=i[0]*p*s,c=d(o)>180;c^(s*atit&&(it=a):c^(s*at<(l=(l+360)%360-180)&&lit&&(it=e)),c?t_t(et,nt)&&(nt=t):_t(t,nt)>_t(et,nt)&&(et=t):nt>=et?(tnt&&(nt=t)):t>at?_t(et,t)>_t(et,nt)&&(nt=t):_t(t,nt)>_t(et,nt)&&(et=t)}else ct.push(ut=[et=t,nt=t]);eit&&(it=e),lt=r,at=t}function mt(){pt.point=dt}function gt(){ut[0]=et,ut[1]=nt,pt.point=ft,lt=null}function yt(t,e){if(lt){var r=t-at;ht.add(d(r)>180?r+(r>0?360:-360):r)}else ot=t,st=e;q.point(t,e),dt(t,e)}function vt(){q.lineStart()}function xt(){yt(ot,st),q.lineEnd(),d(ht)>o&&(et=-(nt=180)),ut[0]=et,ut[1]=nt,lt=null}function _t(t,e){return(e-=t)<0?e+360:e}function bt(t,e){return t[0]-e[0]}function wt(t,e){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:el?t+Math.round(-t/h)*h:t,e]}function Qt(t,e,r){return(t%=h)?e||r?Kt(ee(t),re(e,r)):ee(t):e||r?re(e,r):Jt}function te(t){return function(e,r){return[(e+=t)>l?e-h:e<-l?e+h:e,r]}}function ee(t){var e=te(t);return e.invert=te(-t),e}function re(t,e){var r=y(t),n=w(t),i=y(e),a=w(e);function o(t,e){var o=y(e),s=y(t)*o,l=w(t)*o,c=w(e),u=c*r+s*n;return[g(l*i-u*a,s*r-c*n),S(u*i+l*a)]}return o.invert=function(t,e){var o=y(e),s=y(t)*o,l=w(t)*o,c=w(e),u=c*i-l*a;return[g(l*i+c*a,s*r+u*n),S(u*r-s*n)]},o}function ne(t){function e(e){return(e=t(e[0]*f,e[1]*f))[0]*=p,e[1]*=p,e}return t=Qt(t[0]*f,t[1]*f,t.length>2?t[2]*f:0),e.invert=function(e){return(e=t.invert(e[0]*f,e[1]*f))[0]*=p,e[1]*=p,e},e}function ie(t,e,r,n,i,a){if(r){var o=y(e),s=w(e),l=n*r;null==i?(i=e+n*h,a=e-l/2):(i=ae(o,i),a=ae(o,a),(n>0?ia)&&(i+=n*h));for(var c,u=i;n>0?u>a:u1&&e.push(e.pop().concat(e.shift()))},result:function(){var r=e;return e=[],t=null,r}}}function se(t,e){return d(t[0]-e[0])=0;--a)i.point((h=u[a])[0],h[1]);else n(f.x,f.p.x,-1,i);f=f.p}u=(f=f.o).z,d=!d}while(!f.v);i.lineEnd()}}}function ue(t){if(e=t.length){for(var e,r,n=0,i=t[0];++n=0?1:-1,D=z*P,O=D>l,R=T*I;if(he.add(g(R*z*w(D),A*L+R*y(D))),s+=O?P+z*h:P,O^_>=r^E>=r){var F=K(X(x),X(M));tt(F);var B=K(a,F);tt(B);var j=(O^P>=0?-1:1)*S(B[2]);(n>j||n===j&&(F[0]||F[1]))&&(p+=O^P>=0?1:-1)}}return(s<-o||s0){for(p||(a.polygonStart(),p=!0),a.lineStart(),t=0;t1&&2&i&&c.push(c.pop().concat(c.shift())),s.push(c.filter(me))}}return f}}function me(t){return t.length>1}function ge(t,e){return((t=t.x)[0]<0?t[1]-c-o:c-t[1])-((e=e.x)[0]<0?e[1]-c-o:c-e[1])}var ye=de((function(){return!0}),(function(t){var e,r=NaN,n=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(a,s){var u=a>0?l:-l,h=d(a-r);d(h-l)0?c:-c),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(u,n),t.point(a,n),e=0):i!==u&&h>=l&&(d(r-i)o?m((w(e)*(a=y(n))*w(r)-w(n)*(i=y(e))*w(t))/(i*a*s)):(e+n)/2}(r,n,a,s),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(u,n),e=0),t.point(r=a,n=s),i=u},lineEnd:function(){t.lineEnd(),r=n=NaN},clean:function(){return 2-e}}}),(function(t,e,r,n){var i;if(null==t)i=r*c,n.point(-l,i),n.point(0,i),n.point(l,i),n.point(l,0),n.point(l,-i),n.point(0,-i),n.point(-l,-i),n.point(-l,0),n.point(-l,i);else if(d(t[0]-e[0])>o){var a=t[0]0,i=d(e)>o;function a(t,r){return y(t)*y(r)>e}function s(t,r,n){var i=[1,0,0],a=K(X(t),X(r)),s=$(a,a),c=a[0],u=s-c*c;if(!u)return!n&&t;var h=e*s/u,p=-e*c/u,f=K(i,a),m=Q(i,h);J(m,Q(a,p));var g=f,y=$(m,g),v=$(g,g),x=y*y-v*($(m,m)-1);if(!(x<0)){var _=A(x),b=Q(g,(-y-_)/v);if(J(b,m),b=Y(b),!n)return b;var w,T=t[0],k=r[0],M=t[1],S=r[1];k0^b[1]<(d(b[0]-T)l^(T<=b[0]&&b[0]<=k)){var I=Q(g,(-y+_)/v);return J(I,m),[b,Y(I)]}}}function c(e,r){var i=n?t:l-t,a=0;return e<-i?a|=1:e>i&&(a|=2),r<-i?a|=4:r>i&&(a|=8),a}return de(a,(function(t){var e,r,o,u,h;return{lineStart:function(){u=o=!1,h=1},point:function(p,f){var d,m=[p,f],g=a(p,f),y=n?g?0:c(p,f):g?c(p+(p<0?l:-l),f):0;if(!e&&(u=o=g)&&t.lineStart(),g!==o&&(!(d=s(e,m))||se(e,d)||se(m,d))&&(m[2]=1),g!==o)h=0,g?(t.lineStart(),d=s(m,e),t.point(d[0],d[1])):(d=s(e,m),t.point(d[0],d[1],2),t.lineEnd()),e=d;else if(i&&e&&n^g){var v;!(y&r)&&(v=s(m,e,!0))&&(h=0,n?(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)))}g&&(!e||!se(e,m))&&t.point(m[0],m[1]),e=m,o=g,r=y},lineEnd:function(){o&&t.lineEnd(),e=null},clean:function(){return h|(u&&o)<<1}}}),(function(e,n,i,a){ie(a,t,r,i,e,n)}),n?[0,-t]:[-l,t-l])}var xe=1e9,_e=-xe;function be(t,r,n,i){function a(e,a){return t<=e&&e<=n&&r<=a&&a<=i}function s(e,a,o,s){var c=0,h=0;if(null==e||(c=l(e,o))!==(h=l(a,o))||u(e,a)<0^o>0)do{s.point(0===c||3===c?t:n,c>1?i:r)}while((c=(c+o+4)%4)!==h);else s.point(a[0],a[1])}function l(e,i){return d(e[0]-t)0?0:3:d(e[0]-n)0?2:1:d(e[1]-r)0?1:0:i>0?3:2}function c(t,e){return u(t.x,e.x)}function u(t,e){var r=l(t,1),n=l(e,1);return r!==n?r-n:0===r?e[1]-t[1]:1===r?t[0]-e[0]:2===r?t[1]-e[1]:e[0]-t[0]}return function(o){var l,u,h,p,f,d,m,g,y,v,x,_=o,b=oe(),w={point:T,lineStart:function(){w.point=A,u&&u.push(h=[]),v=!0,y=!1,m=g=NaN},lineEnd:function(){l&&(A(p,f),d&&y&&b.rejoin(),l.push(b.result())),w.point=T,y&&_.lineEnd()},polygonStart:function(){_=b,l=[],u=[],x=!0},polygonEnd:function(){var r=function(){for(var e=0,r=0,n=u.length;ri&&(p-a)*(i-o)>(f-o)*(t-a)&&++e:f<=i&&(p-a)*(i-o)<(f-o)*(t-a)&&--e;return e}(),n=x&&r,a=(l=e.merge(l)).length;(n||a)&&(o.polygonStart(),n&&(o.lineStart(),s(null,null,1,o),o.lineEnd()),a&&ce(l,c,r,s,o),o.polygonEnd()),_=o,l=u=h=null}};function T(t,e){a(t,e)&&_.point(t,e)}function A(e,o){var s=a(e,o);if(u&&h.push([e,o]),v)p=e,f=o,d=s,v=!1,s&&(_.lineStart(),_.point(e,o));else if(s&&y)_.point(e,o);else{var l=[m=Math.max(_e,Math.min(xe,m)),g=Math.max(_e,Math.min(xe,g))],c=[e=Math.max(_e,Math.min(xe,e)),o=Math.max(_e,Math.min(xe,o))];!function(t,e,r,n,i,a){var o,s=t[0],l=t[1],c=0,u=1,h=e[0]-s,p=e[1]-l;if(o=r-s,h||!(o>0)){if(o/=h,h<0){if(o0){if(o>u)return;o>c&&(c=o)}if(o=i-s,h||!(o<0)){if(o/=h,h<0){if(o>u)return;o>c&&(c=o)}else if(h>0){if(o0)){if(o/=p,p<0){if(o0){if(o>u)return;o>c&&(c=o)}if(o=a-l,p||!(o<0)){if(o/=p,p<0){if(o>u)return;o>c&&(c=o)}else if(p>0){if(o0&&(t[0]=s+c*h,t[1]=l+c*p),u<1&&(e[0]=s+u*h,e[1]=l+u*p),!0}}}}}(l,c,t,r,n,i)?s&&(_.lineStart(),_.point(e,o),x=!1):(y||(_.lineStart(),_.point(l[0],l[1])),_.point(c[0],c[1]),s||_.lineEnd(),x=!1)}m=e,g=o,y=s}return w}}var we,Te,Ae,ke=r(),Me={sphere:C,point:C,lineStart:function(){Me.point=Ee,Me.lineEnd=Se},lineEnd:C,polygonStart:C,polygonEnd:C};function Se(){Me.point=Me.lineEnd=C}function Ee(t,e){we=t*=f,Te=w(e*=f),Ae=y(e),Me.point=Ce}function Ce(t,e){t*=f;var r=w(e*=f),n=y(e),i=d(t-we),a=y(i),o=n*w(i),s=Ae*r-Te*n*a,l=Te*r+Ae*n*a;ke.add(g(A(o*o+s*s),l)),we=t,Te=r,Ae=n}function Ie(t){return ke.reset(),O(t,Me),+ke}var Le=[null,null],Pe={type:"LineString",coordinates:Le};function ze(t,e){return Le[0]=t,Le[1]=e,Ie(Pe)}var De={Feature:function(t,e){return Re(t.geometry,e)},FeatureCollection:function(t,e){for(var r=t.features,n=-1,i=r.length;++n0&&(i=ze(t[a],t[a-1]))>0&&r<=i&&n<=i&&(r+n-i)*(1-Math.pow((r-n)/i,2))o})).map(u)).concat(e.range(v(s/g)*g,a,g).filter((function(t){return d(t%x)>o})).map(h))}return b.lines=function(){return w().map((function(t){return{type:"LineString",coordinates:t}}))},b.outline=function(){return{type:"Polygon",coordinates:[p(i).concat(f(l).slice(1),p(n).reverse().slice(1),f(c).reverse().slice(1))]}},b.extent=function(t){return arguments.length?b.extentMajor(t).extentMinor(t):b.extentMinor()},b.extentMajor=function(t){return arguments.length?(i=+t[0][0],n=+t[1][0],c=+t[0][1],l=+t[1][1],i>n&&(t=i,i=n,n=t),c>l&&(t=c,c=l,l=t),b.precision(_)):[[i,c],[n,l]]},b.extentMinor=function(e){return arguments.length?(r=+e[0][0],t=+e[1][0],s=+e[0][1],a=+e[1][1],r>t&&(e=r,r=t,t=e),s>a&&(e=s,s=a,a=e),b.precision(_)):[[r,s],[t,a]]},b.step=function(t){return arguments.length?b.stepMajor(t).stepMinor(t):b.stepMinor()},b.stepMajor=function(t){return arguments.length?(y=+t[0],x=+t[1],b):[y,x]},b.stepMinor=function(t){return arguments.length?(m=+t[0],g=+t[1],b):[m,g]},b.precision=function(e){return arguments.length?(_=+e,u=Ve(s,a,90),h=qe(r,t,_),p=Ve(c,l,90),f=qe(i,n,_),b):_},b.extentMajor([[-180,-90+o],[180,90-o]]).extentMinor([[-180,-80-o],[180,80+o]])}function Ge(t){return t}var We,Ze,Ye,Xe,$e=r(),Ke=r(),Je={point:C,lineStart:C,lineEnd:C,polygonStart:function(){Je.lineStart=Qe,Je.lineEnd=rr},polygonEnd:function(){Je.lineStart=Je.lineEnd=Je.point=C,$e.add(d(Ke)),Ke.reset()},result:function(){var t=$e/2;return $e.reset(),t}};function Qe(){Je.point=tr}function tr(t,e){Je.point=er,We=Ye=t,Ze=Xe=e}function er(t,e){Ke.add(Xe*t-Ye*e),Ye=t,Xe=e}function rr(){er(We,Ze)}var nr,ir,ar,or,sr=1/0,lr=sr,cr=-sr,ur=cr,hr={point:function(t,e){tcr&&(cr=t),eur&&(ur=e)},lineStart:C,lineEnd:C,polygonStart:C,polygonEnd:C,result:function(){var t=[[sr,lr],[cr,ur]];return cr=ur=-(lr=sr=1/0),t}},pr=0,fr=0,dr=0,mr=0,gr=0,yr=0,vr=0,xr=0,_r=0,br={point:wr,lineStart:Tr,lineEnd:Mr,polygonStart:function(){br.lineStart=Sr,br.lineEnd=Er},polygonEnd:function(){br.point=wr,br.lineStart=Tr,br.lineEnd=Mr},result:function(){var t=_r?[vr/_r,xr/_r]:yr?[mr/yr,gr/yr]:dr?[pr/dr,fr/dr]:[NaN,NaN];return pr=fr=dr=mr=gr=yr=vr=xr=_r=0,t}};function wr(t,e){pr+=t,fr+=e,++dr}function Tr(){br.point=Ar}function Ar(t,e){br.point=kr,wr(ar=t,or=e)}function kr(t,e){var r=t-ar,n=e-or,i=A(r*r+n*n);mr+=i*(ar+t)/2,gr+=i*(or+e)/2,yr+=i,wr(ar=t,or=e)}function Mr(){br.point=wr}function Sr(){br.point=Cr}function Er(){Ir(nr,ir)}function Cr(t,e){br.point=Ir,wr(nr=ar=t,ir=or=e)}function Ir(t,e){var r=t-ar,n=e-or,i=A(r*r+n*n);mr+=i*(ar+t)/2,gr+=i*(or+e)/2,yr+=i,vr+=(i=or*t-ar*e)*(ar+t),xr+=i*(or+e),_r+=3*i,wr(ar=t,or=e)}function Lr(t){this._context=t}Lr.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,h)}},result:C};var Pr,zr,Dr,Or,Rr,Fr=r(),Br={point:C,lineStart:function(){Br.point=jr},lineEnd:function(){Pr&&Nr(zr,Dr),Br.point=C},polygonStart:function(){Pr=!0},polygonEnd:function(){Pr=null},result:function(){var t=+Fr;return Fr.reset(),t}};function jr(t,e){Br.point=Nr,zr=Or=t,Dr=Rr=e}function Nr(t,e){Or-=t,Rr-=e,Fr.add(A(Or*Or+Rr*Rr)),Or=t,Rr=e}function Ur(){this._string=[]}function Vr(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function qr(t){return function(e){var r=new Hr;for(var n in t)r[n]=t[n];return r.stream=e,r}}function Hr(){}function Gr(t,e,r){var n=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=n&&t.clipExtent(null),O(r,t.stream(hr)),e(hr.result()),null!=n&&t.clipExtent(n),t}function Wr(t,e,r){return Gr(t,(function(r){var n=e[1][0]-e[0][0],i=e[1][1]-e[0][1],a=Math.min(n/(r[1][0]-r[0][0]),i/(r[1][1]-r[0][1])),o=+e[0][0]+(n-a*(r[1][0]+r[0][0]))/2,s=+e[0][1]+(i-a*(r[1][1]+r[0][1]))/2;t.scale(150*a).translate([o,s])}),r)}function Zr(t,e,r){return Wr(t,[[0,0],e],r)}function Yr(t,e,r){return Gr(t,(function(r){var n=+e,i=n/(r[1][0]-r[0][0]),a=(n-i*(r[1][0]+r[0][0]))/2,o=-i*r[0][1];t.scale(150*i).translate([a,o])}),r)}function Xr(t,e,r){return Gr(t,(function(r){var n=+e,i=n/(r[1][1]-r[0][1]),a=-i*r[0][0],o=(n-i*(r[1][1]+r[0][1]))/2;t.scale(150*i).translate([a,o])}),r)}Ur.prototype={_radius:4.5,_circle:Vr(4.5),pointRadius:function(t){return(t=+t)!==this._radius&&(this._radius=t,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._string.push("M",t,",",e),this._point=1;break;case 1:this._string.push("L",t,",",e);break;default:null==this._circle&&(this._circle=Vr(this._radius)),this._string.push("M",t,",",e,this._circle)}},result:function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}return null}},Hr.prototype={constructor:Hr,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 $r=y(30*f);function Kr(t,e){return+e?function(t,e){function r(n,i,a,s,l,c,u,h,p,f,m,y,v,x){var _=u-n,b=h-i,w=_*_+b*b;if(w>4*e&&v--){var T=s+f,k=l+m,M=c+y,E=A(T*T+k*k+M*M),C=S(M/=E),I=d(d(M)-1)e||d((_*D+b*O)/w-.5)>.3||s*f+l*m+c*y<$r)&&(r(n,i,a,s,l,c,P,z,I,T/=E,k/=E,M,v,x),x.point(P,z),r(P,z,I,T,k,M,u,h,p,f,m,y,v,x))}}return function(e){var n,i,a,o,s,l,c,u,h,p,f,d,m={point:g,lineStart:y,lineEnd:x,polygonStart:function(){e.polygonStart(),m.lineStart=_},polygonEnd:function(){e.polygonEnd(),m.lineStart=y}};function g(r,n){r=t(r,n),e.point(r[0],r[1])}function y(){u=NaN,m.point=v,e.lineStart()}function v(n,i){var a=X([n,i]),o=t(n,i);r(u,h,c,p,f,d,u=o[0],h=o[1],c=n,p=a[0],f=a[1],d=a[2],16,e),e.point(u,h)}function x(){m.point=g,e.lineEnd()}function _(){y(),m.point=b,m.lineEnd=w}function b(t,e){v(n=t,e),i=u,a=h,o=p,s=f,l=d,m.point=v}function w(){r(u,h,c,p,f,d,i,a,n,o,s,l,16,e),m.lineEnd=x,x()}return m}}(t,e):function(t){return qr({point:function(e,r){e=t(e,r),this.stream.point(e[0],e[1])}})}(t)}var Jr=qr({point:function(t,e){this.stream.point(t*f,e*f)}});function Qr(t,e,r,n,i){function a(a,o){return[e+t*(a*=n),r-t*(o*=i)]}return a.invert=function(a,o){return[(a-e)/t*n,(r-o)/t*i]},a}function tn(t,e,r,n,i,a){var o=y(a),s=w(a),l=o*t,c=s*t,u=o/t,h=s/t,p=(s*r-o*e)/t,f=(s*e+o*r)/t;function d(t,a){return[l*(t*=n)-c*(a*=i)+e,r-c*t-l*a]}return d.invert=function(t,e){return[n*(u*t-h*e+p),i*(f-h*t-u*e)]},d}function en(t){return rn((function(){return t}))()}function rn(t){var e,r,n,i,a,o,s,l,c,u,h=150,d=480,m=250,g=0,y=0,v=0,x=0,_=0,b=0,w=1,T=1,k=null,M=ye,S=null,E=Ge,C=.5;function I(t){return l(t[0]*f,t[1]*f)}function L(t){return(t=l.invert(t[0],t[1]))&&[t[0]*p,t[1]*p]}function P(){var t=tn(h,0,0,w,T,b).apply(null,e(g,y)),n=(b?tn:Qr)(h,d-t[0],m-t[1],w,T,b);return r=Qt(v,x,_),s=Kt(e,n),l=Kt(r,s),o=Kr(s,C),z()}function z(){return c=u=null,I}return I.stream=function(t){return c&&u===t?c:c=Jr(function(t){return qr({point:function(e,r){var n=t(e,r);return this.stream.point(n[0],n[1])}})}(r)(M(o(E(u=t)))))},I.preclip=function(t){return arguments.length?(M=t,k=void 0,z()):M},I.postclip=function(t){return arguments.length?(E=t,S=n=i=a=null,z()):E},I.clipAngle=function(t){return arguments.length?(M=+t?ve(k=t*f):(k=null,ye),z()):k*p},I.clipExtent=function(t){return arguments.length?(E=null==t?(S=n=i=a=null,Ge):be(S=+t[0][0],n=+t[0][1],i=+t[1][0],a=+t[1][1]),z()):null==S?null:[[S,n],[i,a]]},I.scale=function(t){return arguments.length?(h=+t,P()):h},I.translate=function(t){return arguments.length?(d=+t[0],m=+t[1],P()):[d,m]},I.center=function(t){return arguments.length?(g=t[0]%360*f,y=t[1]%360*f,P()):[g*p,y*p]},I.rotate=function(t){return arguments.length?(v=t[0]%360*f,x=t[1]%360*f,_=t.length>2?t[2]%360*f:0,P()):[v*p,x*p,_*p]},I.angle=function(t){return arguments.length?(b=t%360*f,P()):b*p},I.reflectX=function(t){return arguments.length?(w=t?-1:1,P()):w<0},I.reflectY=function(t){return arguments.length?(T=t?-1:1,P()):T<0},I.precision=function(t){return arguments.length?(o=Kr(s,C=t*t),z()):A(C)},I.fitExtent=function(t,e){return Wr(I,t,e)},I.fitSize=function(t,e){return Zr(I,t,e)},I.fitWidth=function(t,e){return Yr(I,t,e)},I.fitHeight=function(t,e){return Xr(I,t,e)},function(){return e=t.apply(this,arguments),I.invert=e.invert&&L,P()}}function nn(t){var e=0,r=l/3,n=rn(t),i=n(e,r);return i.parallels=function(t){return arguments.length?n(e=t[0]*f,r=t[1]*f):[e*p,r*p]},i}function an(t,e){var r=w(t),n=(r+w(e))/2;if(d(n)0?e<-c+o&&(e=-c+o):e>c-o&&(e=c-o);var r=i/b(dn(e),n);return[r*w(n*t),i-r*y(n*t)]}return a.invert=function(t,e){var r=i-e,a=T(n)*A(t*t+r*r),o=g(t,d(r))*T(r);return r*n<0&&(o-=l*T(t)*T(r)),[o/n,2*m(b(i/a,1/n))-c]},a}function gn(t,e){return[t,e]}function yn(t,e){var r=y(t),n=t===e?w(t):(r-y(e))/(e-t),i=r/n+t;if(d(n)o&&--i>0);return[t/(.8707+(a=n*n)*(a*(a*a*a*(.003971-.001529*a)-.013791)-.131979)),n]},Mn.invert=cn(S),Sn.invert=cn((function(t){return 2*m(t)})),En.invert=function(t,e){return[-e,2*m(x(t))-c]},t.geoAlbers=sn,t.geoAlbersUsa=function(){var t,e,r,n,i,a,s=sn(),l=on().rotate([154,0]).center([-2,58.5]).parallels([55,65]),c=on().rotate([157,0]).center([-3,19.9]).parallels([8,18]),u={point:function(t,e){a=[t,e]}};function h(t){var e=t[0],o=t[1];return a=null,r.point(e,o),a||(n.point(e,o),a)||(i.point(e,o),a)}function p(){return t=e=null,h}return h.invert=function(t){var e=s.scale(),r=s.translate(),n=(t[0]-r[0])/e,i=(t[1]-r[1])/e;return(i>=.12&&i<.234&&n>=-.425&&n<-.214?l:i>=.166&&i<.234&&n>=-.214&&n<-.115?c:s).invert(t)},h.stream=function(r){return t&&e===r?t:t=function(t){var e=t.length;return{point:function(r,n){for(var i=-1;++i_t(n[0],n[1])&&(n[1]=i[1]),_t(i[0],n[1])>_t(n[0],n[1])&&(n[0]=i[0])):a.push(n=i);for(o=-1/0,e=0,n=a[r=a.length-1];e<=r;n=i,++e)i=a[e],(s=_t(n[1],i[0]))>o&&(o=s,et=i[0],nt=n[1])}return ct=ut=null,et===1/0||rt===1/0?[[NaN,NaN],[NaN,NaN]]:[[et,rt],[nt,it]]},t.geoCentroid=function(t){Tt=At=kt=Mt=St=Et=Ct=It=Lt=Pt=zt=0,O(t,jt);var e=Lt,r=Pt,n=zt,i=e*e+r*r+n*n;return i2?t[2]+90:90]):[(t=r())[0],t[1],t[2]-90]},r([0,0,90]).scale(159.155)},t.geoTransverseMercatorRaw=En,Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof t&&typeof e<"u"?n(t,lg()):n((r=r||self).d3=r.d3||{},r.d3)}}),ug=f({"node_modules/d3-geo-projection/dist/d3-geo-projection.js"(t,e){var r,n;r=t,n=function(t,e,r){var n=Math.abs,i=Math.atan,a=Math.atan2,o=Math.cos,s=Math.exp,l=Math.floor,c=Math.log,u=Math.max,h=Math.min,p=Math.pow,f=Math.round,d=Math.sign||function(t){return t>0?1:t<0?-1:0},m=Math.sin,g=Math.tan,y=1e-6,v=1e-12,x=Math.PI,_=x/2,b=x/4,w=Math.SQRT1_2,T=I(2),A=I(x),k=2*x,M=180/x,S=x/180;function E(t){return t>1?_:t<-1?-_:Math.asin(t)}function C(t){return t>1?0:t<-1?x:Math.acos(t)}function I(t){return t>0?Math.sqrt(t):0}function L(t){return(s(t)-s(-t))/2}function P(t){return(s(t)+s(-t))/2}function z(t){var e=g(t/2),r=2*c(o(t/2))/(e*e);function i(t,e){var n=o(t),i=o(e),a=m(e),s=i*n,l=-((1-s?c((1+s)/2)/(1-s):-.5)+r/(1+s));return[l*i*m(t),l*a]}return i.invert=function(e,i){var s,l=I(e*e+i*i),u=-t/2,h=50;if(!l)return[0,0];do{var p=u/2,f=o(p),d=m(p),g=d/f,v=-c(n(f));u-=s=(2/g*v-r*g-l)/(-v/(d*d)+1-r/(2*f*f))*(f<0?.7:1)}while(n(s)>y&&--h>0);var x=m(u);return[a(e*x,l*o(u)),E(i*x/l)]},i}function D(t,e){var r=o(e),n=function(t){return t?t/Math.sin(t):1}(C(r*o(t/=2)));return[2*r*m(t)*n,m(e)*n]}function O(t){var e=m(t),r=o(t),i=t>=0?1:-1,s=g(i*t),l=(1+e-r)/2;function c(t,n){var c=o(n),u=o(t/=2);return[(1+c)*m(t),(i*n>-a(u,s)-.001?0:10*-i)+l+m(n)*r-(1+c)*e*u]}return c.invert=function(t,c){var u=0,h=0,p=50;do{var f=o(u),d=m(u),g=o(h),v=m(h),x=1+g,_=x*d-t,b=l+v*r-x*e*f-c,w=x*f/2,T=-d*v,A=e*x*d/2,k=r*g+e*f*v,M=T*A-k*w,S=(b*T-_*k)/M/2,E=(_*A-b*w)/M;n(E)>2&&(E/=2),u-=S,h-=E}while((n(S)>y||n(E)>y)&&--p>0);return i*h>-a(o(u),s)-.001?[2*u,h]:null},c}function R(t,e){var r=g(e/2),n=I(1-r*r),i=1+n*o(t/=2),a=m(t)*n/i,s=r/i,l=a*a,c=s*s;return[4/3*a*(3+l-3*c),4/3*s*(3+3*l-c)]}D.invert=function(t,e){if(!(t*t+4*e*e>x*x+y)){var r=t,i=e,a=25;do{var s,l=m(r),c=m(r/2),u=o(r/2),h=m(i),p=o(i),f=m(2*i),d=h*h,g=p*p,v=c*c,_=1-g*u*u,b=_?C(p*u)*I(s=1/_):s=0,w=2*b*p*c-t,T=b*h-e,A=s*(g*v+b*p*u*d),k=s*(.5*l*f-2*b*h*c),M=.25*s*(f*c-b*h*g*l),S=s*(d*u+b*v*p),E=k*M-S*A;if(!E)break;var L=(T*k-w*S)/E,P=(w*M-T*A)/E;r-=L,i-=P}while((n(L)>y||n(P)>y)&&--a>0);return[r,i]}},R.invert=function(t,e){if(e*=3/8,!(t*=3/8)&&n(e)>1)return null;var r=1+t*t+e*e,i=I((r-I(r*r-4*e*e))/2),s=E(i)/3,l=i?function(t){return c(t+I(t*t-1))}(n(e/i))/3:function(t){return c(t+I(t*t+1))}(n(t))/3,u=o(s),h=P(l),p=h*h-u*u;return[2*d(t)*a(L(l)*u,.25-p),2*d(e)*a(h*m(s),.25+p)]};var F=I(8),B=c(1+T);function j(t,e){var r=n(e);return r_){var l=a(s[1],s[0]),c=I(s[0]*s[0]+s[1]*s[1]),u=r*f((l-_)/r)+_,h=a(m(l-=u),2-o(l));l=u+E(x/c*m(h))-h,s[0]=c*o(l),s[1]=c*m(l)}return s}return s.invert=function(t,n){var s=I(t*t+n*n);if(s>_){var l=a(n,t),c=r*f((l-_)/r)+_,u=l>c?-1:1,h=s*o(c-l),p=1/g(u*C((h-x)/I(x*(x-2*h)+s*s)));l=c+2*i((p+u*I(p*p-3))/3),t=s*o(l),n=s*m(l)}return e.geoAzimuthalEquidistantRaw.invert(t,n)},s}function U(t,r){if(arguments.length<2&&(r=t),1===r)return e.geoAzimuthalEqualAreaRaw;if(r===1/0)return V;function n(n,i){var a=e.geoAzimuthalEqualAreaRaw(n/r,i);return a[0]*=t,a}return n.invert=function(n,i){var a=e.geoAzimuthalEqualAreaRaw.invert(n/t,i);return a[0]*=r,a},n}function V(t,e){return[t*o(e)/o(e/=2),2*m(e)]}function q(t,e,r){var i,a,o,s=100;r=void 0===r?0:+r,e=+e;do{(a=t(r))===(o=t(r+y))&&(o=a+y),r-=i=-1*y*(a-e)/(a-o)}while(s-- >0&&n(i)>y);return s<0?NaN:r}function H(t,e,r){return void 0===e&&(e=40),void 0===r&&(r=v),function(i,a,o,s){var l,c,u;o=void 0===o?0:+o,s=void 0===s?0:+s;for(var h=0;hl)o-=c/=2,s-=u/=2;else{l=m;var g=(o>0?-1:1)*r,y=(s>0?-1:1)*r,v=t(o+g,s),x=t(o,s+y),_=(v[0]-p[0])/g,b=(v[1]-p[1])/g,w=(x[0]-p[0])/y,T=(x[1]-p[1])/y,A=T*_-b*w,k=(n(A)<.5?.5:1)/A;if(o+=c=(d*w-f*T)*k,s+=u=(f*b-d*_)*k,n(c)0&&(i[1]*=1+a/1.5*i[0]*i[0]),i}return e.invert=H(e),e}function W(t,e){var r,i=t*m(e),a=30;do{e-=r=(e+m(e)-i)/(1+o(e))}while(n(r)>y&&--a>0);return e/2}function Z(t,e,r){function n(n,i){return[t*n*o(i=W(r,i)),e*m(i)]}return n.invert=function(n,i){return i=E(i/e),[n/(t*o(i)),E((2*i+m(2*i))/r)]},n}j.invert=function(t,e){if((a=n(e))v&&--u>0);return[t/(o(l)*(F-1/m(l))),d(e)*l]},V.invert=function(t,e){var r=2*E(e/2);return[t*o(r/2)/o(r),r]};var Y=Z(T/_,T,x),X=2.00276,$=1.11072;function K(t,e){var r=W(x,e);return[X*t/(1/o(e)+$/o(r)),(e+T*m(r))/X]}function J(t){var r=0,n=e.geoProjectionMutator(t),i=n(r);return i.parallel=function(t){return arguments.length?n(r=t*S):r*M},i}function Q(t,e){return[t*o(e),e]}function tt(t){if(!t)return Q;var e=1/g(t);function r(r,n){var i=e+t-n,a=i&&r*o(n)/i;return[i*m(a),e-i*o(a)]}return r.invert=function(r,n){var i=I(r*r+(n=e-n)*n),s=e+t-i;return[i/o(s)*a(r,n),s]},r}function et(t){function e(e,r){var n=_-r,i=n&&e*t*m(n)/n;return[n*m(i)/t,_-n*o(i)]}return e.invert=function(e,r){var n=e*t,i=_-r,o=I(n*n+i*i),s=a(n,i);return[(o?o/m(o):1)*s/t,_-o]},e}K.invert=function(t,e){var r,i,a=X*e,s=e<0?-b:b,l=25;do{i=a-T*m(s),s-=r=(m(2*s)+2*s-x*m(i))/(2*o(2*s)+2+x*o(i)*T*o(s))}while(n(r)>y&&--l>0);return i=a-T*m(s),[t*(1/o(i)+$/o(s))/X,i]},Q.invert=function(t,e){return[t/o(e),e]};var rt=Z(1,4/x,x);function nt(t,e,r,i,s,l){var c,u=o(l);if(n(t)>1||n(l)>1)c=C(r*s+e*i*u);else{var h=m(t/2),p=m(l/2);c=2*E(I(h*h+e*i*p*p))}return n(c)>y?[c,a(i*m(l),e*s-r*i*u)]:[0,0]}function it(t,e,r){return C((t*t+e*e-r*r)/(2*t*e))}function at(t){return t-2*x*l((t+x)/(2*x))}function ot(t,e,r){for(var n,i=[[t[0],t[1],m(t[1]),o(t[1])],[e[0],e[1],m(e[1]),o(e[1])],[r[0],r[1],m(r[1]),o(r[1])]],a=i[2],s=0;s<3;++s,a=n)n=i[s],a.v=nt(n[1]-a[1],a[3],a[2],n[3],n[2],n[0]-a[0]),a.point=[0,0];var l=it(i[0].v[0],i[2].v[0],i[1].v[0]),c=it(i[0].v[0],i[1].v[0],i[2].v[0]),u=x-l;i[2].point[1]=0,i[0].point[0]=-(i[1].point[0]=i[0].v[0]/2);var h=[i[2].point[0]=i[0].point[0]+i[2].v[0]*o(l),2*(i[0].point[1]=i[1].point[1]=i[2].v[0]*m(l))];return function(t,e){var r,n=m(e),a=o(e),s=new Array(3);for(r=0;r<3;++r){var l=i[r];if(s[r]=nt(e-l[1],l[3],l[2],a,n,t-l[0]),!s[r][0])return l.point;s[r][1]=at(s[r][1]-l.v[1])}var p=h.slice();for(r=0;r<3;++r){var f=2==r?0:r+1,d=it(i[r].v[0],s[r][0],s[f][0]);s[r][1]<0&&(d=-d),r?1==r?(d=c-d,p[0]-=s[r][0]*o(d),p[1]-=s[r][0]*m(d)):(d=u-d,p[0]+=s[r][0]*o(d),p[1]+=s[r][0]*m(d)):(p[0]+=s[r][0]*o(d),p[1]-=s[r][0]*m(d))}return p[0]/=3,p[1]/=3,p}}function st(t){return t[0]*=S,t[1]*=S,t}function lt(t,r,n){var i=e.geoCentroid({type:"MultiPoint",coordinates:[t,r,n]}),a=[-i[0],-i[1]],o=e.geoRotation(a),s=ot(st(o(t)),st(o(r)),st(o(n)));s.invert=H(s);var l=e.geoProjection(s).rotate(a),c=l.center;return delete l.rotate,l.center=function(t){return arguments.length?c(o(t)):o.invert(c())},l.clipAngle(90)}function ct(t,e){var r=I(1-m(e));return[2/A*t*r,A*(1-r)]}function ut(t){var e=g(t);function r(t,r){return[t,(t?t/m(t):1)*(m(r)*o(t)-e*o(r))]}return r.invert=e?function(t,r){t&&(r*=m(t)/t);var n=o(t);return[t,2*a(I(n*n+e*e-r*r)-n,e-r)]}:function(t,e){return[t,E(t?e*g(t)/t:e)]},r}ct.invert=function(t,e){var r=(r=e/A-1)*r;return[r>0?t*I(x/r)/2:0,E(1-r)]};var ht=I(3);function pt(t,e){return[ht*t*(2*o(2*e/3)-1)/A,ht*A*m(e/3)]}function ft(t){var e=o(t);function r(t,r){return[t*e,m(r)/e]}return r.invert=function(t,r){return[t/e,E(r*e)]},r}function dt(t){var e=o(t);function r(t,r){return[t*e,(1+e)*g(r/2)]}return r.invert=function(t,r){return[t/e,2*i(r/(1+e))]},r}function mt(t,e){var r=I(8/(3*x));return[r*t*(1-n(e)/x),r*e]}function gt(t,e){var r=I(4-3*m(n(e)));return[2/I(6*x)*t*r,d(e)*I(2*x/3)*(2-r)]}function yt(t,e){var r=I(x*(4+x));return[2/r*t*(1+I(1-4*e*e/(x*x))),4/r*e]}function vt(t,e){var r=(2+_)*m(e);e/=2;for(var i=0,a=1/0;i<10&&n(a)>y;i++){var s=o(e);e-=a=(e+m(e)*(s+2)-r)/(2*s*(1+s))}return[2/I(x*(4+x))*t*(1+o(e)),2*I(x/(4+x))*m(e)]}function xt(t,e){return[t*(1+o(e))/I(2+x),2*e/I(2+x)]}function _t(t,e){for(var r=(1+_)*m(e),i=0,a=1/0;i<10&&n(a)>y;i++)e-=a=(e+m(e)-r)/(1+o(e));return r=I(2+x),[t*(1+o(e))/r,2*e/r]}pt.invert=function(t,e){var r=3*E(e/(ht*A));return[A*t/(ht*(2*o(2*r/3)-1)),r]},mt.invert=function(t,e){var r=I(8/(3*x)),i=e/r;return[t/(r*(1-n(i)/x)),i]},gt.invert=function(t,e){var r=2-n(e)/I(2*x/3);return[t*I(6*x)/(2*r),d(e)*E((4-r*r)/3)]},yt.invert=function(t,e){var r=I(x*(4+x))/2;return[t*r/(1+I(1-e*e*(4+x)/(4*x))),e*r/2]},vt.invert=function(t,e){var r=e*I((4+x)/x)/2,n=E(r),i=o(n);return[t/(2/I(x*(4+x))*(1+i)),E((n+r*(i+2))/(2+_))]},xt.invert=function(t,e){var r=I(2+x),n=e*r/2;return[r*t/(1+o(n)),n]},_t.invert=function(t,e){var r=1+_,n=I(r/2);return[2*t*n/(1+o(e*=n)),E((e+m(e))/r)]};var bt=3+2*T;function wt(t,e){var r=m(t/=2),n=o(t),a=I(o(e)),s=o(e/=2),l=m(e)/(s+T*n*a),u=I(2/(1+l*l)),h=I((T*s+(n+r)*a)/(T*s+(n-r)*a));return[bt*(u*(h-1/h)-2*c(h)),bt*(u*l*(h+1/h)-2*i(l))]}wt.invert=function(t,e){if(!(r=R.invert(t/1.2,1.065*e)))return null;var r,a=r[0],s=r[1],l=20;t/=bt,e/=bt;do{var p=a/2,f=s/2,d=m(p),g=o(p),v=m(f),x=o(f),b=o(s),A=I(b),k=v/(x+T*g*A),M=k*k,S=I(2/(1+M)),E=(T*x+(g+d)*A)/(T*x+(g-d)*A),C=I(E),L=C-1/C,P=C+1/C,z=S*L-2*c(C)-t,D=S*k*P-2*i(k)-e,O=v&&w*A*d*M/v,F=(T*g*x+A)/(2*(x+T*g*A)*(x+T*g*A)*A),B=-.5*k*S*S*S,j=B*O,N=B*F,U=(U=2*x+T*A*(g-d))*U*C,V=(T*g*x*A+b)/U,q=-T*d*v/(A*U),H=L*j-2*V/C+S*(V+V/E),G=L*N-2*q/C+S*(q+q/E),W=k*P*j-2*O/(1+M)+S*P*O+S*k*(V-V/E),Z=k*P*N-2*F/(1+M)+S*P*F+S*k*(q-q/E),Y=G*W-Z*H;if(!Y)break;var X=(D*G-z*Z)/Y,$=(z*W-D*H)/Y;a-=X,s=u(-_,h(_,s-$))}while((n(X)>y||n($)>y)&&--l>0);return n(n(s)-_)s){var d=I(p),g=a(h,u),v=i*f(g/i),b=g-v,w=t*o(b),T=(t*m(b)-b*m(w))/(_-w),A=It(b,T),k=(x-t)/Lt(A,w,x);u=d;var M,S=50;do{u-=M=(t+Lt(A,w,u)*k-d)/(A(u)*k)}while(n(M)>y&&--S>0);h=b*m(u),u<_&&(h-=T*(u-_));var E=m(v),C=o(v);c[0]=u*C-h*E,c[1]=u*E+h*C}return c}return l.invert=function(r,l){var c=r*r+l*l;if(c>s){var u=I(c),h=a(l,r),p=i*f(h/i),d=h-p;r=u*o(d),l=u*m(d);for(var g=r-_,y=m(r),b=l/y,w=r<_?1/0:0,T=10;;){var A=t*m(b),k=t*o(b),M=m(k),S=_-k,E=(A-b*M)/S,C=It(b,E);if(n(w)y||n(f)>y)&&--v>0);return[d,g]},u}At.invert=function(t,e){var r=e/(1+Tt);return[t&&t/(Tt*I(1-r*r)),2*i(r)]},kt.invert=function(t,e){var r=i(e/A),n=o(r),a=2*r;return[t*A/2/(o(a)*n*n),a]};var zt=Pt(2.8284,-1.6988,.75432,-.18071,1.76003,-.38914,.042555),Dt=Pt(2.583819,-.835827,.170354,-.038094,1.543313,-.411435,.082742),Ot=Pt(5/6*x,-.62636,-.0344,0,1.3493,-.05524,0,.045);function Rt(t,e){var r=t*t,n=e*e;return[t*(1-.162388*n)*(.87-952426e-9*r*r),e*(1+n/12)]}Rt.invert=function(t,e){var r,i=t,a=e,o=50;do{var s=a*a;a-=r=(a*(1+s/12)-e)/(1+s/4)}while(n(r)>y&&--o>0);o=50,t/=1-.162388*s;do{var l=(l=i*i)*l;i-=r=(i*(.87-952426e-9*l)-t)/(.87-.00476213*l)}while(n(r)>y&&--o>0);return[i,a]};var Ft=Pt(2.6516,-.76534,.19123,-.047094,1.36289,-.13965,.031762);function Bt(t){var e=t(_,0)[0]-t(-_,0)[0];function r(r,n){var i=r>0?-.5:.5,a=t(r+i*x,n);return a[0]-=i*e,a}return t.invert&&(r.invert=function(r,n){var i=r>0?-.5:.5,a=t.invert(r+i*e,n),o=a[0]-i*x;return o<-x?o+=2*x:o>x&&(o-=2*x),a[0]=o,a}),r}function jt(t,e){var r=d(t),i=d(e),s=o(e),l=o(t)*s,c=m(t)*s,u=m(i*e);t=n(a(c,u)),e=E(l),n(t-_)>y&&(t%=_);var h=function(t,e){if(e===_)return[0,0];var r,i,a=m(e),s=a*a,l=s*s,c=1+l,u=1+3*l,h=1-l,p=E(1/I(c)),f=h+s*c*p,d=(1-a)/f,g=I(d),v=d*c,b=I(v),w=g*h;if(0===t)return[0,-(w+s*b)];var T,A=o(e),k=1/A,M=2*a*A,S=(-f*A-(1-a)*((-3*s+p*u)*M))/(f*f),C=-k*M,L=-k*(s*c*S+d*u*M),P=-2*k*(h*(.5*S/g)-2*s*g*M),z=4*t/x;if(t>.222*x||e.175*x){if(r=(w+s*I(v*(1+l)-w*w))/(1+l),t>x/4)return[r,r];var D=r,O=.5*r;r=.5*(O+D),i=50;do{var R=r*(P+C*I(v-r*r))+L*E(r/b)-z;if(!R)break;R<0?O=r:D=r,r=.5*(O+D)}while(n(D-O)>y&&--i>0)}else{r=y,i=25;do{var F=r*r,B=I(v-F),j=P+C*B,N=r*j+L*E(r/b)-z;r-=T=B?N/(j+(L-C*F)/B):0}while(n(T)>y&&--i>0)}return[r,-w-s*I(v-r*r)]}(t>x/4?_-t:t,e);return t>x/4&&(u=h[0],h[0]=-h[1],h[1]=-u),h[0]*=r,h[1]*=-i,h}function Nt(t,e){var r,a,l,c,u;if(e=1-y)return r=(1-e)/4,a=P(t),c=function(t){return((t=s(2*t))-1)/(t+1)}(t),l=1/a,[c+r*((u=a*L(t))-t)/(a*a),l-r*c*l*(u-t),l+r*c*l*(u+t),2*i(s(t))-_+r*(u-t)/a];var h=[1,0,0,0,0,0,0,0,0],p=[I(e),0,0,0,0,0,0,0,0],f=0;for(a=I(1-e),u=1;n(p[f]/h[f])>y&&f<8;)r=h[f++],p[f]=(r-a)/2,h[f]=(r+a)/2,a=I(r*a),u*=2;l=u*h[f]*t;do{l=(E(c=p[f]*m(a=l)/h[f])+l)/2}while(--f);return[m(l),c=o(l),c/o(l-a),l]}function Ut(t,e){if(!e)return t;if(1===e)return c(g(t/2+b));for(var r=1,a=I(1-e),o=I(e),s=0;n(o)>y;s++){if(t%x){var l=i(a*g(t)/r);l<0&&(l+=x),t+=l+~~(t/x)*x}else t+=t;o=(r+a)/2,a=I(r*a),o=((r=o)-a)/2}return t/(p(2,s)*r)}function Vt(t,e){var r=(T-1)/(T+1),l=I(1-r*r),u=Ut(_,l*l),h=c(g(x/4+n(e)/2)),p=s(-1*h)/I(r),f=function(t,e){var r=t*t,n=e+1,i=1-r-e*e;return[.5*((t>=0?_:-_)-a(i,2*t)),-.25*c(i*i+4*r)+.5*c(n*n+r)]}(p*o(-1*t),p*m(-1*t)),y=function(t,e,r){var a=n(t),o=L(n(e));if(a){var s=1/m(a),l=1/(g(a)*g(a)),c=-(l+r*(o*o*s*s)-1+r),u=(-c+I(c*c-(r-1)*l*4))/2;return[Ut(i(1/I(u)),r)*d(t),Ut(i(I((u/l-1)/r)),1-r)*d(e)]}return[0,Ut(i(o),1-r)*d(e)]}(f[0],f[1],l*l);return[-y[1],(e>=0?1:-1)*(.5*u-y[0])]}function qt(t){var e=m(t),r=o(t),i=Ht(t);function s(t,a){var s=i(t,a);t=s[0],a=s[1];var l=m(a),c=o(a),u=o(t),h=C(e*l+r*c*u),p=m(h),f=n(p)>y?h/p:1;return[f*r*m(t),(n(t)>_?f:-f)*(e*c-r*l*u)]}return i.invert=Ht(-t),s.invert=function(t,r){var n=I(t*t+r*r),s=-m(n),l=o(n),c=n*l,u=-r*s,h=n*e,p=I(c*c+u*u-h*h),f=a(c*h+u*p,u*h-c*p),d=(n>_?-1:1)*a(t*s,n*o(f)*l+r*m(f)*s);return i.invert(d,f)},s}function Ht(t){var e=m(t),r=o(t);return function(t,n){var i=o(n),s=o(t)*i,l=m(t)*i,c=m(n);return[a(l,s*r-c*e),E(c*r+s*e)]}}jt.invert=function(t,e){n(t)>1&&(t=2*d(t)-t),n(e)>1&&(e=2*d(e)-e);var r=d(t),i=d(e),s=-r*t,l=-i*e,c=l/s<1,u=function(t,e){for(var r=0,i=1,a=.5,s=50;;){var l=a*a,c=I(a),u=E(1/I(1+l)),h=1-l+a*(1+l)*u,p=(1-c)/h,f=I(p),d=p*(1+l),m=f*(1-l),g=I(d-t*t),y=e+m+a*g;if(n(i-r)0?r=a:i=a,a=.5*(r+i)}if(!s)return null;var _=E(c),b=o(_),w=1/b,T=2*c*b,A=(-h*b-(1-c)*((-3*a+u*(1+3*l))*T))/(h*h);return[x/4*(t*(-2*w*(.5*A/f*(1-l)-2*a*f*T)+-w*T*g)+-w*(a*(1+l)*A+p*(1+3*l)*T)*E(t/I(d))),_]}(c?l:s,c?s:l),h=u[0],p=u[1],f=o(p);return c&&(h=-_-h),[r*(a(m(h)*f,-m(p))+x),i*E(o(h)*f)]},Vt.invert=function(t,e){var r=(T-1)/(T+1),n=I(1-r*r),o=function(t,e,r){var n,i,a;return t?(n=Nt(t,r),e?(a=(i=Nt(e,1-r))[1]*i[1]+r*n[0]*n[0]*i[0]*i[0],[[n[0]*i[2]/a,n[1]*n[2]*i[0]*i[1]/a],[n[1]*i[1]/a,-n[0]*n[2]*i[0]*i[2]/a],[n[2]*i[1]*i[2]/a,-r*n[0]*n[1]*i[0]/a]]):[[n[0],0],[n[1],0],[n[2],0]]):[[0,(i=Nt(e,1-r))[0]/i[1]],[1/i[1],0],[i[2]/i[1],0]]}(.5*Ut(_,n*n)-e,-t,n*n),l=function(t,e){var r=e[0]*e[0]+e[1]*e[1];return[(t[0]*e[0]+t[1]*e[1])/r,(t[1]*e[0]-t[0]*e[1])/r]}(o[0],o[1]);return[a(l[1],l[0])/-1,2*i(s(-.5*c(r*l[0]*l[0]+r*l[1]*l[1])))-_]};var Gt=E(1-1/3)*M,Wt=ft(0);function Zt(t){var e=Gt*S,r=ct(x,e)[0]-ct(-x,e)[0],i=Wt(0,e)[1],a=ct(0,e)[1],o=A-a,s=k/t,c=4/k,p=i+o*o*4/k;function f(f,d){var m,g=n(d);if(g>e){var y=h(t-1,u(0,l((f+x)/s)));(m=ct(f+=x*(t-1)/t-y*s,g))[0]=m[0]*k/r-k*(t-1)/(2*t)+y*k/t,m[1]=i+4*(m[1]-a)*o/k,d<0&&(m[1]=-m[1])}else m=Wt(f,d);return m[0]*=c,m[1]/=p,m}return f.invert=function(e,f){e/=c;var d=n(f*=p);if(d>i){var m=h(t-1,u(0,l((e+x)/s)));e=(e+x*(t-1)/t-m*s)*r/k;var g=ct.invert(e,.25*(d-i)*k/o+a);return g[0]-=x*(t-1)/t-m*s,f<0&&(g[1]=-g[1]),g}return Wt.invert(e,f)},f}function Yt(t,e){return[t,1&e?90-y:Gt]}function Xt(t,e){return[t,1&e?-90+y:-Gt]}function $t(t){return[t[0]*(1-y),t[1]]}function Kt(t){var e,r=1+t,i=E(m(1/r)),s=2*I(x/(e=x+4*i*r)),l=.5*s*(r+I(t*(2+t))),c=t*t,u=r*r;function h(h,p){var f,d,g=1-m(p);if(g&&g<2){var y,b=_-p,w=25;do{var T=m(b),A=o(b),k=i+a(T,r-A),M=1+u-2*r*A;b-=y=(b-c*i-r*T+M*k-.5*g*e)/(2*r*T*k)}while(n(y)>v&&--w>0);f=s*I(M),d=h*k/x}else f=s*(t+g),d=h*i/x;return[f*m(d),l-f*o(d)]}return h.invert=function(t,n){var o=t*t+(n-=l)*n,h=(1+u-o/(s*s))/(2*r),p=C(h),f=m(p),d=i+a(f,r-h);return[E(t/I(o))*x/d,E(1-2*(p-c*i-r*f+(1+u-2*r*h)*d)/e)]},h}var Jt=.7109889596207567,Qt=.0528035274542;function te(t,e){return e>-Jt?((t=Y(t,e))[1]+=Qt,t):Q(t,e)}function ee(t,e){return n(e)>Jt?((t=Y(t,e))[1]-=e>0?Qt:-Qt,t):Q(t,e)}function re(t,e,r,n){var i=I(4*x/(2*r+(1+t-e/2)*m(2*r)+(t+e)/2*m(4*r)+e/2*m(6*r))),a=I(n*m(r)*I((1+t*o(2*r)+e*o(4*r))/(1+t+e))),s=r*c(1);function l(r){return I(1+t*o(2*r)+e*o(4*r))}function c(n){var i=n*r;return(2*i+(1+t-e/2)*m(2*i)+(t+e)/2*m(4*i)+e/2*m(6*i))/r}function u(t){return l(t)*m(t)}var h=function(t,e){var n=r*q(c,s*m(e)/r,e/x);isNaN(n)&&(n=r*d(e));var u=i*l(n);return[u*a*t/x*o(n),u/a*m(n)]};return h.invert=function(t,e){var n=q(u,e*a/i);return[t*x/(o(n)*i*a*l(n)),E(r*c(n/r)/s)]},0===r&&(i=I(n/x),(h=function(t,e){return[t*i,m(e)/i]}).invert=function(t,e){return[t/i,E(e*i)]}),h}function ne(t,e,r,n,i,a,o,s,l,c,u){if(u.nanEncountered)return NaN;var h,p,f,d,m,g,y,v,x,_;if(p=t(e+.25*(h=r-e)),f=t(r-.25*h),isNaN(p))u.nanEncountered=!0;else{if(!isNaN(f))return _=((g=(d=h*(n+4*p+i)/12)+(m=h*(i+4*f+a)/12))-o)/15,c>l?(u.maxDepthCount++,g+_):Math.abs(_)t?r=n:e=n,n=e+r>>1}while(n>e);var i=c[n+1]-c[n];return i&&(i=(t-c[n+1])/i),(n+1+i)/s}var f=2*h(1)/x*o/r,g=function(t,e){var r=h(n(m(e))),a=i(r)*t;return r/=f,[a,e>=0?r:-r]};return g.invert=function(t,e){var r;return n(e*=f)<1&&(r=d(e)*E(a(n(e))*o)),[t/i(n(e)),r]},g}function oe(t,e){return n(t[0]-e[0])a[o][2][0];++o);var l=t(e-a[o][1][0],r);return l[0]+=t(a[o][1][0],i*r>i*a[o][0][1]?a[o][0][1]:r)[0],l}i?s.invert=i(s):t.invert&&(s.invert=function(e,r){for(var i=o[+(r<0)],a=n[+(r<0)],l=0,c=i.length;l=0;--l)n=(e=t[1][l])[0][0],i=e[0][1],a=e[1][1],o=e[2][0],s=e[2][1],c.push(se([[o-y,s-y],[o-y,a+y],[n+y,a+y],[n+y,i-y]],30));return{type:"Polygon",coordinates:[r.merge(c)]}}(e),n=e.map((function(t){return t.map((function(t){return[[t[0][0]*S,t[0][1]*S],[t[1][0]*S,t[1][1]*S],[t[2][0]*S,t[2][1]*S]]}))})),o=n.map((function(e){return e.map((function(e){var r,n=t(e[0][0],e[0][1])[0],i=t(e[2][0],e[2][1])[0],a=t(e[1][0],e[0][1])[1],o=t(e[1][0],e[1][1])[1];return a>o&&(r=a,a=o,o=r),[[n,a],[i,o]]}))})),l):n.map((function(t){return t.map((function(t){return[[t[0][0]*M,t[0][1]*M],[t[1][0]*M,t[1][1]*M],[t[2][0]*M,t[2][1]*M]]}))}))},null!=n&&l.lobes(n),l}te.invert=function(t,e){return e>-Jt?Y.invert(t,e-Qt):Q.invert(t,e)},ee.invert=function(t,e){return n(e)>Jt?Y.invert(t,e+(e>0?Qt:-Qt)):Q.invert(t,e)};var ce=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]],ue=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]],he=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]],pe=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]],fe=[[[[-180,35],[-30,90],[0,35]],[[0,35],[30,90],[180,35]]],[[[-180,-10],[-102,-90],[-65,-10]],[[-65,-10],[5,-90],[77,-10]],[[77,-10],[103,-90],[180,-10]]]],de=[[[[-180,0],[-110,90],[-40,0]],[[-40,0],[0,90],[40,0]],[[40,0],[110,90],[180,0]]],[[[-180,0],[-110,-90],[-40,0]],[[-40,0],[0,-90],[40,0]],[[40,0],[110,-90],[180,0]]]];function me(t,e){return[3/k*t*I(x*x/3-e*e),e]}function ge(t){function e(e,r){if(n(n(r)-_)2)return null;var o=(e/=2)*e,s=(r/=2)*r,l=2*r/(1+o+s);return l=p((1+l)/(1-l),1/t),[a(2*e,1-o-s)/t,E((l-1)/(l+1))]},e}me.invert=function(t,e){return[k/3*t/I(x*x/3-e*e),e]};var ye=x/T;function ve(t,e){return[t*(1+I(o(e)))/2,e/(o(e/2)*o(t/6))]}function xe(t,e){var r=t*t,n=e*e;return[t*(.975534+n*(-.0143059*r-.119161+-.0547009*n)),e*(1.00384+r*(.0802894+-.02855*n+199025e-9*r)+n*(.0998909+-.0491032*n))]}function _e(t,e){return[m(t)/o(e),g(e)*o(t)]}function be(t){var e=o(t),r=g(b+t/2);function i(i,a){var o=a-t,s=n(o)=0;)p=(h=t[u])[0]+l*(i=p)-c*f,f=h[1]+l*f+c*i;return[p=l*(i=p)-c*f,f=l*f+c*i]}return r.invert=function(r,s){var l=20,c=r,u=s;do{for(var h,p=e,f=t[p],d=f[0],g=f[1],v=0,x=0;--p>=0;)v=d+c*(h=v)-u*x,x=g+c*x+u*h,d=(f=t[p])[0]+c*(h=d)-u*g,g=f[1]+c*g+u*h;var _,b,w=(v=d+c*(h=v)-u*x)*v+(x=g+c*x+u*h)*x;c-=_=((d=c*(h=d)-u*g-r)*v+(g=c*g+u*h-s)*x)/w,u-=b=(g*v-d*x)/w}while(n(_)+n(b)>y*y&&--l>0);if(l){var T=I(c*c+u*u),A=2*i(.5*T),k=m(A);return[a(c*k,T*o(A)),T?E(u*k/T):0]}},r}ve.invert=function(t,e){var r=n(t),i=n(e),a=y,s=_;iy||n(_)>y)&&--a>0);return a&&[r,i]},_e.invert=function(t,e){var r=t*t,n=e*e+1,i=r+n,a=t?w*I((i-I(i*i-4*r))/r):1/I(n);return[E(t*a),d(e)*C(a)]},we.invert=function(t,e){return[t,2.5*i(s(.8*e))-.625*x]};var Ae=[[.9972523,0],[.0052513,-.0041175],[.0074606,.0048125],[-.0153783,-.1968253],[.0636871,-.1408027],[.3660976,-.2937382]],ke=[[.98879,0],[0,0],[-.050909,0],[0,0],[.075528,0]],Me=[[.984299,0],[.0211642,.0037608],[-.1036018,-.0575102],[-.0329095,-.0320119],[.0499471,.1223335],[.026046,.0899805],[7388e-7,-.1435792],[.0075848,-.1334108],[-.0216473,.0776645],[-.0225161,.0853673]],Se=[[.9245,0],[0,0],[.01943,0]],Ee=[[.721316,0],[0,0],[-.00881625,-.00617325]];function Ce(t,r){var n=e.geoProjection(Te(t)).rotate(r).clipAngle(90),i=e.geoRotation(r),a=n.center;return delete n.rotate,n.center=function(t){return arguments.length?a(i(t)):i.invert(a())},n}var Ie=I(6),Le=I(7);function Pe(t,e){var r=E(7*m(e)/(3*Ie));return[Ie*t*(2*o(2*r/3)-1)/Le,9*m(r/3)/Le]}function ze(t,e){for(var r,i=(1+w)*m(e),a=e,s=0;s<25&&(a-=r=(m(a/2)+m(a)-i)/(.5*o(a/2)+o(a)),!(n(r)v&&--l>0);return[t/(.84719-.13063*(i=s*s)+(o=i*(a=i*i))*o*(.05494*i-.04515-.02326*a+.00331*o)),s]},Re.invert=function(t,e){for(var r=e/2,i=0,a=1/0;i<10&&n(a)>y;++i){var s=o(e/2);e-=a=(e-g(e/2)-r)/(1-.5/(s*s))}return[2*t/(1+o(e)),e]};var Fe=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]];function Be(t,e){var r=m(e),i=o(e),a=d(t);if(0===t||n(e)===_)return[0,e];if(0===e)return[t,0];if(n(t)===_)return[t*i,_*r];var s=x/(2*t)-2*t/x,l=2*e/x,c=(1-l*l)/(r-l),u=s*s,h=c*c,p=1+u/h,f=1+h/u,g=(s*r/c-s/2)/p,y=(h*r/u+c/2)/f,v=y*y-(h*r*r/u+c*r-1)/f;return[_*(g+I(g*g+i*i/p)*a),_*(y+I(v<0?0:v)*d(-e*s)*a)]}Be.invert=function(t,e){var r=(t/=_)*t,n=r+(e/=_)*e,i=x*x;return[t?(n-1+I((1-n)*(1-n)+4*r))/(2*t)*_:0,q((function(t){return n*(x*m(t)-2*t)*x+4*t*t*(e-m(t))+2*x*t-i*e}),0)]};var je=1.0148,Ne=.23185,Ue=-.14499,Ve=.02406,qe=je,He=5*Ne,Ge=7*Ue,We=1.790857183;function Ze(t,e){var r=e*e;return[t,e*(je+r*r*(Ne+r*(Ue+Ve*r)))]}function Ye(t,e){if(n(e)=0;)if(n=e[s],r[0]===n[0]&&r[1]===n[1]){if(a)return[a,r];a=r}}}(e.face,r.face),i=function(t,e){var r=$e(t[1],t[0]),n=$e(e[1],e[0]),i=function(t,e){return a(t[0]*e[1]-t[1]*e[0],t[0]*e[0]+t[1]*e[1])}(r,n),s=Ke(r)/Ke(n);return Xe([1,0,t[0][0],0,1,t[0][1]],Xe([s,0,0,0,s,0],Xe([o(i),m(i),0,-m(i),o(i),0],[1,0,-e[0][0],0,1,-e[0][1]])))}(n.map(r.project),n.map(e.project));e.transform=r.transform?Xe(r.transform,i):i;for(var s=r.edges,l=0,c=s.length;lWe?e=We:e<-We&&(e=-We);var r,i=e;do{var a=i*i;i-=r=(i*(je+a*a*(Ne+a*(Ue+Ve*a)))-e)/(qe+a*a*(He+a*(Ge+.21654*a)))}while(n(r)>y);return[t,i]},Ye.invert=function(t,e){if(n(e)y&&--s>0);return l=g(a),[(n(e)n^f>n&&r<(p-c)*(n-u)/(f-u)+c&&(i=!i)}return i}(t[0],r))return t.push(e),!0}))||t.push([e])})),mr=[],t.length?t.length>1?{type:"MultiPolygon",coordinates:t}:{type:"Polygon",coordinates:t[0]}:null}};function xr(t){var r=t(_,0)[0]-t(-_,0)[0];function i(e,i){var a=n(e)<_,o=t(a?e:e>0?e-x:e+x,i),s=(o[0]-o[1])*w,l=(o[0]+o[1])*w;if(a)return[s,l];var c=r*w,u=s>0^l>0?-1:1;return[u*s-d(l)*c,u*l-d(s)*c]}return t.invert&&(i.invert=function(e,i){var a=(e+i)*w,o=(i-e)*w,s=n(a)<.5*r&&n(o)<.5*r;if(!s){var l=r*w,c=a>0^o>0?-1:1,u=-c*e+(o>0?1:-1)*l,h=-c*i+(a>0?1:-1)*l;a=(-u-h)*w,o=(u-h)*w}var p=t.invert(a,o);return s||(p[0]+=a>0?x:-x),p}),e.geoProjection(i).rotate([-90,-90,45]).clipAngle(179.999)}function _r(){return xr(Vt).scale(111.48)}function br(t){var e=m(t);function r(r,n){var a=e?g(r*e/2)/e:r/2;if(!n)return[2*a,-t];var s=2*i(a*m(n)),l=1/g(n);return[m(s)*l,n+(1-o(s))*l-t]}return r.invert=function(r,a){if(n(a+=t)y&&--u>0);var d=r*(h=g(c)),v=g(n(a)0?_:-_)*(p+o*(d-c)/2+o*o*(d-2*p+c)/2)]}function Ar(t,e){var r=function(t){function e(e,r){var n=o(r),i=(t-1)/(t-n*o(e));return[i*n*m(e),i*m(r)]}return e.invert=function(e,r){var n=e*e+r*r,i=I(n),o=(t-I(1-n*(t+1)/(t-1)))/((t-1)/i+i/(t-1));return[a(e*o,i*I(1-o*o)),i?E(r*o/i):0]},e}(t);if(!e)return r;var n=o(e),i=m(e);function s(e,a){var o=r(e,a),s=o[1],l=s*i/(t-1)+n;return[o[0]*n/l,s/l]}return s.invert=function(e,a){var o=(t-1)/(t-1-a*i);return r.invert(o*e,o*a*n)},s}wr.forEach((function(t){t[1]*=1.0144})),Tr.invert=function(t,e){var r=e/_,i=90*r,a=h(18,n(i/5)),o=u(0,l(a));do{var s=wr[o][1],c=wr[o+1][1],p=wr[h(19,o+2)][1],f=p-s,d=p-2*c+s,m=2*(n(r)-c)/f,g=d/f,y=m*(1-g*m*(1-2*g*m));if(y>=0||1===o){i=(e>=0?5:-5)*(y+a);var x,b=50;do{y=(a=h(18,n(i)/5))-(o=l(a)),s=wr[o][1],c=wr[o+1][1],p=wr[h(19,o+2)][1],i-=(x=(e>=0?_:-_)*(c+y*(p-s)/2+y*y*(p-2*c+s)/2)-e)*M}while(n(x)>v&&--b>0);break}}while(--o>=0);var w=wr[o][0],T=wr[o+1][0],A=wr[h(19,o+2)][0];return[t/(T+y*(A-w)/2+y*y*(A-2*T+w)/2),i*S]};var kr=1e-4,Mr=-180,Sr=Mr+kr,Er=180-kr,Cr=-90+kr,Ir=90-kr;function Lr(t){return t.length>0}function Pr(t){return Math.floor(1e4*t)/1e4}function zr(t){return-90===t||90===t?[0,t]:[Mr,Pr(t)]}function Dr(t){var e=t[0],r=t[1],n=!1;return e<=Sr?(e=Mr,n=!0):e>=Er&&(e=180,n=!0),r<=Cr?(r=-90,n=!0):r>=Ir&&(r=90,n=!0),n?[e,r]:t}function Or(t){return t.map(Dr)}function Rr(t,e,r){for(var n=0,i=t.length;n=Er||u<=Cr||u>=Ir){a[o]=Dr(l);for(var h=o+1;hSr&&fCr&&d=s)break;r.push({index:-1,polygon:e,ring:a=a.slice(h-1)}),a[0]=zr(a[0][1]),o=-1,s=a.length}}}}function Fr(t){var e,r,n,i,a,o,s=t.length,l={},c={};for(e=0;e0?x-l:l)*M],u=e.geoProjection(t(s)).rotate(c),h=e.geoRotation(c),p=u.center;return delete u.rotate,u.center=function(t){return arguments.length?p(h(t)):h.invert(p())},u.clipAngle(90)}function Vr(t){var r=o(t);function n(t,n){var i=e.geoGnomonicRaw(t,n);return i[0]*=r,i}return n.invert=function(t,n){return e.geoGnomonicRaw.invert(t/r,n)},n}function qr(t,e){return Ur(Vr,t,e)}function Hr(t){if(!(t*=2))return e.geoAzimuthalEquidistantRaw;var r=-t/2,n=-r,i=t*t,s=g(n),l=.5/m(n);function c(e,a){var s=C(o(a)*o(e-r)),l=C(o(a)*o(e-n));return[((s*=s)-(l*=l))/(2*t),(a<0?-1:1)*I(4*i*l-(i-s+l)*(i-s+l))/(2*t)]}return c.invert=function(t,e){var i,c,u=e*e,h=o(I(u+(i=t+r)*i)),p=o(I(u+(i=t+n)*i));return[a(c=h-p,i=(h+p)*s),(e<0?-1:1)*C(I(i*i+c*c)*l)]},c}function Gr(t,e){return Ur(Hr,t,e)}function Wr(t,e){if(n(e)y&&--l>0);return[d(t)*(I(a*a+4)+a)*x/4,_*s]};var Jr=4*x+3*I(3),Qr=2*I(2*x*I(3)/Jr),tn=Z(Qr*I(3)/x,Qr,Jr/6);function en(t,e){return[t*I(1-3*e*e/(x*x)),e]}function rn(t,e){var r=o(e),n=o(t)*r,i=1-n,s=o(t=a(m(t)*r,-m(e))),l=m(t);return[l*(r=I(1-n*n))-s*i,-s*r-l*i]}function nn(t,e){var r=D(t,e);return[(r[0]+t/_)/2,(r[1]+e)/2]}en.invert=function(t,e){return[t/I(1-3*e*e/(x*x)),e]},rn.invert=function(t,e){var r=(t*t+e*e)/-2,n=I(-r*(2+r)),i=e*r+t*n,o=t*r-e*n,s=I(o*o+i*i);return[a(n*i,s*(1+r)),s?-E(n*o/s):0]},nn.invert=function(t,e){var r=t,i=e,a=25;do{var s,l=o(i),c=m(i),u=m(2*i),h=c*c,p=l*l,f=m(r),d=o(r/2),g=m(r/2),v=g*g,x=1-p*d*d,b=x?C(l*d)*I(s=1/x):s=0,w=.5*(2*b*l*g+r/_)-t,T=.5*(b*c+i)-e,A=.5*s*(p*v+b*l*d*h)+.5/_,k=s*(f*u/4-b*c*g),M=.125*s*(u*g-b*c*p*f),S=.5*s*(h*d+b*v*l)+.5,E=k*M-S*A,L=(T*k-w*S)/E,P=(w*M-T*A)/E;r-=L,i-=P}while((n(L)>y||n(P)>y)&&--a>0);return[r,i]},t.geoNaturalEarth=e.geoNaturalEarth1,t.geoNaturalEarthRaw=e.geoNaturalEarth1Raw,t.geoAiry=function(){var t=_,r=e.geoProjectionMutator(z),n=r(t);return n.radius=function(e){return arguments.length?r(t=e*S):t*M},n.scale(179.976).clipAngle(147)},t.geoAiryRaw=z,t.geoAitoff=function(){return e.geoProjection(D).scale(152.63)},t.geoAitoffRaw=D,t.geoArmadillo=function(){var t=20*S,r=t>=0?1:-1,n=g(r*t),i=e.geoProjectionMutator(O),s=i(t),l=s.stream;return s.parallel=function(e){return arguments.length?(n=g((r=(t=e*S)>=0?1:-1)*t),i(t)):t*M},s.stream=function(e){var i=s.rotate(),c=l(e),u=(s.rotate([0,0]),l(e)),h=s.precision();return s.rotate(i),c.sphere=function(){u.polygonStart(),u.lineStart();for(var e=-180*r;r*e<180;e+=90*r)u.point(e,90*r);if(t)for(;r*(e-=3*r*h)>=-180;)u.point(e,r*-a(o(e*S/2),n)*M);u.lineEnd(),u.polygonEnd()},c},s.scale(218.695).center([0,28.0974])},t.geoArmadilloRaw=O,t.geoAugust=function(){return e.geoProjection(R).scale(66.1603)},t.geoAugustRaw=R,t.geoBaker=function(){return e.geoProjection(j).scale(112.314)},t.geoBakerRaw=j,t.geoBerghaus=function(){var t=5,r=e.geoProjectionMutator(N),n=r(t),i=n.stream,s=.01,l=-o(s*S),c=m(s*S);return n.lobes=function(e){return arguments.length?r(t=+e):t},n.stream=function(e){var r=n.rotate(),u=i(e),h=(n.rotate([0,0]),i(e));return n.rotate(r),u.sphere=function(){h.polygonStart(),h.lineStart();for(var e=0,r=360/t,n=2*x/t,i=90-180/t,u=_;e=0;)t.point((e=r[i])[0],e[1]);t.lineEnd(),t.polygonEnd()},t},n.scale(79.4187).parallel(45).clipAngle(179.999)},t.geoHammerRetroazimuthalRaw=qt,t.geoHealpix=function(){var t=4,n=e.geoProjectionMutator(Zt),i=n(t),a=i.stream;return i.lobes=function(e){return arguments.length?n(t=+e):t},i.stream=function(n){var o=i.rotate(),s=a(n),l=(i.rotate([0,0]),a(n));return i.rotate(o),s.sphere=function(){e.geoStream(function(t){var e=[].concat(r.range(-180,180+t/2,t).map(Yt),r.range(180,-180-t/2,-t).map(Xt));return{type:"Polygon",coordinates:[180===t?e.map($t):e]}}(180/t),l)},s},i.scale(239.75)},t.geoHealpixRaw=Zt,t.geoHill=function(){var t=1,r=e.geoProjectionMutator(Kt),n=r(t);return n.ratio=function(e){return arguments.length?r(t=+e):t},n.scale(167.774).center([0,18.67])},t.geoHillRaw=Kt,t.geoHomolosine=function(){return e.geoProjection(ee).scale(152.63)},t.geoHomolosineRaw=ee,t.geoHufnagel=function(){var t=1,r=0,n=45*S,i=2,a=e.geoProjectionMutator(re),o=a(t,r,n,i);return o.a=function(e){return arguments.length?a(t=+e,r,n,i):t},o.b=function(e){return arguments.length?a(t,r=+e,n,i):r},o.psiMax=function(e){return arguments.length?a(t,r,n=+e*S,i):n*M},o.ratio=function(e){return arguments.length?a(t,r,n,i=+e):i},o.scale(180.739)},t.geoHufnagelRaw=re,t.geoHyperelliptical=function(){var t=0,r=2.5,n=1.183136,i=e.geoProjectionMutator(ae),a=i(t,r,n);return a.alpha=function(e){return arguments.length?i(t=+e,r,n):t},a.k=function(e){return arguments.length?i(t,r=+e,n):r},a.gamma=function(e){return arguments.length?i(t,r,n=+e):n},a.scale(152.63)},t.geoHyperellipticalRaw=ae,t.geoInterrupt=le,t.geoInterruptedBoggs=function(){return le(K,ce).scale(160.857)},t.geoInterruptedHomolosine=function(){return le(ee,ue).scale(152.63)},t.geoInterruptedMollweide=function(){return le(Y,he).scale(169.529)},t.geoInterruptedMollweideHemispheres=function(){return le(Y,pe).scale(169.529).rotate([20,0])},t.geoInterruptedSinuMollweide=function(){return le(te,fe,H).rotate([-20,-55]).scale(164.263).center([0,-5.4036])},t.geoInterruptedSinusoidal=function(){return le(Q,de).scale(152.63).rotate([-20,0])},t.geoKavrayskiy7=function(){return e.geoProjection(me).scale(158.837)},t.geoKavrayskiy7Raw=me,t.geoLagrange=function(){var t=.5,r=e.geoProjectionMutator(ge),n=r(t);return n.spacing=function(e){return arguments.length?r(t=+e):t},n.scale(124.75)},t.geoLagrangeRaw=ge,t.geoLarrivee=function(){return e.geoProjection(ve).scale(97.2672)},t.geoLarriveeRaw=ve,t.geoLaskowski=function(){return e.geoProjection(xe).scale(139.98)},t.geoLaskowskiRaw=xe,t.geoLittrow=function(){return e.geoProjection(_e).scale(144.049).clipAngle(89.999)},t.geoLittrowRaw=_e,t.geoLoximuthal=function(){return J(be).parallel(40).scale(158.837)},t.geoLoximuthalRaw=be,t.geoMiller=function(){return e.geoProjection(we).scale(108.318)},t.geoMillerRaw=we,t.geoModifiedStereographic=Ce,t.geoModifiedStereographicRaw=Te,t.geoModifiedStereographicAlaska=function(){return Ce(Ae,[152,-64]).scale(1400).center([-160.908,62.4864]).clipAngle(30).angle(7.8)},t.geoModifiedStereographicGs48=function(){return Ce(ke,[95,-38]).scale(1e3).clipAngle(55).center([-96.5563,38.8675])},t.geoModifiedStereographicGs50=function(){return Ce(Me,[120,-45]).scale(359.513).clipAngle(55).center([-117.474,53.0628])},t.geoModifiedStereographicMiller=function(){return Ce(Se,[-20,-18]).scale(209.091).center([20,16.7214]).clipAngle(82)},t.geoModifiedStereographicLee=function(){return Ce(Ee,[165,10]).scale(250).clipAngle(130).center([-165,-10])},t.geoMollweide=function(){return e.geoProjection(Y).scale(169.529)},t.geoMollweideRaw=Y,t.geoMtFlatPolarParabolic=function(){return e.geoProjection(Pe).scale(164.859)},t.geoMtFlatPolarParabolicRaw=Pe,t.geoMtFlatPolarQuartic=function(){return e.geoProjection(ze).scale(188.209)},t.geoMtFlatPolarQuarticRaw=ze,t.geoMtFlatPolarSinusoidal=function(){return e.geoProjection(De).scale(166.518)},t.geoMtFlatPolarSinusoidalRaw=De,t.geoNaturalEarth2=function(){return e.geoProjection(Oe).scale(175.295)},t.geoNaturalEarth2Raw=Oe,t.geoNellHammer=function(){return e.geoProjection(Re).scale(152.63)},t.geoNellHammerRaw=Re,t.geoInterruptedQuarticAuthalic=function(){return le(U(1/0),Fe).rotate([20,0]).scale(152.63)},t.geoNicolosi=function(){return e.geoProjection(Be).scale(127.267)},t.geoNicolosiRaw=Be,t.geoPatterson=function(){return e.geoProjection(Ze).scale(139.319)},t.geoPattersonRaw=Ze,t.geoPolyconic=function(){return e.geoProjection(Ye).scale(103.74)},t.geoPolyconicRaw=Ye,t.geoPolyhedral=Je,t.geoPolyhedralButterfly=function(t){t=t||function(t){var r=e.geoCentroid({type:"MultiPoint",coordinates:t});return e.geoGnomonic().scale(1).translate([0,0]).rotate([-r[0],-r[1]])};var r=nr.map((function(e){return{face:e,project:t(e)}}));return[-1,0,0,1,0,1,4,5].forEach((function(t,e){var n=r[t];n&&(n.children||(n.children=[])).push(r[e])})),Je(r[0],(function(t,e){return r[t<-x/2?e<0?6:4:t<0?e<0?2:0:t0?[-r[0],0]:[180-r[0],180])};var r=nr.map((function(e){return{face:e,project:t(e)}}));return[-1,0,0,1,0,1,4,5].forEach((function(t,e){var n=r[t];n&&(n.children||(n.children=[])).push(r[e])})),Je(r[0],(function(t,e){return r[t<-x/2?e<0?6:4:t<0?e<0?2:0:t2||a[0]!=e[0]||a[1]!=e[1])&&(n.push(a),e=a)}return 1===n.length&&t.length>1&&n.push(r(t[t.length-1])),n}function a(t){return t.map(i)}function o(t){if(null==t)return t;var e;switch(t.type){case"GeometryCollection":e={type:"GeometryCollection",geometries:t.geometries.map(o)};break;case"Point":e={type:"Point",coordinates:r(t.coordinates)};break;case"MultiPoint":e={type:t.type,coordinates:n(t.coordinates)};break;case"LineString":e={type:t.type,coordinates:i(t.coordinates)};break;case"MultiLineString":case"Polygon":e={type:t.type,coordinates:a(t.coordinates)};break;case"MultiPolygon":e={type:"MultiPolygon",coordinates:t.coordinates.map(a)};break;default:return t}return null!=t.bbox&&(e.bbox=t.bbox),e}function s(t){var e={type:"Feature",properties:t.properties,geometry:o(t.geometry)};return null!=t.id&&(e.id=t.id),null!=t.bbox&&(e.bbox=t.bbox),e}if(null!=t)switch(t.type){case"Feature":return s(t);case"FeatureCollection":var l={type:"FeatureCollection",features:t.features.map(s)};return null!=t.bbox&&(l.bbox=t.bbox),l;default:return o(t)}return t},t.geoQuincuncial=xr,t.geoRectangularPolyconic=function(){return J(br).scale(131.215)},t.geoRectangularPolyconicRaw=br,t.geoRobinson=function(){return e.geoProjection(Tr).scale(152.63)},t.geoRobinsonRaw=Tr,t.geoSatellite=function(){var t=2,r=0,n=e.geoProjectionMutator(Ar),i=n(t,r);return i.distance=function(e){return arguments.length?n(t=+e,r):t},i.tilt=function(e){return arguments.length?n(t,r=e*S):r*M},i.scale(432.147).clipAngle(C(1/t)*M-1e-6)},t.geoSatelliteRaw=Ar,t.geoSinuMollweide=function(){return e.geoProjection(te).rotate([-20,-55]).scale(164.263).center([0,-5.4036])},t.geoSinuMollweideRaw=te,t.geoSinusoidal=function(){return e.geoProjection(Q).scale(152.63)},t.geoSinusoidalRaw=Q,t.geoStitch=function(t){if(null==t)return t;switch(t.type){case"Feature":return Br(t);case"FeatureCollection":var e={type:"FeatureCollection",features:t.features.map(Br)};return null!=t.bbox&&(e.bbox=t.bbox),e;default:return jr(t)}},t.geoTimes=function(){return e.geoProjection(Nr).scale(146.153)},t.geoTimesRaw=Nr,t.geoTwoPointAzimuthal=qr,t.geoTwoPointAzimuthalRaw=Vr,t.geoTwoPointAzimuthalUsa=function(){return qr([-158,21.5],[-77,39]).clipAngle(60).scale(400)},t.geoTwoPointEquidistant=Gr,t.geoTwoPointEquidistantRaw=Hr,t.geoTwoPointEquidistantUsa=function(){return Gr([-158,21.5],[-77,39]).clipAngle(130).scale(122.571)},t.geoVanDerGrinten=function(){return e.geoProjection(Wr).scale(79.4183)},t.geoVanDerGrintenRaw=Wr,t.geoVanDerGrinten2=function(){return e.geoProjection(Zr).scale(79.4183)},t.geoVanDerGrinten2Raw=Zr,t.geoVanDerGrinten3=function(){return e.geoProjection(Yr).scale(79.4183)},t.geoVanDerGrinten3Raw=Yr,t.geoVanDerGrinten4=function(){return e.geoProjection(Xr).scale(127.16)},t.geoVanDerGrinten4Raw=Xr,t.geoWagner=Kr,t.geoWagner7=function(){return Kr().poleline(65).parallels(60).inflation(0).ratio(200).scale(172.633)},t.geoWagnerRaw=$r,t.geoWagner4=function(){return e.geoProjection(tn).scale(176.84)},t.geoWagner4Raw=tn,t.geoWagner6=function(){return e.geoProjection(en).scale(152.63)},t.geoWagner6Raw=en,t.geoWiechel=function(){return e.geoProjection(rn).rotate([0,-90,45]).scale(124.75).clipAngle(179.999)},t.geoWiechelRaw=rn,t.geoWinkel3=function(){return e.geoProjection(nn).scale(158.837)},t.geoWinkel3Raw=nn,Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof t&&typeof e<"u"?n(t,cg(),lg()):n(r.d3=r.d3||{},r.d3,r.d3)}}),hg=f({"src/plots/geo/zoom.js"(t,e){var r=x(),n=le(),i=qt(),a=Math.PI/180,o=180/Math.PI,s={cursor:"pointer"},l={cursor:"auto"};function c(t,e){return r.behavior.zoom().translate(e.translate()).scale(e.scale())}function u(t,e,r){var a=t.id,o=t.graphDiv,s=o.layout,l=s[a],c=o._fullLayout,u=c[a],h={},p={};function f(t,e){h[a+"."+t]=n.nestedProperty(l,t).get(),i.call("_storeDirectGUIEdit",s,c._preGUI,h);var r=n.nestedProperty(u,t);r.get()!==e&&(r.set(e),n.nestedProperty(l,t).set(e),p[a+"."+t]=e)}r(f),f("projection.scale",e.scale()/t.fitScale),f("fitbounds",!1),o.emit("plotly_relayout",p)}function h(t,e){var n=c(0,e);function i(r){var n=e.invert(t.midPt);r("center.lon",n[0]),r("center.lat",n[1])}return n.on("zoomstart",(function(){r.select(this).style(s)})).on("zoom",(function(){e.scale(r.event.scale).translate(r.event.translate),t.render(!0);var n=e.invert(t.midPt);t.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":e.scale()/t.fitScale,"geo.center.lon":n[0],"geo.center.lat":n[1]})})).on("zoomend",(function(){r.select(this).style(l),u(t,e,i)})),n}function p(t,e){var n,i,a,o,h,p,f,d,m,g=c(0,e);function y(t){return e.invert(t)}function v(r){var n=e.rotate(),i=e.invert(t.midPt);r("projection.rotation.lon",-n[0]),r("center.lon",i[0]),r("center.lat",i[1])}return g.on("zoomstart",(function(){r.select(this).style(s),n=r.mouse(this),i=e.rotate(),a=e.translate(),o=i,h=y(n)})).on("zoom",(function(){if(p=r.mouse(this),function(t){var r=y(t);if(!r)return!0;var n=e(r);return Math.abs(n[0]-t[0])>2||Math.abs(n[1]-t[1])>2}(n))return g.scale(e.scale()),void g.translate(e.translate());e.scale(r.event.scale),e.translate([a[0],r.event.translate[1]]),h?y(p)&&(d=y(p),f=[o[0]+(d[0]-h[0]),i[1],i[2]],e.rotate(f),o=f):h=y(n=p),m=!0,t.render(!0);var s=e.rotate(),l=e.invert(t.midPt);t.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":e.scale()/t.fitScale,"geo.center.lon":l[0],"geo.center.lat":l[1],"geo.projection.rotation.lon":-s[0]})})).on("zoomend",(function(){r.select(this).style(l),m&&u(t,e,v)})),g}function f(t,e){var n,i={r:e.rotate(),k:e.scale()},h=c(0,e),p=function(t){for(var e=0,n=arguments.length,i=[];++ed?(a=(h>0?90:-90)-f,i=0):(a=Math.asin(h/d)*o-f,i=Math.sqrt(d*d-h*h));var g=180-a-2*f,v=(Math.atan2(p,u)-Math.atan2(c,i))*o,x=(Math.atan2(p,u)-Math.atan2(c,-i))*o;return m(r[0],r[1],a,v)<=m(r[0],r[1],g,x)?[a,v,r[2]]:[g,x,r[2]]}(f,n,c);(!isFinite(g[0])||!isFinite(g[1])||!isFinite(g[2]))&&(g=c),e.rotate(g),c=g}}else n=d(e,t=a);!function(t){t({type:"zoom"})}(p.of(this,arguments))})),function(t){f++||t({type:"zoomstart"})}(p.of(this,arguments))})).on("zoomend",(function(){var n;r.select(this).style(l),g.call(h,"zoom",null),n=p.of(this,arguments),--f||n({type:"zoomend"}),u(t,e,x)})).on("zoom.redraw",(function(){t.render(!0);var r=e.rotate();t.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":e.scale()/t.fitScale,"geo.projection.rotation.lon":-r[0],"geo.projection.rotation.lat":-r[1]})})),r.rebind(h,p,"on")}function d(t,e){var r=t.invert(e);return r&&isFinite(r[0])&&isFinite(r[1])&&function(t){var e=t[0]*a,r=t[1]*a,n=Math.cos(r);return[n*Math.cos(e),n*Math.sin(e),Math.sin(r)]}(r)}function m(t,e,r,n){var i=g(r-t),a=g(n-e);return Math.sqrt(i*i+a*a)}function g(t){return(t%360+540)%360-180}function y(t,e,r){var n=r*a,i=t.slice(),o=0===e?1:0,s=2===e?1:2,l=Math.cos(n),c=Math.sin(n);return i[o]=t[o]*l-t[s]*c,i[s]=t[s]*l+t[o]*c,i}function v(t,e){for(var r=0,n=0,i=t.length;n0&&i<0&&(i+=360);var s=(i-n)/4;return{type:"Polygon",coordinates:[[[n,a],[n,o],[n+s,o],[n+2*s,o],[n+3*s,o],[i,o],[i,a],[i-s,a],[i-2*s,a],[i-3*s,a],[n,a]]]}}e.exports=function(t){return new M(t)},S.plot=function(t,e,r,n){var i=this;if(n)return i.update(t,e,!0);i._geoCalcData=t,i._fullLayout=e;var a=e[this.id],o=[],s=!1;for(var l in w.layerNameToAdjective)if("frame"!==l&&a["show"+l]){s=!0;break}for(var c=!1,u=0;u0&&o._module.calcGeoJSON(a,e)}if(!r){if(this.updateProjection(t,e))return;(!this.viewInitial||this.scope!==n.scope)&&this.saveViewInitial(n)}this.scope=n.scope,this.updateBaseLayers(e,n),this.updateDims(e,n),this.updateFx(e,n),f.generalUpdatePerTraceModule(this.graphDiv,this,t,n);var s=this.layers.frontplot.select(".scatterlayer");this.dataPoints.point=s.selectAll(".point"),this.dataPoints.text=s.selectAll("text"),this.dataPaths.line=s.selectAll(".js-line");var l=this.layers.backplot.select(".choroplethlayer");this.dataPaths.choropleth=l.selectAll("path"),this._render()},S.updateProjection=function(t,e){var r=this.graphDiv,s=e[this.id],c=e._size,u=s.domain,h=s.projection,p=s.lonaxis,f=s.lataxis,d=p._ax,g=f._ax,y=this.projection=function(t){var e=t.projection,r=e.type,s=w.projNames[r];s="geo"+l.titleCase(s);for(var c=(n[s]||o[s])(),u=t._isSatellite?180*Math.acos(1/e.distance)/Math.PI:t._isClipped?w.lonaxisSpan[r]/2:null,h=["center","rotate","parallels","clipExtent"],p=function(t){return t?c:[]},f=0;fu*Math.PI/180}return!1},c.getPath=function(){return i().projection(c)},c.getBounds=function(t){return c.getPath().bounds(t)},c.precision(w.precision),t._isSatellite&&c.tilt(e.tilt).distance(e.distance),u&&c.clipAngle(u-w.clipPad),c}(s),v=[[c.l+c.w*u.x[0],c.t+c.h*(1-u.y[1])],[c.l+c.w*u.x[1],c.t+c.h*(1-u.y[0])]],x=s.center||{},_=h.rotation||{},b=p.range||[],T=f.range||[];if(s.fitbounds){d._length=v[1][0]-v[0][0],g._length=v[1][1]-v[0][1],d.range=m(r,d),g.range=m(r,g);var A=(d.range[0]+d.range[1])/2,k=(g.range[0]+g.range[1])/2;if(s._isScoped)x={lon:A,lat:k};else if(s._isClipped){x={lon:A,lat:k},_={lon:A,lat:k,roll:_.roll};var M=h.type,S=w.lonaxisSpan[M]/2||180,C=w.lataxisSpan[M]/2||90;b=[A-S,A+S],T=[k-C,k+C]}else x={lon:A,lat:k},_={lon:A,lat:_.lat,roll:_.roll}}y.center([x.lon-_.lon,x.lat-_.lat]).rotate([-_.lon,-_.lat,_.roll]).parallels(h.parallels);var I=E(b,T);y.fitExtent(v,I);var L=this.bounds=y.getBounds(I),P=this.fitScale=y.scale(),z=y.translate();if(s.fitbounds){var D=y.getBounds(E(d.range,g.range)),O=Math.min((L[1][0]-L[0][0])/(D[1][0]-D[0][0]),(L[1][1]-L[0][1])/(D[1][1]-D[0][1]));isFinite(O)?y.scale(O*P):l.warn("Something went wrong during"+this.id+"fitbounds computations.")}else y.scale(h.scale*P);var R=this.midPt=[(L[0][0]+L[1][0])/2,(L[0][1]+L[1][1])/2];if(y.translate([z[0]+(R[0]-z[0]),z[1]+(R[1]-z[1])]).clipExtent(L),s._isAlbersUsa){var F=y([x.lon,x.lat]),B=y.translate();y.translate([B[0]-(F[0]-B[0]),B[1]-(F[1]-B[1])])}},S.updateBaseLayers=function(t,e){var n=this,i=n.topojson,a=n.layers,o=n.basePaths;function s(t){return"lonaxis"===t||"lataxis"===t}function l(t){return!!w.lineLayers[t]}function c(t){return!!w.fillLayers[t]}var p=(this.hasChoropleth?w.layersForChoropleth:w.layers).filter((function(t){return l(t)||c(t)?e["show"+t]:!s(t)||e[t].showgrid})),f=n.framework.selectAll(".layer").data(p,String);f.exit().each((function(t){delete a[t],delete o[t],r.select(this).remove()})),f.enter().append("g").attr("class",(function(t){return"layer "+t})).each((function(t){var e=a[t]=r.select(this);"bg"===t?n.bgRect=e.append("rect").style("pointer-events","all"):s(t)?o[t]=e.append("path").style("fill","none"):"backplot"===t?e.append("g").classed("choroplethlayer",!0):"frontplot"===t?e.append("g").classed("scatterlayer",!0):l(t)?o[t]=e.append("path").style("fill","none").style("stroke-miterlimit",2):c(t)&&(o[t]=e.append("path").style("stroke","none"))})),f.order(),f.each((function(r){var n=o[r],a=w.layerNameToAdjective[r];"frame"===r?n.datum(w.sphereSVG):l(r)||c(r)?n.datum(k(i,i.objects[r])):s(r)&&n.datum(function(t,e,r){var n,i,a,o=e[t],s=w.scopeDefaults[e.scope];"lonaxis"===t?(n=s.lonaxisRange,i=s.lataxisRange,a=function(t,e){return[t,e]}):"lataxis"===t&&(n=s.lataxisRange,i=s.lonaxisRange,a=function(t,e){return[e,t]});var l={type:"linear",range:[n[0],n[1]-1e-6],tick0:o.tick0,dtick:o.dtick};d.setConvert(l,r);var c=d.calcTicks(l);!e.isScoped&&"lonaxis"===t&&c.pop();for(var u=c.length,h=new Array(u),p=0;p-1&&_(r.event,i,[n.xaxis],[n.yaxis],n.id,u),c.indexOf("event")>-1&&p.click(i,r.event))}))}function h(t){return n.projection.invert([t[0]+n.xaxis._offset,t[1]+n.yaxis._offset])}},S.makeFramework=function(){var t=this,e=t.graphDiv,n=e._fullLayout,i="clip"+n._uid+t.id;t.clipDef=n._clips.append("clipPath").attr("id",i),t.clipRect=t.clipDef.append("rect"),t.framework=r.select(t.container).append("g").attr("class","geo "+t.id).call(h.setClipUrl,i,e),t.project=function(e){var r=t.projection(e);return r?[r[0]-t.xaxis._offset,r[1]-t.yaxis._offset]:[null,null]},t.xaxis={_id:"x",c2p:function(e){return t.project(e)[0]}},t.yaxis={_id:"y",c2p:function(e){return t.project(e)[1]}},t.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},d.setConvert(t.mockAxis,n)},S.saveViewInitial=function(t){var e,r=t.center||{},n=t.projection,i=n.rotation||{};this.viewInitial={fitbounds:t.fitbounds,"projection.scale":n.scale},e=t._isScoped?{"center.lon":r.lon,"center.lat":r.lat}:t._isClipped?{"projection.rotation.lon":i.lon,"projection.rotation.lat":i.lat}:{"center.lon":r.lon,"center.lat":r.lat,"projection.rotation.lon":i.lon},l.extendFlat(this.viewInitial,e)},S.render=function(t){this._hasMarkerAngles&&t?this.plot(this._geoCalcData,this._fullLayout,[],!0):this._render()},S._render=function(){var t,e=this.projection,r=e.getPath();function n(t){var r=e(t.lonlat);return r?c(r[0],r[1]):null}function i(t){return e.isLonLatOverEdges(t.lonlat)?"none":null}for(t in this.basePaths)this.basePaths[t].attr("d",r);for(t in this.dataPaths)this.dataPaths[t].attr("d",(function(t){return r(t.geojson)}));for(t in this.dataPoints)this.dataPoints[t].attr("display",i).attr("transform",n)}}}),fg=f({"src/plots/geo/layout_attributes.js"(t,e){var r=q(),n=Aa().attributes,i=zt().dash,a=Wm(),o=Pt().overrideAll,s=Zt(),l={range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},showgrid:{valType:"boolean",dflt:!1},tick0:{valType:"number",dflt:0},dtick:{valType:"number"},gridcolor:{valType:"color",dflt:r.lightLine},gridwidth:{valType:"number",min:0,dflt:1},griddash:i};(e.exports=o({domain:n({name:"geo"},{}),fitbounds:{valType:"enumerated",values:[!1,"locations","geojson"],dflt:!1,editType:"plot"},resolution:{valType:"enumerated",values:[110,50],dflt:110,coerceNumber:!0},scope:{valType:"enumerated",values:s(a.scopeDefaults),dflt:"world"},projection:{type:{valType:"enumerated",values:s(a.projNames)},rotation:{lon:{valType:"number"},lat:{valType:"number"},roll:{valType:"number"}},tilt:{valType:"number",dflt:0},distance:{valType:"number",min:1.001,dflt:2},parallels:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},scale:{valType:"number",min:0,dflt:1}},center:{lon:{valType:"number"},lat:{valType:"number"}},visible:{valType:"boolean",dflt:!0},showcoastlines:{valType:"boolean"},coastlinecolor:{valType:"color",dflt:r.defaultLine},coastlinewidth:{valType:"number",min:0,dflt:1},showland:{valType:"boolean",dflt:!1},landcolor:{valType:"color",dflt:a.landColor},showocean:{valType:"boolean",dflt:!1},oceancolor:{valType:"color",dflt:a.waterColor},showlakes:{valType:"boolean",dflt:!1},lakecolor:{valType:"color",dflt:a.waterColor},showrivers:{valType:"boolean",dflt:!1},rivercolor:{valType:"color",dflt:a.waterColor},riverwidth:{valType:"number",min:0,dflt:1},showcountries:{valType:"boolean"},countrycolor:{valType:"color",dflt:r.defaultLine},countrywidth:{valType:"number",min:0,dflt:1},showsubunits:{valType:"boolean"},subunitcolor:{valType:"color",dflt:r.defaultLine},subunitwidth:{valType:"number",min:0,dflt:1},showframe:{valType:"boolean"},framecolor:{valType:"color",dflt:r.defaultLine},framewidth:{valType:"number",min:0,dflt:1},bgcolor:{valType:"color",dflt:r.background},lonaxis:l,lataxis:l},"plot","from-root")).uirevision={valType:"any",editType:"none"}}}),dg=f({"src/plots/geo/layout_defaults.js"(t,e){var r=le(),n=Hs(),i=we().getSubplotData,a=Wm(),o=fg(),s=a.axesNames;function l(t,e,n,o){var l=i(o.fullData,"geo",o.id).map((function(t){return t.index})),c=n("resolution"),u=n("scope"),h=a.scopeDefaults[u],p=n("projection.type",h.projType),f=e._isAlbersUsa="albers usa"===p;f&&(u=e.scope="usa");var d=e._isScoped="world"!==u,m=e._isSatellite="satellite"===p,g=e._isConic=-1!==p.indexOf("conic")||"albers"===p,y=e._isClipped=!!a.lonaxisSpan[p];if(!1===t.visible){var v=r.extendDeep({},e._template);v.showcoastlines=!1,v.showcountries=!1,v.showframe=!1,v.showlakes=!1,v.showland=!1,v.showocean=!1,v.showrivers=!1,v.showsubunits=!1,v.lonaxis&&(v.lonaxis.showgrid=!1),v.lataxis&&(v.lataxis.showgrid=!1),e._template=v}for(var x=n("visible"),_=0;_0&&L<0&&(L+=360);var P,z,D,O=(I+L)/2;if(!f){var R=d?h.projRotate:[O,0,0];P=n("projection.rotation.lon",R[0]),n("projection.rotation.lat",R[1]),n("projection.rotation.roll",R[2]),n("showcoastlines",!d&&x)&&(n("coastlinecolor"),n("coastlinewidth")),n("showocean",!!x&&void 0)&&n("oceancolor")}f?(z=-96.6,D=38.7):(z=d?O:P,D=(C[0]+C[1])/2),n("center.lon",z),n("center.lat",D),m&&(n("projection.tilt"),n("projection.distance")),g&&n("projection.parallels",h.projParallels||[0,60]),n("projection.scale"),n("showland",!!x&&void 0)&&n("landcolor"),n("showlakes",!!x&&void 0)&&n("lakecolor"),n("showrivers",!!x&&void 0)&&(n("rivercolor"),n("riverwidth")),n("showcountries",d&&"usa"!==u&&x)&&(n("countrycolor"),n("countrywidth")),("usa"===u||"north america"===u&&50===c)&&(n("showsubunits",x),n("subunitcolor"),n("subunitwidth")),d||n("showframe",x)&&(n("framecolor"),n("framewidth")),n("bgcolor"),n("fitbounds")&&(delete e.projection.scale,d?(delete e.center.lon,delete e.center.lat):y?(delete e.center.lon,delete e.center.lat,delete e.projection.rotation.lon,delete e.projection.rotation.lat,delete e.lonaxis.range,delete e.lataxis.range):(delete e.center.lon,delete e.center.lat,delete e.projection.rotation.lon))}e.exports=function(t,e,r){n(t,e,r,{type:"geo",attributes:o,handleDefaults:l,fullData:r,partition:"y"})}}}),mg=f({"src/plots/geo/index.js"(t,e){var r=we().getSubplotCalcData,n=le().counterRegex,i=pg(),a="geo",o=n(a),s={};s[a]={valType:"subplotid",dflt:a,editType:"calc"},e.exports={attr:a,name:a,idRoot:a,idRegex:o,attrRegex:o,attributes:s,layoutAttributes:fg(),supplyLayoutDefaults:dg(),plot:function(t){for(var e=t._fullLayout,n=t.calcdata,o=e._subplots[a],s=0;s")}}(t,h,o),[t]}}}),Ag=f({"src/traces/choropleth/event_data.js"(t,e){e.exports=function(t,e,r,n,i){t.location=e.location,t.z=e.z;var a=n[i];return a.fIn&&a.fIn.properties&&(t.properties=a.fIn.properties),t.ct=a.ct,t}}}),kg=f({"src/traces/choropleth/select.js"(t,e){e.exports=function(t,e){var r,n,i,a,o,s=t.cd,l=t.xaxis,c=t.yaxis,u=[];if(!1===e)for(r=0;r=Math.min(P,z)&&f<=Math.max(P,z)?0:1/0}if(k=Math.min(D,O)&&d<=Math.max(D,O)?0:1/0}E=Math.sqrt(k*k+M*M),b=i[A]}}}else for(A=i.length-1;A>-1;A--)w=h[_=i[A]],T=p[_],k=c.c2p(w)-f,M=u.c2p(T)-d,(S=Math.sqrt(k*k+M*M))100},t.isDotSymbol=function(t){return"string"==typeof t?e.DOT_RE.test(t):t>200}}}),Pg=f({"src/traces/scattergl/defaults.js"(t,e){var r=le(),n=qt(),i=Lg(),a=Ig(),o=bn(),s=Ye(),l=Hn(),c=Gn(),u=Zn(),h=Yn(),p=Kn(),f=$n();e.exports=function(t,e,d,m){function g(n,i){return r.coerce(t,e,a,n,i)}var y=!!t.marker&&i.isOpenSymbol(t.marker.symbol),v=s.isBubble(t),x=l(t,e,m,g);if(x){c(t,e,m,g),g("xhoverformat"),g("yhoverformat");var _=x>>1,s=t[o];(void 0!==r?r(s,e):s-e)>=0?(a=o,i=o-1):n=o+1}return a}function n(t,e,r,n,i){for(var a=i+1;n<=i;){var o=n+i>>>1,s=t[o];(void 0!==r?r(s,e):s-e)>0?(a=o,i=o-1):n=o+1}return a}function i(t,e,r,n,i){for(var a=n-1;n<=i;){var o=n+i>>>1,s=t[o];(void 0!==r?r(s,e):s-e)<0?(a=o,n=o+1):i=o-1}return a}function a(t,e,r,n,i){for(var a=n-1;n<=i;){var o=n+i>>>1,s=t[o];(void 0!==r?r(s,e):s-e)<=0?(a=o,n=o+1):i=o-1}return a}function o(t,e,r,n,i){for(;n<=i;){var a=n+i>>>1,o=t[a],s=void 0!==r?r(o,e):o-e;if(0===s)return a;s<=0?n=a+1:i=a-1}return-1}function s(t,e,r,n,i,a){return"function"==typeof r?a(t,e,r,void 0===n?0:0|n,void 0===i?t.length-1:0|i):a(t,e,void 0,void 0===r?0:0|r,void 0===n?t.length-1:0|n)}e.exports={ge:function(t,e,n,i,a){return s(t,e,n,i,a,r)},gt:function(t,e,r,i,a){return s(t,e,r,i,a,n)},lt:function(t,e,r,n,a){return s(t,e,r,n,a,i)},le:function(t,e,r,n,i){return s(t,e,r,n,i,a)},eq:function(t,e,r,n,i){return s(t,e,r,n,i,o)}}}}),Og=f({"node_modules/pick-by-alias/index.js"(t,e){e.exports=function(t,e,r){var i,a,o={};if("string"==typeof e&&(e=n(e)),Array.isArray(e)){var s={};for(a=0;a1&&(t=arguments),"string"==typeof t?t=t.split(/\s/).map(parseFloat):"number"==typeof t&&(t=[t]),t.length&&"number"==typeof t[0]?e=1===t.length?{width:t[0],height:t[0],x:0,y:0}:2===t.length?{width:t[0],height:t[1],x:0,y:0}:{x:t[0],y:t[1],width:t[2]-t[0]||0,height:t[3]-t[1]||0}:t&&(e={x:(t=r(t,{left:"x l left Left",top:"y t top Top",width:"w width W Width",height:"h height W Width",bottom:"b bottom Bottom",right:"r right Right"})).left||0,y:t.top||0},null==t.width?t.right?e.width=t.right-e.x:e.width=0:e.width=t.width,null==t.height?t.bottom?e.height=t.bottom-e.y:e.height=0:e.height=t.height),e}}}),Fg=f({"node_modules/array-bounds/index.js"(t,e){e.exports=function(t,e){if(!t||null==t.length)throw Error("Argument should be an array");e=null==e?1:Math.floor(e);for(var r=Array(2*e),n=0;ni&&(i=t[o]),t[o]>>1;e.dtype||(e.dtype="array"),"string"==typeof e.dtype?d=new(u(e.dtype))(g):e.dtype&&(d=e.dtype,Array.isArray(d)&&(d.length=g));for(let t=0;tn||s>1073741824){for(let t=0;tr+i||b>n+i||T=k||o===s)return;let c=y[a];void 0===s&&(s=c.length);for(let e=o;e=l&&n<=d&&i>=u&&i<=m&&M.push(r)}let h=v[a],p=h[4*o+0],f=h[4*o+1],x=h[4*o+2],_=h[4*o+3],w=function(t,e){let r=null,n=0;for(;null===r;)if(r=t[4*e+n],n++,n>t.length)return null;return r}(h,o+1),S=.5*i,E=a+1;e(r,n,S,E,p,f||x||_||w),e(r,n+S,S,E,f,x||_||w),e(r+S,n,S,E,x,_||w),e(r+S,n+S,S,E,_,w)}(0,0,1,0,0,1),M},d;function w(t,e,r){let n=1,i=.5,a=.5,o=.5;for(let s=0;s1&&(i=1),i<-1&&(i=-1),(t*n-e*r<0?-1:1)*Math.acos(i)};t.default=function(t){var e=t.px,o=t.py,s=t.cx,l=t.cy,c=t.rx,u=t.ry,h=t.xAxisRotation,p=void 0===h?0:h,f=t.largeArcFlag,d=void 0===f?0:f,m=t.sweepFlag,g=void 0===m?0:m,y=[];if(0===c||0===u)return[];var v=Math.sin(p*r/360),x=Math.cos(p*r/360),_=x*(e-s)/2+v*(o-l)/2,b=-v*(e-s)/2+x*(o-l)/2;if(0===_&&0===b)return[];c=Math.abs(c),u=Math.abs(u);var w=Math.pow(_,2)/Math.pow(c,2)+Math.pow(b,2)/Math.pow(u,2);w>1&&(c*=Math.sqrt(w),u*=Math.sqrt(w));var T=function(t,e,n,i,o,s,l,c,u,h,p,f){var d=Math.pow(o,2),m=Math.pow(s,2),g=Math.pow(p,2),y=Math.pow(f,2),v=d*m-d*y-m*g;v<0&&(v=0),v/=d*y+m*g;var x=(v=Math.sqrt(v)*(l===c?-1:1))*o/s*f,_=v*-s/o*p,b=h*x-u*_+(t+n)/2,w=u*x+h*_+(e+i)/2,T=(p-x)/o,A=(f-_)/s,k=(-p-x)/o,M=(-f-_)/s,S=a(1,0,T,A),E=a(T,A,k,M);return 0===c&&E>0&&(E-=r),1===c&&E<0&&(E+=r),[b,w,S,E]}(e,o,s,l,c,u,d,g,v,x,_,b),A=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var r=[],n=!0,i=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(n=(o=s.next()).done)&&(r.push(o.value),!e||r.length!==e);n=!0);}catch(t){i=!0,a=t}finally{try{!n&&s.return&&s.return()}finally{if(i)throw a}}return r}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}(T,4),k=A[0],M=A[1],S=A[2],E=A[3],C=Math.abs(E)/(r/4);Math.abs(1-C)<1e-7&&(C=1);var I=Math.max(Math.ceil(C),1);E/=I;for(var L=0;L4?(o=g[g.length-4],s=g[g.length-3]):(o=p,s=f),a.push(g)}return a};var r=Gg();function n(t,e,r,n){return["C",t,e,r,n,r,n]}function i(t,e,r,n,i,a){return["C",t/3+2/3*r,e/3+2/3*n,i/3+2/3*r,a/3+2/3*n,i,a]}}}),Zg=f({"node_modules/is-svg-path/index.js"(t,e){e.exports=function(t){return"string"==typeof t&&(t=t.trim(),!!(/^[mzlhvcsqta]\s*[-+.0-9][^mlhvzcsqta]+/i.test(t)&&/[\dz]$/i.test(t)&&t.length>4))}}}),Yg=f({"node_modules/svg-path-bounds/index.js"(t,e){var r=Ke(),n=Hg(),i=Wg(),a=Zg(),o=nu();e.exports=function(t){if(Array.isArray(t)&&1===t.length&&"string"==typeof t[0]&&(t=t[0]),"string"==typeof t&&(o(a(t),"String is not an SVG path."),t=r(t)),o(Array.isArray(t),"Argument should be a string or an array of path segments."),t=n(t),!(t=i(t)).length)return[0,0,0,0];for(var e=[1/0,1/0,-1/0,-1/0],s=0,l=t.length;se[2]&&(e[2]=c[u+0]),c[u+1]>e[3]&&(e[3]=c[u+1]);return e}}}),Xg=f({"node_modules/normalize-svg-path/index.js"(t,e){var r=Math.PI,n=l(120);function i(t,e,r,n){return["C",t,e,r,n,r,n]}function a(t,e,r,n,i,a){return["C",t/3+2/3*r,e/3+2/3*n,i/3+2/3*r,a/3+2/3*n,i,a]}function o(t,e,i,a,l,c,u,h,p,f){if(f)T=f[0],A=f[1],b=f[2],w=f[3];else{var d=s(t,e,-l);t=d.x,e=d.y;var m=(t-(h=(d=s(h,p,-l)).x))/2,g=(e-(p=d.y))/2,y=m*m/(i*i)+g*g/(a*a);y>1&&(i*=y=Math.sqrt(y),a*=y);var v=i*i,x=a*a,_=(c==u?-1:1)*Math.sqrt(Math.abs((v*x-v*g*g-x*m*m)/(v*g*g+x*m*m)));_==1/0&&(_=1);var b=_*i*g/a+(t+h)/2,w=_*-a*m/i+(e+p)/2,T=Math.asin(((e-w)/a).toFixed(9)),A=Math.asin(((p-w)/a).toFixed(9));(T=tA&&(T-=2*r),!u&&A>T&&(A-=2*r)}if(Math.abs(A-T)>n){var k=A,M=h,S=p;A=T+n*(u&&A>T?1:-1);var E=o(h=b+i*Math.cos(A),p=w+a*Math.sin(A),i,a,l,0,u,M,S,[A,k,b,w])}var C=Math.tan((A-T)/4),I=4/3*i*C,L=4/3*a*C,P=[2*t-(t+I*Math.sin(T)),2*e-(e-L*Math.cos(T)),h+I*Math.sin(A),p-L*Math.cos(A),h,p];if(f)return P;E&&(P=P.concat(E));for(var z=0;z7&&(r.push(y.splice(0,7)),y.unshift("C"));break;case"S":var x=f,_=d;("C"==e||"S"==e)&&(x+=x-n,_+=_-s),y=["C",x,_,y[1],y[2],y[3],y[4]];break;case"T":"Q"==e||"T"==e?(h=2*f-h,p=2*d-p):(h=f,p=d),y=a(f,d,h,p,y[1],y[2]);break;case"Q":h=y[1],p=y[2],y=a(f,d,y[1],y[2],y[3],y[4]);break;case"L":y=i(f,d,y[1],y[2]);break;case"H":y=i(f,d,y[1],d);break;case"V":y=i(f,d,f,y[1]);break;case"Z":y=i(f,d,c,u)}e=v,f=y[y.length-2],d=y[y.length-1],y.length>4?(n=y[y.length-4],s=y[y.length-3]):(n=f,s=d),r.push(y)}return r}}}),$g=f({"node_modules/draw-svg-path/index.js"(t,e){var r=Hg(),n=Xg(),i={M:"moveTo",C:"bezierCurveTo"};e.exports=function(t,e){t.beginPath(),n(r(e)).forEach((function(e){var r=e[0],n=e.slice(1);t[i[r]].apply(t,n)})),t.closePath()}}}),Kg=f({"node_modules/bitmap-sdf/index.js"(t,e){var r=zd();e.exports=function(t,e){e||(e={});var a,o,s,l,c,u,h,p,f,d,m,g=null==e.cutoff?.25:e.cutoff,y=null==e.radius?8:e.radius,v=e.channel||0;if(ArrayBuffer.isView(t)||Array.isArray(t)){if(!e.width||!e.height)throw Error("For raw data width and height should be provided by options");a=e.width,o=e.height,l=t,u=e.stride?e.stride:Math.floor(t.length/a/o)}else window.HTMLCanvasElement&&t instanceof window.HTMLCanvasElement?(h=(p=t).getContext("2d"),a=p.width,o=p.height,l=(f=h.getImageData(0,0,a,o)).data,u=4):window.CanvasRenderingContext2D&&t instanceof window.CanvasRenderingContext2D?(h=t,a=(p=t.canvas).width,o=p.height,l=(f=h.getImageData(0,0,a,o)).data,u=4):window.ImageData&&t instanceof window.ImageData&&(f=t,a=t.width,o=t.height,l=f.data,u=4);if(s=Math.max(a,o),window.Uint8ClampedArray&&l instanceof window.Uint8ClampedArray||window.Uint8Array&&l instanceof window.Uint8Array)for(c=l,l=Array(a*o),d=0,m=c.length;d0?"white":"black",c.lineWidth=Math.abs(f)),c.translate(.5*u,.5*h),c.scale(g,g),function(){if(null!=r)return r;var t=document.createElement("canvas").getContext("2d");if(t.canvas.width=t.canvas.height=1,!window.Path2D)return r=!1;var e=new Path2D("M0,0h1v1h-1v-1Z");t.fillStyle="black",t.fill(e);var n=t.getImageData(0,0,1,1);return r=n&&n.data&&255===n.data[3]}()){var y=new Path2D(t);c.fill(y),f&&c.stroke(y)}else{var v=i(t);a(c,v),c.fill(),f&&c.stroke()}return c.setTransform(1,0,0,1,0,0),s(c,{cutoff:null!=e.cutoff?e.cutoff:.5,radius:null!=e.radius?e.radius:.5*p})}}}),Qg=f({"src/traces/scattergl/convert.js"(t,e){var r=A(),n=Jg(),i=Od(),a=qt(),o=le(),s=o.isArrayOrTypedArray,l=Qe(),c=xe(),u=Fd().formatColor,h=Ye(),p=Xe(),f=Lg(),d=Cg(),m=G().DESELECTDIM,g={start:1,left:1,end:-1,right:-1,middle:0,center:0,bottom:1,top:-1},y=$e().appendArrayPointValue;function v(t,e){var n,i=t._fullLayout,a=e._length,l=e.textfont,c=e.textposition,u=s(c)?c:[c],h=l.color,p=l.size,f=l.family,d=l.weight,m=l.style,g=l.variant,v={},_=t._context.plotGlPixelRatio,b=e.texttemplate;if(b){v.text=[];var w=i._d3locale,T=Array.isArray(b),A=T?Math.min(b.length,a):a,k=T?function(t){return b[t]}:function(){return b};for(n=0;n500?"bold":"normal":t}function _(t,e){var r,n,a=e._length,o=e.marker,l={},c=s(o.symbol),h=s(o.angle),d=s(o.color),m=s(o.line.color),g=s(o.opacity),y=s(o.size),v=s(o.line.width);if(c||(n=f.isOpenSymbol(o.symbol)),c||d||m||g||h){l.symbols=new Array(a),l.angles=new Array(a),l.colors=new Array(a),l.borderColors=new Array(a);var x=o.symbol,_=o.angle,b=u(o,o.opacity,a),w=u(o.line,o.opacity,a);if(!s(w[0])){var T=w;for(w=Array(a),r=0;rd.TOO_MANY_POINTS||h.hasMarkers(e)?"rect":"round";if(c&&e.connectgaps){var p=n[0],f=n[1];for(i=0;i1?c[i]:c[0]:c,m=s(u)?u.length>1?u[i]:u[0]:u,y=g[d],v=g[m],x=p?p/.8+1:0,_=-v*x-.5*v;o.offset[i]=[y*x/f,_/f]}}return o}}}}),ty=f({"src/traces/scattergl/scene_update.js"(t,e){var r=le();e.exports=function(t,e){var n=e._scene,i={count:0,dirty:!0,lineOptions:[],fillOptions:[],markerOptions:[],markerSelectedOptions:[],markerUnselectedOptions:[],errorXOptions:[],errorYOptions:[],textOptions:[],textSelectedOptions:[],textUnselectedOptions:[],selectBatch:[],unselectBatch:[]},a={fill2d:!1,scatter2d:!1,error2d:!1,line2d:!1,glText:!1,select2d:!1};return e._scene||((n=e._scene={}).init=function(){r.extendFlat(n,a,i)},n.init(),n.update=function(t){var e=r.repeat(t,n.count);if(n.fill2d&&n.fill2d.update(e),n.scatter2d&&n.scatter2d.update(e),n.line2d&&n.line2d.update(e),n.error2d&&n.error2d.update(e.concat(e)),n.select2d&&n.select2d.update(e),n.glText)for(var i=0;i=m,w=2*_,T={},A=y.makeCalcdata(e,"x"),k=v.makeCalcdata(e,"y"),M=o(e,y,"x",A),S=o(e,v,"y",k),E=M.vals,C=S.vals;e._x=E,e._y=C,e.xperiodalignment&&(e._origX=A,e._xStarts=M.starts,e._xEnds=M.ends),e.yperiodalignment&&(e._origY=k,e._yStarts=S.starts,e._yEnds=S.ends);var I=new Array(w),L=new Array(_);for(a=0;a<_;a++)I[2*a]=E[a]===d?NaN:E[a],I[2*a+1]=C[a]===d?NaN:C[a],L[a]=a;if("log"===y.type)for(a=0;a1&&n.extendFlat(s.line,p.linePositions(t,r,i)),s.errorX||s.errorY){var l=p.errorBarPositions(t,r,i,a,o);s.errorX&&n.extendFlat(s.errorX,l.x),s.errorY&&n.extendFlat(s.errorY,l.y)}return s.text&&(n.extendFlat(s.text,{positions:i},p.textPosition(t,r,s.text,s.marker)),n.extendFlat(s.textSel,{positions:i},p.textPosition(t,r,s.text,s.markerSel)),n.extendFlat(s.textUnsel,{positions:i},p.textPosition(t,r,s.text,s.markerUnsel))),s}(t,0,e,I,E,C),D=f(t,x);return u(s,e),b?z.marker&&(P=z.marker.sizeAvg||Math.max(z.marker.size,3)):P=l(e,_),c(t,e,y,v,E,C,P),z.errorX&&g(e,y,z.errorX),z.errorY&&g(e,v,z.errorY),z.fill&&!D.fill2d&&(D.fill2d=!0),z.marker&&!D.scatter2d&&(D.scatter2d=!0),z.line&&!D.line2d&&(D.line2d=!0),(z.errorX||z.errorY)&&!D.error2d&&(D.error2d=!0),z.text&&!D.glText&&(D.glText=!0),z.marker&&(z.marker.snap=_),D.lineOptions.push(z.line),D.errorXOptions.push(z.errorX),D.errorYOptions.push(z.errorY),D.fillOptions.push(z.fill),D.markerOptions.push(z.marker),D.markerSelectedOptions.push(z.markerSel),D.markerUnselectedOptions.push(z.markerUnsel),D.textOptions.push(z.text),D.textSelectedOptions.push(z.textSel),D.textUnselectedOptions.push(z.textUnsel),D.selectBatch.push([]),D.unselectBatch.push([]),T._scene=D,T.index=D.count,T.x=E,T.y=C,T.positions=I,D.count++,[{x:!1,y:!1,t:T,trace:e}]}}}),ry=f({"src/traces/scattergl/edit_style.js"(t,e){var r=le(),n=H(),i=G().DESELECTDIM;e.exports={styleTextSelection:function(t){var e,a,o=t[0],s=o.trace,l=o.t,c=l._scene,u=l.index,h=c.selectBatch[u],p=c.unselectBatch[u],f=c.textOptions[u],d=c.textSelectedOptions[u]||{},m=c.textUnselectedOptions[u]||{},g=r.extendFlat({},f);if(h.length||p.length){var y=d.color,v=m.color,x=f.color,_=r.isArrayOrTypedArray(x);for(g.color=new Array(s._length),e=0;e>>24,n=(16711680&t)>>>16,i=(65280&t)>>>8,a=255&t;return!1===e?[r,n,i,a]:[r/255,n/255,i/255,a/255]}}}),oy=f({"node_modules/object-assign/index.js"(t,e){var r=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(t){n[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch{return!1}}()?Object.assign:function(t,e){for(var a,o,s=function(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}(t),l=1;lt.length)&&(e=t.length);for(var r=0,n=new Array(e);r 1.0 + delta) {\n\t\tdiscard;\n\t}\n\n\talpha -= smoothstep(1.0 - delta, 1.0 + delta, radius);\n\n\tfloat borderRadius = fragBorderRadius;\n\tfloat ratio = smoothstep(borderRadius - delta, borderRadius + delta, radius);\n\tvec4 color = mix(fragColor, fragBorderColor, ratio);\n\tcolor.a *= alpha * opacity;\n\tgl_FragColor = color;\n}\n"]),c.vert=h(["precision highp float;\n#define GLSLIFY 1\n\nattribute float x, y, xFract, yFract;\nattribute float size, borderSize;\nattribute vec4 colorId, borderColorId;\nattribute float isActive;\n\n// `invariant` effectively turns off optimizations for the position.\n// We need this because -fast-math on M1 Macs is re-ordering\n// floating point operations in a way that causes floating point\n// precision limits to put points in the wrong locations.\ninvariant gl_Position;\n\nuniform bool constPointSize;\nuniform float pixelRatio;\nuniform vec2 paletteSize, scale, scaleFract, translate, translateFract;\nuniform sampler2D paletteTexture;\n\nconst float maxSize = 100.;\n\nvarying vec4 fragColor, fragBorderColor;\nvarying float fragBorderRadius, fragWidth;\n\nfloat pointSizeScale = (constPointSize) ? 2. : pixelRatio;\n\nbool isDirect = (paletteSize.x < 1.);\n\nvec4 getColor(vec4 id) {\n return isDirect ? id / 255. : texture2D(paletteTexture,\n vec2(\n (id.x + .5) / paletteSize.x,\n (id.y + .5) / paletteSize.y\n )\n );\n}\n\nvoid main() {\n // ignore inactive points\n if (isActive == 0.) return;\n\n vec2 position = vec2(x, y);\n vec2 positionFract = vec2(xFract, yFract);\n\n vec4 color = getColor(colorId);\n vec4 borderColor = getColor(borderColorId);\n\n float size = size * maxSize / 255.;\n float borderSize = borderSize * maxSize / 255.;\n\n gl_PointSize = (size + borderSize) * pointSizeScale;\n\n vec2 pos = (position + translate) * scale\n + (positionFract + translateFract) * scale\n + (position + translate) * scaleFract\n + (positionFract + translateFract) * scaleFract;\n\n gl_Position = vec4(pos * 2. - 1., 0., 1.);\n\n fragBorderRadius = 1. - 2. * borderSize / (size + borderSize);\n fragColor = color;\n fragBorderColor = borderColor.a == 0. || borderSize == 0. ? vec4(color.rgb, 0.) : borderColor;\n fragWidth = 1. / gl_PointSize;\n}\n"]),m&&(c.frag=c.frag.replace("smoothstep","smoothStep"),l.frag=l.frag.replace("smoothstep","smoothStep")),this.drawCircle=t(c)}x.defaults={color:"black",borderColor:"transparent",borderSize:0,size:12,opacity:1,marker:void 0,viewport:null,range:null,pixelSize:null,count:0,offset:0,bounds:null,positions:[],snap:1e4},x.prototype.render=function(){return arguments.length&&this.update.apply(this,arguments),this.draw(),this},x.prototype.draw=function(){for(var t=this,e=arguments.length,r=new Array(e),n=0;nn)?e.tree=c(t,{bounds:h}):n&&n.length&&(e.tree=n),e.tree){var p={primitive:"points",usage:"static",data:e.tree,type:"uint32"};e.elements?e.elements(p):e.elements=o.elements(p)}var f=g.float32(t);return i({data:f,usage:"dynamic"}),a({data:g.fract32(t,f),usage:"dynamic"}),l({data:new Uint8Array(u),type:"uint8",usage:"stream"}),t}},{marker:function(e,r,n){var i=r.activation;if(i.forEach((function(t){return t&&t.destroy&&t.destroy()})),i.length=0,e&&"number"!=typeof e[0]){for(var a=[],s=0,l=Math.min(e.length,r.count);s=0)return a;if(t instanceof Uint8Array||t instanceof Uint8ClampedArray)e=t;else{e=new Uint8Array(t.length);for(var o=0,s=t.length;o4*n&&(this.tooManyColors=!0),this.updatePalette(r),1===i.length?i[0]:i},x.prototype.updatePalette=function(t){if(!this.tooManyColors){var e=this.maxColors,r=this.paletteTexture,n=Math.ceil(.25*t.length/e);if(n>1)for(var i=.25*(t=t.slice()).length%e;i80*r){i=s=t[0],o=l=t[1];for(var x=r;xs&&(s=c),p>l&&(l=p);f=0!==(f=Math.max(s-i,l-o))?32767/f:0}return a(y,v,r,i,o,f,0),v}function n(t,e,r,n,i){var a,o;if(i===S(t,e,r,n)>0)for(a=e;a=e;a-=n)o=A(a,t[a],t[a+1],o);return o&&v(o,o.next)&&(k(o),o=o.next),o}function i(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!v(n,n.next)&&0!==y(n.prev,n,n.next))n=n.next;else{if(k(n),(n=e=n.prev)===n.next)break;r=!0}}while(r||n!==e);return e}function a(t,e,r,n,u,h,p){if(t){!p&&h&&function(t,e,r,n){var i=t;do{0===i.z&&(i.z=f(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,r,n,i,a,o,s,l,c=1;do{for(r=t,t=null,a=null,o=0;r;){for(o++,n=r,s=0,e=0;e0||l>0&&n;)0!==s&&(0===l||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,l--),a?a.nextZ=i:t=i,i.prevZ=a,a=i;r=n}a.nextZ=null,c*=2}while(o>1)}(i)}(t,n,u,h);for(var d,m,g=t;t.prev!==t.next;)if(d=t.prev,m=t.next,h?s(t,n,u,h):o(t))e.push(d.i/r|0),e.push(t.i/r|0),e.push(m.i/r|0),k(t),t=m.next,g=m.next;else if((t=m)===g){p?1===p?a(t=l(i(t),e,r),e,r,n,u,h,2):2===p&&c(t,e,r,n,u,h):a(i(t),e,r,n,u,h,1);break}}}function o(t){var e=t.prev,r=t,n=t.next;if(y(e,r,n)>=0)return!1;for(var i=e.x,a=r.x,o=n.x,s=e.y,l=r.y,c=n.y,u=ia?i>o?i:o:a>o?a:o,f=s>l?s>c?s:c:l>c?l:c,d=n.next;d!==e;){if(d.x>=u&&d.x<=p&&d.y>=h&&d.y<=f&&m(i,s,a,l,o,c,d.x,d.y)&&y(d.prev,d,d.next)>=0)return!1;d=d.next}return!0}function s(t,e,r,n){var i=t.prev,a=t,o=t.next;if(y(i,a,o)>=0)return!1;for(var s=i.x,l=a.x,c=o.x,u=i.y,h=a.y,p=o.y,d=sl?s>c?s:c:l>c?l:c,x=u>h?u>p?u:p:h>p?h:p,_=f(d,g,e,r,n),b=f(v,x,e,r,n),w=t.prevZ,T=t.nextZ;w&&w.z>=_&&T&&T.z<=b;){if(w.x>=d&&w.x<=v&&w.y>=g&&w.y<=x&&w!==i&&w!==o&&m(s,u,l,h,c,p,w.x,w.y)&&y(w.prev,w,w.next)>=0||(w=w.prevZ,T.x>=d&&T.x<=v&&T.y>=g&&T.y<=x&&T!==i&&T!==o&&m(s,u,l,h,c,p,T.x,T.y)&&y(T.prev,T,T.next)>=0))return!1;T=T.nextZ}for(;w&&w.z>=_;){if(w.x>=d&&w.x<=v&&w.y>=g&&w.y<=x&&w!==i&&w!==o&&m(s,u,l,h,c,p,w.x,w.y)&&y(w.prev,w,w.next)>=0)return!1;w=w.prevZ}for(;T&&T.z<=b;){if(T.x>=d&&T.x<=v&&T.y>=g&&T.y<=x&&T!==i&&T!==o&&m(s,u,l,h,c,p,T.x,T.y)&&y(T.prev,T,T.next)>=0)return!1;T=T.nextZ}return!0}function l(t,e,r){var n=t;do{var a=n.prev,o=n.next.next;!v(a,o)&&x(a,n,n.next,o)&&w(a,o)&&w(o,a)&&(e.push(a.i/r|0),e.push(n.i/r|0),e.push(o.i/r|0),k(n),k(n.next),n=t=o),n=n.next}while(n!==t);return i(n)}function c(t,e,r,n,o,s){var l=t;do{for(var c=l.next.next;c!==l.prev;){if(l.i!==c.i&&g(l,c)){var u=T(l,c);return l=i(l,l.next),u=i(u,u.next),a(l,e,r,n,o,s,0),void a(u,e,r,n,o,s,0)}c=c.next}l=l.next}while(l!==t)}function u(t,e){return t.x-e.x}function h(t,e){var r=function(t,e){var r,n=e,i=t.x,a=t.y,o=-1/0;do{if(a<=n.y&&a>=n.next.y&&n.next.y!==n.y){var s=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>o&&(o=s,r=n.x=n.x&&n.x>=u&&i!==n.x&&m(ar.x||n.x===r.x&&p(r,n)))&&(r=n,f=l)),n=n.next}while(n!==c);return r}(t,e);if(!r)return e;var n=T(r,t);return i(n,n.next),i(r,r.next)}function p(t,e){return y(t.prev,t,e.prev)<0&&y(e.next,t,t.next)<0}function f(t,e,r,n,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-r)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function d(t){var e=t,r=t;do{(e.x=(t-o)*(a-s)&&(t-o)*(n-s)>=(r-o)*(e-s)&&(r-o)*(a-s)>=(i-o)*(n-s)}function g(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&x(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(w(t,e)&&w(e,t)&&function(t,e){var r=t,n=!1,i=(t.x+e.x)/2,a=(t.y+e.y)/2;do{r.y>a!=r.next.y>a&&r.next.y!==r.y&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}(t,e)&&(y(t.prev,t,e.prev)||y(t,e.prev,e))||v(t,e)&&y(t.prev,t,t.next)>0&&y(e.prev,e,e.next)>0)}function y(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function v(t,e){return t.x===e.x&&t.y===e.y}function x(t,e,r,n){var i=b(y(t,e,r)),a=b(y(t,e,n)),o=b(y(r,n,t)),s=b(y(r,n,e));return!!(i!==a&&o!==s||0===i&&_(t,r,e)||0===a&&_(t,n,e)||0===o&&_(r,t,n)||0===s&&_(r,e,n))}function _(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function b(t){return t>0?1:t<0?-1:0}function w(t,e){return y(t.prev,t,t.next)<0?y(t,e,t.next)>=0&&y(t,t.prev,e)>=0:y(t,e,t.prev)<0||y(t,t.next,e)<0}function T(t,e){var r=new M(t.i,t.x,t.y),n=new M(e.i,e.x,e.y),i=t.next,a=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function A(t,e,r,n){var i=new M(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function k(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function M(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function S(t,e,r,n){for(var i=0,a=e,o=r-n;a0&&(n+=t[i-1].length,r.holes.push(n))}return r}}}),fy=f({"node_modules/array-normalize/index.js"(t,e){var r=Fg();e.exports=function(t,e,n){if(!t||null==t.length)throw Error("Argument should be an array");null==e&&(e=1),null==n&&(n=r(t,e));for(var i=0;i-1}}}),jy=f({"node_modules/es5-ext/string/#/contains/index.js"(t,e){e.exports=Fy()()?String.prototype.contains:By()}}),Ny=f({"node_modules/d/index.js"(t,e){var r=ky(),n=Cy(),i=Oy(),a=Ry(),o=jy(),s=e.exports=function(t,e){var n,s,l,c,u;return arguments.length<2||"string"!=typeof t?(c=e,e=t,t=null):c=arguments[2],r(t)?(n=o.call(t,"c"),s=o.call(t,"e"),l=o.call(t,"w")):(n=l=!0,s=!1),u={value:e,configurable:n,enumerable:s,writable:l},c?i(a(c),u):u};s.gs=function(t,e,s){var l,c,u,h;return"string"!=typeof t?(u=s,s=e,e=t,t=null):u=arguments[3],r(e)?n(e)?r(s)?n(s)||(u=s,s=void 0):s=void 0:(u=e,e=s=void 0):e=void 0,r(t)?(l=o.call(t,"c"),c=o.call(t,"e")):(l=!0,c=!1),h={get:e,set:s,configurable:l,enumerable:c},u?i(a(u),h):h}}}),Uy=f({"node_modules/es5-ext/function/is-arguments.js"(t,e){var r=Object.prototype.toString,n=r.call(function(){return arguments}());e.exports=function(t){return r.call(t)===n}}}),Vy=f({"node_modules/es5-ext/string/is-string.js"(t,e){var r=Object.prototype.toString,n=r.call("");e.exports=function(t){return"string"==typeof t||t&&"object"==typeof t&&(t instanceof String||r.call(t)===n)||!1}}}),qy=f({"node_modules/ext/global-this/is-implemented.js"(t,e){e.exports=function(){return!("object"!=typeof globalThis||!globalThis)&&globalThis.Array===Array}}}),Hy=f({"node_modules/ext/global-this/implementation.js"(t,e){var r=function(){if("object"==typeof self&&self)return self;if("object"==typeof window&&window)return window;throw new Error("Unable to resolve global `this`")};e.exports=function(){if(this)return this;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch{return r()}try{return __global__||r()}finally{delete Object.prototype.__global__}}()}}),Gy=f({"node_modules/ext/global-this/index.js"(t,e){e.exports=qy()()?globalThis:Hy()}}),Wy=f({"node_modules/es6-symbol/is-implemented.js"(t,e){var r=Gy(),n={object:!0,symbol:!0};e.exports=function(){var t,e=r.Symbol;if("function"!=typeof e)return!1;t=e("test symbol");try{String(t)}catch{return!1}return!(!n[typeof e.iterator]||!n[typeof e.toPrimitive]||!n[typeof e.toStringTag])}}}),Zy=f({"node_modules/es6-symbol/is-symbol.js"(t,e){e.exports=function(t){return!(!t||"symbol"!=typeof t&&(!t.constructor||"Symbol"!==t.constructor.name||"Symbol"!==t[t.constructor.toStringTag]))}}}),Yy=f({"node_modules/es6-symbol/validate-symbol.js"(t,e){var r=Zy();e.exports=function(t){if(!r(t))throw new TypeError(t+" is not a symbol");return t}}}),Xy=f({"node_modules/es6-symbol/lib/private/generate-name.js"(t,e){var r=Ny(),n=Object.create,i=Object.defineProperty,a=Object.prototype,o=n(null);e.exports=function(t){for(var e,n,s=0;o[t+(s||"")];)++s;return o[t+=s||""]=!0,i(a,e="@@"+t,r.gs(null,(function(t){n||(n=!0,i(this,e,r(t)),n=!1)}))),e}}}),$y=f({"node_modules/es6-symbol/lib/private/setup/standard-symbols.js"(t,e){var r=Ny(),n=Gy().Symbol;e.exports=function(t){return Object.defineProperties(t,{hasInstance:r("",n&&n.hasInstance||t("hasInstance")),isConcatSpreadable:r("",n&&n.isConcatSpreadable||t("isConcatSpreadable")),iterator:r("",n&&n.iterator||t("iterator")),match:r("",n&&n.match||t("match")),replace:r("",n&&n.replace||t("replace")),search:r("",n&&n.search||t("search")),species:r("",n&&n.species||t("species")),split:r("",n&&n.split||t("split")),toPrimitive:r("",n&&n.toPrimitive||t("toPrimitive")),toStringTag:r("",n&&n.toStringTag||t("toStringTag")),unscopables:r("",n&&n.unscopables||t("unscopables"))})}}}),Ky=f({"node_modules/es6-symbol/lib/private/setup/symbol-registry.js"(t,e){var r=Ny(),n=Yy(),i=Object.create(null);e.exports=function(t){return Object.defineProperties(t,{for:r((function(e){return i[e]?i[e]:i[e]=t(String(e))})),keyFor:r((function(t){var e;for(e in n(t),i)if(i[e]===t)return e}))})}}}),Jy=f({"node_modules/es6-symbol/polyfill.js"(t,e){var r,n,i,a=Ny(),o=Yy(),s=Gy().Symbol,l=Xy(),c=$y(),u=Ky(),h=Object.create,p=Object.defineProperties,f=Object.defineProperty;if("function"==typeof s)try{String(s()),i=!0}catch{}else s=null;n=function(t){if(this instanceof n)throw new TypeError("Symbol is not a constructor");return r(t)},e.exports=r=function t(e){var r;if(this instanceof t)throw new TypeError("Symbol is not a constructor");return i?s(e):(r=h(n.prototype),e=void 0===e?"":String(e),p(r,{__description__:a("",e),__name__:a("",l(e))}))},c(r),u(r),p(n.prototype,{constructor:a(r),toString:a("",(function(){return this.__name__}))}),p(r.prototype,{toString:a((function(){return"Symbol ("+o(this).__description__+")"})),valueOf:a((function(){return o(this)}))}),f(r.prototype,r.toPrimitive,a("",(function(){var t=o(this);return"symbol"==typeof t?t:t.toString()}))),f(r.prototype,r.toStringTag,a("c","Symbol")),f(n.prototype,r.toStringTag,a("c",r.prototype[r.toStringTag])),f(n.prototype,r.toPrimitive,a("c",r.prototype[r.toPrimitive]))}}),Qy=f({"node_modules/es6-symbol/index.js"(t,e){e.exports=Wy()()?Gy().Symbol:Jy()}}),tv=f({"node_modules/es5-ext/array/#/clear.js"(t,e){var r=xy();e.exports=function(){return r(this).length=0,this}}}),ev=f({"node_modules/es5-ext/object/valid-callable.js"(t,e){e.exports=function(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");return t}}}),rv=f({"node_modules/type/string/coerce.js"(t,e){var r=ky(),n=My(),i=Object.prototype.toString;e.exports=function(t){if(!r(t))return null;if(n(t)){var e=t.toString;if("function"!=typeof e||e===i)return null}try{return""+t}catch{return null}}}}),nv=f({"node_modules/type/lib/safe-to-string.js"(t,e){e.exports=function(t){try{return t.toString()}catch{try{return String(t)}catch{return null}}}}}),iv=f({"node_modules/type/lib/to-short-string.js"(t,e){var r=nv(),n=/[\n\r\u2028\u2029]/g;e.exports=function(t){var e=r(t);return null===e?"":(e.length>100&&(e=e.slice(0,99)+"…"),e=e.replace(n,(function(t){switch(t){case"\n":return"\\n";case"\r":return"\\r";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw new Error("Unexpected character")}})))}}}),av=f({"node_modules/type/lib/resolve-exception.js"(t,e){var r=ky(),n=My(),i=rv(),a=iv(),o=function(t,e){return t.replace("%v",a(e))};e.exports=function(t,e,a){if(!n(a))throw new TypeError(o(e,t));if(!r(t)){if("default"in a)return a.default;if(a.isOptional)return null}var s=i(a.errorMessage);throw r(s)||(s=e),new TypeError(o(s,t))}}}),ov=f({"node_modules/type/value/ensure.js"(t,e){var r=av(),n=ky();e.exports=function(t){return n(t)?t:r(t,"Cannot use %v",arguments[1])}}}),sv=f({"node_modules/type/plain-function/ensure.js"(t,e){var r=av(),n=Cy();e.exports=function(t){return n(t)?t:r(t,"%v is not a plain function",arguments[1])}}}),lv=f({"node_modules/es5-ext/array/from/is-implemented.js"(t,e){e.exports=function(){var t,e,r=Array.from;return"function"==typeof r&&!(!(e=r(t=["raz","dwa"]))||e===t||"dwa"!==e[1])}}}),cv=f({"node_modules/es5-ext/function/is-function.js"(t,e){var r=Object.prototype.toString,n=RegExp.prototype.test.bind(/^[object [A-Za-z0-9]*Function]$/);e.exports=function(t){return"function"==typeof t&&n(r.call(t))}}}),uv=f({"node_modules/es5-ext/math/sign/is-implemented.js"(t,e){e.exports=function(){var t=Math.sign;return"function"==typeof t&&1===t(10)&&-1===t(-20)}}}),hv=f({"node_modules/es5-ext/math/sign/shim.js"(t,e){e.exports=function(t){return t=Number(t),isNaN(t)||0===t?t:t>0?1:-1}}}),pv=f({"node_modules/es5-ext/math/sign/index.js"(t,e){e.exports=uv()()?Math.sign:hv()}}),fv=f({"node_modules/es5-ext/number/to-integer.js"(t,e){var r=pv(),n=Math.abs,i=Math.floor;e.exports=function(t){return isNaN(t)?0:0!==(t=Number(t))&&isFinite(t)?r(t)*i(n(t)):t}}}),dv=f({"node_modules/es5-ext/number/to-pos-integer.js"(t,e){var r=fv(),n=Math.max;e.exports=function(t){return n(0,r(t))}}}),mv=f({"node_modules/es5-ext/array/from/shim.js"(t,e){var r=Qy().iterator,n=Uy(),i=cv(),a=dv(),o=ev(),s=xy(),l=gy(),c=Vy(),u=Array.isArray,h=Function.prototype.call,p={configurable:!0,enumerable:!0,writable:!0,value:null},f=Object.defineProperty;e.exports=function(t){var e,d,m,g,y,v,x,_,b,w,T=arguments[1],A=arguments[2];if(t=Object(s(t)),l(T)&&o(T),this&&this!==Array&&i(this))e=this;else{if(!T){if(n(t))return 1!==(y=t.length)?Array.apply(null,t):((g=new Array(1))[0]=t[0],g);if(u(t)){for(g=new Array(y=t.length),d=0;d=55296&&v<=56319&&(w+=t[++d]),w=T?h.call(T,A,w,m):w,e?(p.value=w,f(g,m,p)):g[m]=w,++m;y=m}if(void 0===y)for(y=a(t.length),e&&(g=new e(y)),d=0;d=this.__nextIndex__)){if(++this.__nextIndex__,!this.__redo__)return void u(this,"__redo__",s("c",[t]));this.__redo__.forEach((function(e,r){e>=t&&(this.__redo__[r]=++e)}),this),this.__redo__.push(t)}})),_onDelete:s((function(t){var e;t>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&(-1!==(e=this.__redo__.indexOf(t))&&this.__redo__.splice(e,1),this.__redo__.forEach((function(e,r){e>t&&(this.__redo__[r]=--e)}),this)))})),_onClear:s((function(){this.__redo__&&n.call(this.__redo__),this.__nextIndex__=0}))}))),u(r.prototype,c.iterator,s((function(){return this})))}}),Tv=f({"node_modules/es6-iterator/array.js"(t,e){var r,n=wy(),i=jy(),a=Ny(),o=Qy(),s=wv(),l=Object.defineProperty;r=e.exports=function(t,e){if(!(this instanceof r))throw new TypeError("Constructor requires 'new'");s.call(this,t),e=e?i.call(e,"key+value")?"key+value":i.call(e,"key")?"key":"value":"value",l(this,"__kind__",a("",e))},n&&n(r,s),delete r.prototype.constructor,r.prototype=Object.create(s.prototype,{_resolve:a((function(t){return"value"===this.__kind__?this.__list__[t]:"key+value"===this.__kind__?[t,this.__list__[t]]:t}))}),l(r.prototype,o.toStringTag,a("c","Array Iterator"))}}),Av=f({"node_modules/es6-iterator/string.js"(t,e){var r,n=wy(),i=Ny(),a=Qy(),o=wv(),s=Object.defineProperty;r=e.exports=function(t){if(!(this instanceof r))throw new TypeError("Constructor requires 'new'");t=String(t),o.call(this,t),s(this,"__length__",i("",t.length))},n&&n(r,o),delete r.prototype.constructor,r.prototype=Object.create(o.prototype,{_next:i((function(){if(this.__list__){if(this.__nextIndex__=55296&&e<=56319?r+this.__list__[this.__nextIndex__++]:r}))}),s(r.prototype,a.toStringTag,i("c","String Iterator"))}}),kv=f({"node_modules/es6-iterator/is-iterable.js"(t,e){var r=Uy(),n=gy(),i=Vy(),a=Qy().iterator,o=Array.isArray;e.exports=function(t){return!(!n(t)||!(o(t)||i(t)||r(t))&&"function"!=typeof t[a])}}}),Mv=f({"node_modules/es6-iterator/valid-iterable.js"(t,e){var r=kv();e.exports=function(t){if(!r(t))throw new TypeError(t+" is not iterable");return t}}}),Sv=f({"node_modules/es6-iterator/get.js"(t,e){var r=Uy(),n=Vy(),i=Tv(),a=Av(),o=Mv(),s=Qy().iterator;e.exports=function(t){return"function"==typeof o(t)[s]?t[s]():r(t)?new i(t):n(t)?new a(t):new i(t)}}}),Ev=f({"node_modules/es6-iterator/for-of.js"(t,e){var r=Uy(),n=ev(),i=Vy(),a=Sv(),o=Array.isArray,s=Function.prototype.call,l=Array.prototype.some;e.exports=function(t,e){var c,u,h,p,f,d,m,g,y=arguments[2];if(o(t)||r(t)?c="array":i(t)?c="string":t=a(t),n(e),h=function(){p=!0},"array"!==c)if("string"!==c)for(u=t.next();!u.done;){if(s.call(e,y,u.value,h),p)return;u=t.next()}else for(d=t.length,f=0;f=55296&&g<=56319&&(m+=t[++f]),s.call(e,y,m,h),!p);++f);else l.call(t,(function(t){return s.call(e,y,t,h),p}))}}}),Cv=f({"node_modules/es6-weak-map/is-native-implemented.js"(t,e){e.exports="function"==typeof WeakMap&&"[object WeakMap]"===Object.prototype.toString.call(new WeakMap)}}),Iv=f({"node_modules/es6-weak-map/polyfill.js"(t,e){var r,n=gy(),i=wy(),a=Ty(),o=xy(),s=Ay(),l=Ny(),c=Sv(),u=Ev(),h=Qy().toStringTag,p=Cv(),f=Array.isArray,d=Object.defineProperty,m=Object.prototype.hasOwnProperty,g=Object.getPrototypeOf;e.exports=r=function(){var t,e=arguments[0];if(!(this instanceof r))throw new TypeError("Constructor requires 'new'");return t=p&&i&&WeakMap!==r?i(new WeakMap,g(this)):this,n(e)&&(f(e)||(e=c(e))),d(t,"__weakMapData__",l("c","$weakMap$"+s())),e&&u(e,(function(e){o(e),t.set(e[0],e[1])})),t},p&&(i&&i(r,WeakMap),r.prototype=Object.create(WeakMap.prototype,{constructor:l(r)})),Object.defineProperties(r.prototype,{delete:l((function(t){return!!m.call(a(t),this.__weakMapData__)&&(delete t[this.__weakMapData__],!0)})),get:l((function(t){if(m.call(a(t),this.__weakMapData__))return t[this.__weakMapData__]})),has:l((function(t){return m.call(a(t),this.__weakMapData__)})),set:l((function(t,e){return d(a(t),this.__weakMapData__,l("c",e)),this})),toString:l((function(){return"[object WeakMap]"}))}),d(r.prototype,h,l("c","WeakMap"))}}),Lv=f({"node_modules/es6-weak-map/index.js"(t,e){e.exports=dy()()?WeakMap:Iv()}}),Pv=f({"node_modules/array-find-index/index.js"(t,e){e.exports=function(t,e,r){if("function"==typeof Array.prototype.findIndex)return t.findIndex(e,r);if("function"!=typeof e)throw new TypeError("predicate must be a function");var n=Object(t),i=n.length;if(0===i)return-1;for(var a=0;a"round"===e.join?2:1,miterLimit:t.prop("miterLimit"),scale:t.prop("scale"),scaleFract:t.prop("scaleFract"),translateFract:t.prop("translateFract"),translate:t.prop("translate"),thickness:t.prop("thickness"),dashTexture:t.prop("dashTexture"),opacity:t.prop("opacity"),pixelRatio:t.context("pixelRatio"),id:t.prop("id"),dashLength:t.prop("dashLength"),viewport:(t,e)=>[e.viewport.x,e.viewport.y,t.viewportWidth,t.viewportHeight],depth:t.prop("depth")},blend:{enable:!0,color:[0,0,0,0],equation:{rgb:"add",alpha:"add"},func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},depth:{enable:(t,e)=>!e.overlay},stencil:{enable:!1},scissor:{enable:!0,box:t.prop("viewport")},viewport:t.prop("viewport")},a=t(i({vert:"\nprecision highp float;\n\nattribute vec2 aCoord, bCoord, aCoordFract, bCoordFract;\nattribute vec4 color;\nattribute float lineEnd, lineTop;\n\nuniform vec2 scale, scaleFract, translate, translateFract;\nuniform float thickness, pixelRatio, id, depth;\nuniform vec4 viewport;\n\nvarying vec4 fragColor;\nvarying vec2 tangent;\n\nvec2 project(vec2 position, vec2 positionFract, vec2 scale, vec2 scaleFract, vec2 translate, vec2 translateFract) {\n\t// the order is important\n\treturn position * scale + translate\n + positionFract * scale + translateFract\n + position * scaleFract\n + positionFract * scaleFract;\n}\n\nvoid main() {\n\tfloat lineStart = 1. - lineEnd;\n\tfloat lineOffset = lineTop * 2. - 1.;\n\n\tvec2 diff = (bCoord + bCoordFract - aCoord - aCoordFract);\n\ttangent = normalize(diff * scale * viewport.zw);\n\tvec2 normal = vec2(-tangent.y, tangent.x);\n\n\tvec2 position = project(aCoord, aCoordFract, scale, scaleFract, translate, translateFract) * lineStart\n\t\t+ project(bCoord, bCoordFract, scale, scaleFract, translate, translateFract) * lineEnd\n\n\t\t+ thickness * normal * .5 * lineOffset / viewport.zw;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tfragColor = color / 255.;\n}\n",frag:"\nprecision highp float;\n\nuniform float dashLength, pixelRatio, thickness, opacity, id;\nuniform sampler2D dashTexture;\n\nvarying vec4 fragColor;\nvarying vec2 tangent;\n\nvoid main() {\n\tfloat alpha = 1.;\n\n\tfloat t = fract(dot(tangent, gl_FragCoord.xy) / dashLength) * .5 + .25;\n\tfloat dash = texture2D(dashTexture, vec2(t, .5)).r;\n\n\tgl_FragColor = fragColor;\n\tgl_FragColor.a *= alpha * opacity * dash;\n}\n",attributes:{lineEnd:{buffer:r,divisor:0,stride:8,offset:0},lineTop:{buffer:r,divisor:0,stride:8,offset:4},aCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:16,divisor:1},aCoordFract:{buffer:t.prop("positionFractBuffer"),stride:8,offset:8,divisor:1},bCoordFract:{buffer:t.prop("positionFractBuffer"),stride:8,offset:16,divisor:1},color:{buffer:t.prop("colorBuffer"),stride:4,offset:0,divisor:1}}},n));try{e=t(i({cull:{enable:!0,face:"back"},vert:"\nprecision highp float;\n\nattribute vec2 aCoord, bCoord, nextCoord, prevCoord;\nattribute vec4 aColor, bColor;\nattribute float lineEnd, lineTop;\n\nuniform vec2 scale, translate;\nuniform float thickness, pixelRatio, id, depth;\nuniform vec4 viewport;\nuniform float miterLimit, miterMode;\n\nvarying vec4 fragColor;\nvarying vec4 startCutoff, endCutoff;\nvarying vec2 tangent;\nvarying vec2 startCoord, endCoord;\nvarying float enableStartMiter, enableEndMiter;\n\nconst float REVERSE_THRESHOLD = -.875;\nconst float MIN_DIFF = 1e-6;\n\n// TODO: possible optimizations: avoid overcalculating all for vertices and calc just one instead\n// TODO: precalculate dot products, normalize things beforehead etc.\n// TODO: refactor to rectangular algorithm\n\nfloat distToLine(vec2 p, vec2 a, vec2 b) {\n\tvec2 diff = b - a;\n\tvec2 perp = normalize(vec2(-diff.y, diff.x));\n\treturn dot(p - a, perp);\n}\n\nbool isNaN( float val ){\n return ( val < 0.0 || 0.0 < val || val == 0.0 ) ? false : true;\n}\n\nvoid main() {\n\tvec2 aCoord = aCoord, bCoord = bCoord, prevCoord = prevCoord, nextCoord = nextCoord;\n\n vec2 adjustedScale;\n adjustedScale.x = (abs(scale.x) < MIN_DIFF) ? MIN_DIFF : scale.x;\n adjustedScale.y = (abs(scale.y) < MIN_DIFF) ? MIN_DIFF : scale.y;\n\n vec2 scaleRatio = adjustedScale * viewport.zw;\n\tvec2 normalWidth = thickness / scaleRatio;\n\n\tfloat lineStart = 1. - lineEnd;\n\tfloat lineBot = 1. - lineTop;\n\n\tfragColor = (lineStart * aColor + lineEnd * bColor) / 255.;\n\n\tif (isNaN(aCoord.x) || isNaN(aCoord.y) || isNaN(bCoord.x) || isNaN(bCoord.y)) return;\n\n\tif (aCoord == prevCoord) prevCoord = aCoord + normalize(bCoord - aCoord);\n\tif (bCoord == nextCoord) nextCoord = bCoord - normalize(bCoord - aCoord);\n\n\n\tvec2 prevDiff = aCoord - prevCoord;\n\tvec2 currDiff = bCoord - aCoord;\n\tvec2 nextDiff = nextCoord - bCoord;\n\n\tvec2 prevTangent = normalize(prevDiff * scaleRatio);\n\tvec2 currTangent = normalize(currDiff * scaleRatio);\n\tvec2 nextTangent = normalize(nextDiff * scaleRatio);\n\n\tvec2 prevNormal = vec2(-prevTangent.y, prevTangent.x);\n\tvec2 currNormal = vec2(-currTangent.y, currTangent.x);\n\tvec2 nextNormal = vec2(-nextTangent.y, nextTangent.x);\n\n\tvec2 startJoinDirection = normalize(prevTangent - currTangent);\n\tvec2 endJoinDirection = normalize(currTangent - nextTangent);\n\n\t// collapsed/unidirectional segment cases\n\t// FIXME: there should be more elegant solution\n\tvec2 prevTanDiff = abs(prevTangent - currTangent);\n\tvec2 nextTanDiff = abs(nextTangent - currTangent);\n\tif (max(prevTanDiff.x, prevTanDiff.y) < MIN_DIFF) {\n\t\tstartJoinDirection = currNormal;\n\t}\n\tif (max(nextTanDiff.x, nextTanDiff.y) < MIN_DIFF) {\n\t\tendJoinDirection = currNormal;\n\t}\n\tif (aCoord == bCoord) {\n\t\tendJoinDirection = startJoinDirection;\n\t\tcurrNormal = prevNormal;\n\t\tcurrTangent = prevTangent;\n\t}\n\n\ttangent = currTangent;\n\n\t//calculate join shifts relative to normals\n\tfloat startJoinShift = dot(currNormal, startJoinDirection);\n\tfloat endJoinShift = dot(currNormal, endJoinDirection);\n\n\tfloat startMiterRatio = abs(1. / startJoinShift);\n\tfloat endMiterRatio = abs(1. / endJoinShift);\n\n\tvec2 startJoin = startJoinDirection * startMiterRatio;\n\tvec2 endJoin = endJoinDirection * endMiterRatio;\n\n\tvec2 startTopJoin, startBotJoin, endTopJoin, endBotJoin;\n\tstartTopJoin = sign(startJoinShift) * startJoin * .5;\n\tstartBotJoin = -startTopJoin;\n\n\tendTopJoin = sign(endJoinShift) * endJoin * .5;\n\tendBotJoin = -endTopJoin;\n\n\tvec2 aTopCoord = aCoord + normalWidth * startTopJoin;\n\tvec2 bTopCoord = bCoord + normalWidth * endTopJoin;\n\tvec2 aBotCoord = aCoord + normalWidth * startBotJoin;\n\tvec2 bBotCoord = bCoord + normalWidth * endBotJoin;\n\n\t//miter anti-clipping\n\tfloat baClipping = distToLine(bCoord, aCoord, aBotCoord) / dot(normalize(normalWidth * endBotJoin), normalize(normalWidth.yx * vec2(-startBotJoin.y, startBotJoin.x)));\n\tfloat abClipping = distToLine(aCoord, bCoord, bTopCoord) / dot(normalize(normalWidth * startBotJoin), normalize(normalWidth.yx * vec2(-endBotJoin.y, endBotJoin.x)));\n\n\t//prevent close to reverse direction switch\n\tbool prevReverse = dot(currTangent, prevTangent) <= REVERSE_THRESHOLD && abs(dot(currTangent, prevNormal)) * min(length(prevDiff), length(currDiff)) < length(normalWidth * currNormal);\n\tbool nextReverse = dot(currTangent, nextTangent) <= REVERSE_THRESHOLD && abs(dot(currTangent, nextNormal)) * min(length(nextDiff), length(currDiff)) < length(normalWidth * currNormal);\n\n\tif (prevReverse) {\n\t\t//make join rectangular\n\t\tvec2 miterShift = normalWidth * startJoinDirection * miterLimit * .5;\n\t\tfloat normalAdjust = 1. - min(miterLimit / startMiterRatio, 1.);\n\t\taBotCoord = aCoord + miterShift - normalAdjust * normalWidth * currNormal * .5;\n\t\taTopCoord = aCoord + miterShift + normalAdjust * normalWidth * currNormal * .5;\n\t}\n\telse if (!nextReverse && baClipping > 0. && baClipping < length(normalWidth * endBotJoin)) {\n\t\t//handle miter clipping\n\t\tbTopCoord -= normalWidth * endTopJoin;\n\t\tbTopCoord += normalize(endTopJoin * normalWidth) * baClipping;\n\t}\n\n\tif (nextReverse) {\n\t\t//make join rectangular\n\t\tvec2 miterShift = normalWidth * endJoinDirection * miterLimit * .5;\n\t\tfloat normalAdjust = 1. - min(miterLimit / endMiterRatio, 1.);\n\t\tbBotCoord = bCoord + miterShift - normalAdjust * normalWidth * currNormal * .5;\n\t\tbTopCoord = bCoord + miterShift + normalAdjust * normalWidth * currNormal * .5;\n\t}\n\telse if (!prevReverse && abClipping > 0. && abClipping < length(normalWidth * startBotJoin)) {\n\t\t//handle miter clipping\n\t\taBotCoord -= normalWidth * startBotJoin;\n\t\taBotCoord += normalize(startBotJoin * normalWidth) * abClipping;\n\t}\n\n\tvec2 aTopPosition = (aTopCoord) * adjustedScale + translate;\n\tvec2 aBotPosition = (aBotCoord) * adjustedScale + translate;\n\n\tvec2 bTopPosition = (bTopCoord) * adjustedScale + translate;\n\tvec2 bBotPosition = (bBotCoord) * adjustedScale + translate;\n\n\t//position is normalized 0..1 coord on the screen\n\tvec2 position = (aTopPosition * lineTop + aBotPosition * lineBot) * lineStart + (bTopPosition * lineTop + bBotPosition * lineBot) * lineEnd;\n\n\tstartCoord = aCoord * scaleRatio + translate * viewport.zw + viewport.xy;\n\tendCoord = bCoord * scaleRatio + translate * viewport.zw + viewport.xy;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tenableStartMiter = step(dot(currTangent, prevTangent), .5);\n\tenableEndMiter = step(dot(currTangent, nextTangent), .5);\n\n\t//bevel miter cutoffs\n\tif (miterMode == 1.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tvec2 startMiterWidth = vec2(startJoinDirection) * thickness * miterLimit * .5;\n\t\t\tstartCutoff = vec4(aCoord, aCoord);\n\t\t\tstartCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio;\n\t\t\tstartCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tstartCutoff += viewport.xyxy;\n\t\t\tstartCutoff += startMiterWidth.xyxy;\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tvec2 endMiterWidth = vec2(endJoinDirection) * thickness * miterLimit * .5;\n\t\t\tendCutoff = vec4(bCoord, bCoord);\n\t\t\tendCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio;\n\t\t\tendCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tendCutoff += viewport.xyxy;\n\t\t\tendCutoff += endMiterWidth.xyxy;\n\t\t}\n\t}\n\n\t//round miter cutoffs\n\telse if (miterMode == 2.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tvec2 startMiterWidth = vec2(startJoinDirection) * thickness * abs(dot(startJoinDirection, currNormal)) * .5;\n\t\t\tstartCutoff = vec4(aCoord, aCoord);\n\t\t\tstartCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio;\n\t\t\tstartCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tstartCutoff += viewport.xyxy;\n\t\t\tstartCutoff += startMiterWidth.xyxy;\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tvec2 endMiterWidth = vec2(endJoinDirection) * thickness * abs(dot(endJoinDirection, currNormal)) * .5;\n\t\t\tendCutoff = vec4(bCoord, bCoord);\n\t\t\tendCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio;\n\t\t\tendCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tendCutoff += viewport.xyxy;\n\t\t\tendCutoff += endMiterWidth.xyxy;\n\t\t}\n\t}\n}\n",frag:"\nprecision highp float;\n\nuniform float dashLength, pixelRatio, thickness, opacity, id, miterMode;\nuniform sampler2D dashTexture;\n\nvarying vec4 fragColor;\nvarying vec2 tangent;\nvarying vec4 startCutoff, endCutoff;\nvarying vec2 startCoord, endCoord;\nvarying float enableStartMiter, enableEndMiter;\n\nfloat distToLine(vec2 p, vec2 a, vec2 b) {\n\tvec2 diff = b - a;\n\tvec2 perp = normalize(vec2(-diff.y, diff.x));\n\treturn dot(p - a, perp);\n}\n\nvoid main() {\n\tfloat alpha = 1., distToStart, distToEnd;\n\tfloat cutoff = thickness * .5;\n\n\t//bevel miter\n\tif (miterMode == 1.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tdistToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);\n\t\t\tif (distToStart < -1.) {\n\t\t\t\tdiscard;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\talpha *= min(max(distToStart + 1., 0.), 1.);\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tdistToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);\n\t\t\tif (distToEnd < -1.) {\n\t\t\t\tdiscard;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\talpha *= min(max(distToEnd + 1., 0.), 1.);\n\t\t}\n\t}\n\n\t// round miter\n\telse if (miterMode == 2.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tdistToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);\n\t\t\tif (distToStart < 0.) {\n\t\t\t\tfloat radius = length(gl_FragCoord.xy - startCoord);\n\n\t\t\t\tif(radius > cutoff + .5) {\n\t\t\t\t\tdiscard;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\talpha -= smoothstep(cutoff - .5, cutoff + .5, radius);\n\t\t\t}\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tdistToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);\n\t\t\tif (distToEnd < 0.) {\n\t\t\t\tfloat radius = length(gl_FragCoord.xy - endCoord);\n\n\t\t\t\tif(radius > cutoff + .5) {\n\t\t\t\t\tdiscard;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\talpha -= smoothstep(cutoff - .5, cutoff + .5, radius);\n\t\t\t}\n\t\t}\n\t}\n\n\tfloat t = fract(dot(tangent, gl_FragCoord.xy) / dashLength) * .5 + .25;\n\tfloat dash = texture2D(dashTexture, vec2(t, .5)).r;\n\n\tgl_FragColor = fragColor;\n\tgl_FragColor.a *= alpha * opacity * dash;\n}\n",attributes:{lineEnd:{buffer:r,divisor:0,stride:8,offset:0},lineTop:{buffer:r,divisor:0,stride:8,offset:4},aColor:{buffer:t.prop("colorBuffer"),stride:4,offset:0,divisor:1},bColor:{buffer:t.prop("colorBuffer"),stride:4,offset:4,divisor:1},prevCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:0,divisor:1},aCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:16,divisor:1},nextCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:24,divisor:1}}},n))}catch{e=a}return{fill:t({primitive:"triangle",elements:(t,e)=>e.triangles,offset:0,vert:"\nprecision highp float;\n\nattribute vec2 position, positionFract;\n\nuniform vec4 color;\nuniform vec2 scale, scaleFract, translate, translateFract;\nuniform float pixelRatio, id;\nuniform vec4 viewport;\nuniform float opacity;\n\nvarying vec4 fragColor;\n\nconst float MAX_LINES = 256.;\n\nvoid main() {\n\tfloat depth = (MAX_LINES - 4. - id) / (MAX_LINES);\n\n\tvec2 position = position * scale + translate\n + positionFract * scale + translateFract\n + position * scaleFract\n + positionFract * scaleFract;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tfragColor = color / 255.;\n\tfragColor.a *= opacity;\n}\n",frag:"\nprecision highp float;\nvarying vec4 fragColor;\n\nvoid main() {\n\tgl_FragColor = fragColor;\n}\n",uniforms:{scale:t.prop("scale"),color:t.prop("fill"),scaleFract:t.prop("scaleFract"),translateFract:t.prop("translateFract"),translate:t.prop("translate"),opacity:t.prop("opacity"),pixelRatio:t.context("pixelRatio"),id:t.prop("id"),viewport:(t,e)=>[e.viewport.x,e.viewport.y,t.viewportWidth,t.viewportHeight]},attributes:{position:{buffer:t.prop("positionBuffer"),stride:8,offset:8},positionFract:{buffer:t.prop("positionFractBuffer"),stride:8,offset:8}},blend:n.blend,depth:{enable:!1},scissor:n.scissor,stencil:n.stencil,viewport:n.viewport}),rect:a,miter:e}},d.defaults={dashes:null,join:"miter",miterLimit:1,thickness:10,cap:"square",color:"black",opacity:1,overlay:!1,viewport:null,range:null,close:!1,fill:null},d.prototype.render=function(...t){t.length&&this.update(...t),this.draw()},d.prototype.draw=function(...t){return(t.length?t:this.passes).forEach(((t,e)=>{if(t&&Array.isArray(t))return this.draw(...t);"number"==typeof t&&(t=this.passes[t]),t&&t.count>1&&t.opacity&&(this.regl._refresh(),t.fill&&t.triangles&&t.triangles.length>2&&this.shaders.fill(t),t.thickness&&(t.scale[0]*t.viewport.width>d.precisionThreshold||t.scale[1]*t.viewport.height>d.precisionThreshold||"rect"===t.join||!t.join&&(t.thickness<=2||t.count>=d.maxPoints)?this.shaders.rect(t):this.shaders.miter(t)))})),this},d.prototype.update=function(t){if(!t)return;null!=t.length?"number"==typeof t[0]&&(t=[{positions:t}]):Array.isArray(t)||(t=[t]);let{regl:e,gl:h}=this;if(t.forEach(((t,m)=>{let g=this.passes[m];if(void 0!==t){if(null===t)return void(this.passes[m]=null);if("number"==typeof t[0]&&(t={positions:t}),t=a(t,{positions:"positions points data coords",thickness:"thickness lineWidth lineWidths line-width linewidth width stroke-width strokewidth strokeWidth",join:"lineJoin linejoin join type mode",miterLimit:"miterlimit miterLimit",dashes:"dash dashes dasharray dash-array dashArray",color:"color colour stroke colors colours stroke-color strokeColor",fill:"fill fill-color fillColor",opacity:"alpha opacity",overlay:"overlay crease overlap intersect",close:"closed close closed-path closePath",range:"range dataBox",viewport:"viewport viewBox",hole:"holes hole hollow",splitNull:"splitNull"}),g||(this.passes[m]=g={id:m,scale:null,scaleFract:null,translate:null,translateFract:null,count:0,hole:[],depth:0,dashLength:1,dashTexture:e.texture({channels:1,data:new Uint8Array([255]),width:1,height:1,mag:"linear",min:"linear"}),colorBuffer:e.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array}),positionBuffer:e.buffer({usage:"dynamic",type:"float",data:new Uint8Array}),positionFractBuffer:e.buffer({usage:"dynamic",type:"float",data:new Uint8Array})},t=i({},d.defaults,t)),null!=t.thickness&&(g.thickness=parseFloat(t.thickness)),null!=t.opacity&&(g.opacity=parseFloat(t.opacity)),null!=t.miterLimit&&(g.miterLimit=parseFloat(t.miterLimit)),null!=t.overlay&&(g.overlay=!!t.overlay,mt-e)),e=[],i=0,a=null!=g.hole?g.hole[0]:null;if(null!=a){let e=f(t,(t=>t>=a));t=t.slice(0,e),t.push(a)}for(let n=0;ne-a+(t[n]-i))),c=s(o,l);c=c.map((e=>e+i+(e+i{t.colorBuffer.destroy(),t.positionBuffer.destroy(),t.dashTexture.destroy()})),this.passes.length=0,this}}}),Dv=f({"node_modules/regl-error2d/index.js"(t,e){var r=Fg(),n=Od(),i=ly(),a=Og(),o=oy(),s=jg(),{float32:l,fract32:c}=uy();e.exports=function(t,e){if("function"==typeof t?(e||(e={}),e.regl=t):e=t,e.length&&(e.positions=e),!(t=e.regl).hasExtension("ANGLE_instanced_arrays"))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");let h,p,f,d,m,g,y=t._gl,v={color:"black",capSize:5,lineWidth:1,opacity:1,viewport:null,range:null,offset:0,count:0,bounds:null,positions:[],errors:[]},x=[];return d=t.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array(0)}),p=t.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),f=t.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),m=t.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),g=t.buffer({usage:"static",type:"float",data:u}),T(e),h=t({vert:"\n\t\tprecision highp float;\n\n\t\tattribute vec2 position, positionFract;\n\t\tattribute vec4 error;\n\t\tattribute vec4 color;\n\n\t\tattribute vec2 direction, lineOffset, capOffset;\n\n\t\tuniform vec4 viewport;\n\t\tuniform float lineWidth, capSize;\n\t\tuniform vec2 scale, scaleFract, translate, translateFract;\n\n\t\tvarying vec4 fragColor;\n\n\t\tvoid main() {\n\t\t\tfragColor = color / 255.;\n\n\t\t\tvec2 pixelOffset = lineWidth * lineOffset + (capSize + lineWidth) * capOffset;\n\n\t\t\tvec2 dxy = -step(.5, direction.xy) * error.xz + step(direction.xy, vec2(-.5)) * error.yw;\n\n\t\t\tvec2 position = position + dxy;\n\n\t\t\tvec2 pos = (position + translate) * scale\n\t\t\t\t+ (positionFract + translateFract) * scale\n\t\t\t\t+ (position + translate) * scaleFract\n\t\t\t\t+ (positionFract + translateFract) * scaleFract;\n\n\t\t\tpos += pixelOffset / viewport.zw;\n\n\t\t\tgl_Position = vec4(pos * 2. - 1., 0, 1);\n\t\t}\n\t\t",frag:"\n\t\tprecision highp float;\n\n\t\tvarying vec4 fragColor;\n\n\t\tuniform float opacity;\n\n\t\tvoid main() {\n\t\t\tgl_FragColor = fragColor;\n\t\t\tgl_FragColor.a *= opacity;\n\t\t}\n\t\t",uniforms:{range:t.prop("range"),lineWidth:t.prop("lineWidth"),capSize:t.prop("capSize"),opacity:t.prop("opacity"),scale:t.prop("scale"),translate:t.prop("translate"),scaleFract:t.prop("scaleFract"),translateFract:t.prop("translateFract"),viewport:(t,e)=>[e.viewport.x,e.viewport.y,t.viewportWidth,t.viewportHeight]},attributes:{color:{buffer:d,offset:(t,e)=>4*e.offset,divisor:1},position:{buffer:p,offset:(t,e)=>8*e.offset,divisor:1},positionFract:{buffer:f,offset:(t,e)=>8*e.offset,divisor:1},error:{buffer:m,offset:(t,e)=>16*e.offset,divisor:1},direction:{buffer:g,stride:24,offset:0},lineOffset:{buffer:g,stride:24,offset:8},capOffset:{buffer:g,stride:24,offset:16}},primitive:"triangles",blend:{enable:!0,color:[0,0,0,0],equation:{rgb:"add",alpha:"add"},func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},depth:{enable:!1},scissor:{enable:!0,box:t.prop("viewport")},viewport:t.prop("viewport"),stencil:!1,instances:t.prop("count"),count:u.length}),o(_,{update:T,draw:b,destroy:A,regl:t,gl:y,canvas:y.canvas,groups:x}),_;function _(t){t?T(t):null===t&&A(),b()}function b(e){if("number"==typeof e)return w(e);e&&!Array.isArray(e)&&(e=[e]),t._refresh(),x.forEach(((t,r)=>{if(t){if(e&&(e[r]?t.draw=!0:t.draw=!1),!t.draw)return void(t.draw=!0);w(r)}}))}function w(t){"number"==typeof t&&(t=x[t]),null!=t&&t&&t.count&&t.color&&t.opacity&&t.positions&&t.positions.length>1&&(t.scaleRatio=[t.scale[0]*t.viewport.width,t.scale[1]*t.viewport.height],h(t),t.after&&t.after(t))}function T(t){if(!t)return;null!=t.length?"number"==typeof t[0]&&(t=[{positions:t}]):Array.isArray(t)||(t=[t]);let e=0,u=0;if(_.groups=x=t.map(((t,l)=>{let h=x[l];return t?("function"==typeof t?t={after:t}:"number"==typeof t[0]&&(t={positions:t}),t=a(t,{color:"color colors fill",capSize:"capSize cap capsize cap-size",lineWidth:"lineWidth line-width width line thickness",opacity:"opacity alpha",range:"range dataBox",viewport:"viewport viewBox",errors:"errors error",positions:"positions position data points"}),h||(x[l]=h={id:l,scale:null,translate:null,scaleFract:null,translateFract:null,draw:!0},t=o({},v,t)),i(h,t,[{lineWidth:t=>.5*+t,capSize:t=>.5*+t,opacity:parseFloat,errors:t=>(t=s(t),u+=t.length,t),positions:(t,n)=>(t=s(t,"float64"),n.count=Math.floor(t.length/2),n.bounds=r(t,2),n.offset=e,e+=n.count,t)},{color:(t,e)=>{let r=e.count;if(t||(t="transparent"),!Array.isArray(t)||"number"==typeof t[0]){let e=t;t=Array(r);for(let n=0;n{let n=e.bounds;return t||(t=n),e.scale=[1/(t[2]-t[0]),1/(t[3]-t[1])],e.translate=[-t[0],-t[1]],e.scaleFract=c(e.scale),e.translateFract=c(e.translate),t},viewport:t=>{let e;return Array.isArray(t)?e={x:t[0],y:t[1],width:t[2]-t[0],height:t[3]-t[1]}:t?(e={x:t.x||t.left||0,y:t.y||t.top||0},t.right?e.width=t.right-e.x:e.width=t.w||t.width||0,t.bottom?e.height=t.bottom-e.y:e.height=t.h||t.height||0):e={x:0,y:0,width:y.drawingBufferWidth,height:y.drawingBufferHeight},e}}]),h):h})),e||u){let t=x.reduce(((t,e,r)=>t+(e?e.count:0)),0),e=new Float64Array(2*t),r=new Uint8Array(4*t),n=new Float32Array(4*t);x.forEach(((t,i)=>{if(!t)return;let{positions:a,count:o,offset:s,color:l,errors:c}=t;o&&(r.set(l,4*s),n.set(c,4*s),e.set(a,2*s))}));var h=l(e);p(h);var g=c(e,h);f(g),d(r),m(n)}}function A(){p.destroy(),f.destroy(),d.destroy(),m.destroy(),g.destroy()}};var u=[[1,0,0,1,0,0],[1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,1,0,0],[1,0,0,1,0,0],[1,0,-1,0,0,1],[1,0,-1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,1],[1,0,-1,0,0,1],[-1,0,-1,0,0,1],[-1,0,-1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,1],[-1,0,-1,0,0,1],[0,1,1,0,0,0],[0,1,-1,0,0,0],[0,-1,-1,0,0,0],[0,-1,-1,0,0,0],[0,1,1,0,0,0],[0,-1,1,0,0,0],[0,1,0,-1,1,0],[0,1,0,-1,-1,0],[0,1,0,1,-1,0],[0,1,0,1,1,0],[0,1,0,-1,1,0],[0,1,0,1,-1,0],[0,-1,0,-1,1,0],[0,-1,0,-1,-1,0],[0,-1,0,1,-1,0],[0,-1,0,1,1,0],[0,-1,0,-1,1,0],[0,-1,0,1,-1,0]]}}),Ov=f({"node_modules/unquote/index.js"(t,e){var r=/[\'\"]/;e.exports=function(t){return t?(r.test(t.charAt(0))&&(t=t.substr(1)),r.test(t.charAt(t.length-1))&&(t=t.substr(0,t.length-1)),t):""}}}),Rv=f({"node_modules/css-global-keywords/index.json"(){}}),Fv=f({"node_modules/css-system-font-keywords/index.json"(){}}),Bv=f({"node_modules/css-font-weight-keywords/index.json"(){}}),jv=f({"node_modules/css-font-style-keywords/index.json"(){}}),Nv=f({"node_modules/css-font-stretch-keywords/index.json"(){}}),Uv=f({"node_modules/parenthesis/index.js"(t,e){function r(t,e){if("string"!=typeof t)return[t];var r=[t];"string"==typeof e||Array.isArray(e)?e={brackets:e}:e||(e={});var n=e.brackets?Array.isArray(e.brackets)?e.brackets:[e.brackets]:["{}","[]","()"],i=e.escape||"___",a=!!e.flat;n.forEach((function(t){var e=new RegExp(["\\",t[0],"[^\\",t[0],"\\",t[1],"]*\\",t[1]].join("")),n=[];function a(e,a,o){var s=r.push(e.slice(t[0].length,-t[1].length))-1;return n.push(s),i+s+i}r.forEach((function(t,n){for(var i,o=0;t!=i;)if(i=t,t=t.replace(e,a),o++>1e4)throw Error("References have circular dependency. Please, check them.");r[n]=t})),n=n.reverse(),r=r.map((function(e){return n.forEach((function(r){e=e.replace(new RegExp("(\\"+i+r+"\\"+i+")","g"),t[0]+"$1"+t[1])})),e}))}));var o=new RegExp("\\"+i+"([0-9]+)\\"+i);return a?r:function t(e,r,n){for(var i,a=[],s=0;i=o.exec(e);){if(s++>1e4)throw Error("Circular references in parenthesis");a.push(e.slice(0,i.index)),a.push(t(r[i[1]],r)),e=e.slice(i.index+i[0].length)}return a.push(e),a}(r[0],r)}function n(t,e){if(e&&e.flat){var r,n=e&&e.escape||"___",i=t[0];if(!i)return"";for(var a=new RegExp("\\"+n+"([0-9]+)\\"+n),o=0;i!=r;){if(o++>1e4)throw Error("Circular references in "+t);r=i,i=i.replace(a,s)}return i}return t.reduce((function t(e,r){return Array.isArray(r)&&(r=r.reduce(t,"")),e+r}),"");function s(e,r){if(null==t[r])throw Error("Reference "+r+"is undefined");return t[r]}}function i(t,e){return Array.isArray(t)?n(t,e):r(t,e)}i.parse=r,i.stringify=n,e.exports=i}}),Vv=f({"node_modules/string-split-by/index.js"(t,e){var r=Uv();e.exports=function(t,e,n){if(null==t)throw Error("First argument should be a string");if(null==e)throw Error("Separator should be a string or a RegExp");n?("string"==typeof n||Array.isArray(n))&&(n={ignore:n}):n={},null==n.escape&&(n.escape=!0),null==n.ignore?n.ignore=["[]","()","{}","<>",'""',"''","``","“”","«»"]:("string"==typeof n.ignore&&(n.ignore=[n.ignore]),n.ignore=n.ignore.map((function(t){return 1===t.length&&(t+=t),t})));var i=r.parse(t,{flat:!0,brackets:n.ignore}),a=i[0].split(e);if(n.escape){for(var o=[],s=0;s1&&e===r&&('"'===e||"'"===e))return['"'+n(t.substr(1,t.length-2))+'"'];var a=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(t);if(a)return i(t.substr(0,a.index)).concat(i(a[1])).concat(i(t.substr(a.index+a[0].length)));var o=t.split(".");if(1===o.length)return['"'+n(t)+'"'];for(var s=[],l=0;l65535)<<4,e|=r=((t>>>=e)>255)<<3,e|=r=((t>>>=r)>15)<<2,(e|=r=((t>>>=r)>3)<<1)|(t>>>=r)>>1}function f(){var t=h(8,(function(){return[]}));function e(e){var r=function(t){for(var e=16;e<=1<<28;e*=16)if(t<=e)return e;return 0}(e),n=t[p(r)>>2];return n.length>0?n.pop():new ArrayBuffer(r)}function r(e){t[p(e.byteLength)>>2].push(e)}return{alloc:e,free:r,allocType:function(t,r){var n=null;switch(t){case 5120:n=new Int8Array(e(r),0,r);break;case 5121:n=new Uint8Array(e(r),0,r);break;case 5122:n=new Int16Array(e(2*r),0,r);break;case 5123:n=new Uint16Array(e(2*r),0,r);break;case 5124:n=new Int32Array(e(4*r),0,r);break;case 5125:n=new Uint32Array(e(4*r),0,r);break;case 5126:n=new Float32Array(e(4*r),0,r);break;default:return null}return n.length!==r?n.subarray(0,r):n},freeType:function(t){r(t.buffer)}}}var d=f();d.zero=f();var m=3553,g=6408,y=5126,v=36160,x=function(t){return t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Uint32Array||t instanceof Int8Array||t instanceof Int16Array||t instanceof Int32Array||t instanceof Float32Array||t instanceof Float64Array||t instanceof Uint8ClampedArray};function _(t){return!!t&&"object"==typeof t&&Array.isArray(t.shape)&&Array.isArray(t.stride)&&"number"==typeof t.offset&&t.shape.length===t.stride.length&&(Array.isArray(t.data)||x(t.data))}var b=function(t){return Object.keys(t).map((function(e){return t[e]}))},w=function(t){for(var e=[],r=t;r.length;r=r[0])e.push(r.length);return e},T=function(t,e,r,n){var i=1;if(e.length)for(var a=0;a>>31<<15,a=(n<<1>>>24)-127,o=n>>13&1023;if(a<-24)e[r]=i;else if(a<-14){var s=-14-a;e[r]=i+(o+1024>>s)}else e[r]=a>15?i+31744:i+(a+15<<10)+o}return e}function G(t){return Array.isArray(t)||x(t)}var W=3553,Z=34067,Y=34069,X=6408,$=6406,K=6407,J=6409,Q=6410,tt=32855,et=6402,rt=34041,nt=35904,it=35906,at=36193,ot=33776,st=33777,lt=33778,ct=5121,ut=5123,ht=5125,pt=5126,ft=33071,dt=9728,mt=9984,gt=9987,yt=4352,vt=33984,xt=[mt,9986,9985,gt],_t=[0,J,Q,K,X],bt={};function wt(t){return"[object "+t+"]"}bt[J]=bt[$]=bt[et]=1,bt[rt]=bt[Q]=2,bt[K]=bt[nt]=3,bt[X]=bt[it]=4;var Tt=wt("HTMLCanvasElement"),At=wt("OffscreenCanvas"),kt=wt("CanvasRenderingContext2D"),Mt=wt("ImageBitmap"),St=wt("HTMLImageElement"),Et=wt("HTMLVideoElement"),Ct=Object.keys(M).concat([Tt,At,kt,Mt,St,Et]),It=[];It[ct]=1,It[pt]=4,It[at]=2,It[ut]=2,It[ht]=4;var Lt=[];function Pt(t){return Array.isArray(t)&&(0===t.length||"number"==typeof t[0])}function zt(t){return!!Array.isArray(t)&&!(0===t.length||!G(t[0]))}function Dt(t){return Object.prototype.toString.call(t)}function Ot(t){return Dt(t)===Tt}function Rt(t){return Dt(t)===At}function Ft(t){if(!t)return!1;var e=Dt(t);return Ct.indexOf(e)>=0||Pt(t)||zt(t)||_(t)}function Bt(t){return 0|M[Object.prototype.toString.call(t)]}function jt(t,e){return d.allocType(t.type===at?pt:t.type,e)}function Nt(t,e){t.type===at?(t.data=H(e),d.freeType(e)):t.data=e}function Ut(t,e,r,n,i,a){var o;if(o=typeof Lt[t]<"u"?Lt[t]:bt[t]*It[e],a&&(o*=6),i){for(var s=0,l=r;l>=1;)s+=o*l*l,l/=2;return s}return o*r*n}Lt[32854]=2,Lt[tt]=2,Lt[36194]=2,Lt[rt]=4,Lt[ot]=.5,Lt[st]=.5,Lt[lt]=1,Lt[33779]=1,Lt[35986]=.5,Lt[35987]=1,Lt[34798]=1,Lt[35840]=.5,Lt[35841]=.25,Lt[35842]=.5,Lt[35843]=.25,Lt[36196]=.5;var Vt=36161,qt=32854,Ht=[];function Gt(t,e,r){return Ht[t]*e*r}Ht[qt]=2,Ht[32855]=2,Ht[36194]=2,Ht[33189]=2,Ht[36168]=1,Ht[34041]=4,Ht[35907]=4,Ht[34836]=16,Ht[34842]=8,Ht[34843]=6;var Wt=36160,Zt=36161,Yt=3553,Xt=[];Xt[6408]=4,Xt[6407]=3;var $t=[];$t[5121]=1,$t[5126]=4,$t[36193]=2;var Kt=34963;function Jt(){this.state=0,this.x=0,this.y=0,this.z=0,this.w=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=5126,this.offset=0,this.stride=0,this.divisor=0}function Qt(t){return function(t){for(var e,r="0123456789abcdef",n="",i=0;i>>4&15)+r.charAt(15&e);return n}(function(t){return function(t){for(var e="",r=0;r<32*t.length;r+=8)e+=String.fromCharCode(t[r>>5]>>>24-r%32&255);return e}(function(t,e){var r,n,i,a,o,s,l,c,u,h,p,f,d=new Array(1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225),m=new Array(64);for(t[e>>5]|=128<<24-e%32,t[15+(e+64>>9<<4)]=e,u=0;u>2),r=0;r>5]|=(255&t.charCodeAt(r/8))<<24-r%32;return e}(t),8*t.length))}(function(t){for(var e,r,n="",i=-1;++i>>6&31,128|63&e):e<=65535?n+=String.fromCharCode(224|e>>>12&15,128|e>>>6&63,128|63&e):e<=2097151&&(n+=String.fromCharCode(240|e>>>18&7,128|e>>>12&63,128|e>>>6&63,128|63&e));return n}(t)))}function te(t,e){return t>>>e|t<<32-e}function ee(t,e){return t>>>e}function re(t,e,r){return t&e^~t&r}function ne(t,e,r){return t&e^t&r^e&r}function ie(t){return te(t,2)^te(t,13)^te(t,22)}function ae(t){return te(t,6)^te(t,11)^te(t,25)}function oe(t){return te(t,7)^te(t,18)^ee(t,3)}function se(t){return te(t,17)^te(t,19)^ee(t,10)}var le=new Array(1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998);function ce(t,e){var r=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(r>>16)<<16|65535&r}function ue(t){return Array.prototype.slice.call(t)}function he(t){return ue(t).join("")}var pe="xyzw".split(""),fe="dither",de="blend.enable",me="blend.color",ge="blend.equation",ye="blend.func",ve="depth.enable",xe="depth.func",_e="depth.range",be="depth.mask",we="colorMask",Te="cull.enable",Ae="cull.face",ke="frontFace",Me="lineWidth",Se="polygonOffset.enable",Ee="polygonOffset.offset",Ce="sample.alpha",Ie="sample.enable",Le="sample.coverage",Pe="stencil.enable",ze="stencil.mask",De="stencil.func",Oe="stencil.opFront",Re="stencil.opBack",Fe="scissor.enable",Be="scissor.box",je="viewport",Ne="profile",Ue="framebuffer",Ve="vert",qe="frag",He="elements",Ge="primitive",We="count",Ze="offset",Ye="instances",Xe="vao",$e="Width",Ke="Height",Je=Ue+$e,Qe=Ue+Ke,tr=je+$e,er=je+Ke,rr="drawingBuffer",nr=rr+$e,ir=rr+Ke,ar=[ye,ge,De,Oe,Re,Le,je,Be,Ee],or=34962,sr=34963,lr=35664,cr=35665,ur=35666,hr=35667,pr=35668,fr=35669,dr=35671,mr=35672,gr=35673,yr=35674,vr=35675,xr=35676,_r=35678,br=35680,wr=1028,Tr=1029,Ar=2305,kr=7680,Mr={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},Sr={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},Er={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Cr={cw:2304,ccw:Ar};function Ir(t){return Array.isArray(t)||x(t)||_(t)}function Lr(t){return t.sort((function(t,e){return t===je?-1:e===je?1:t=1,n>=2,e)}if(4===r){var i=t.data;return new Pr(i.thisDep,i.contextDep,i.propDep,e)}if(5===r)return new Pr(!1,!1,!1,e);if(6===r){for(var a=!1,o=!1,s=!1,l=0;l=1&&(o=!0),u>=2&&(s=!0)}else 4===c.type&&(a=a||c.data.thisDep,o=o||c.data.contextDep,s=s||c.data.propDep)}return new Pr(a,o,s,e)}return new Pr(3===r,2===r,1===r,e)}var Rr=new Pr(!1,!1,!1,(function(){}));function Fr(e,r,n,i,a,s,l,c,u,p,f,d,m,g,y,v){var x=p.Record,_={add:32774,subtract:32778,"reverse subtract":32779};n.ext_blend_minmax&&(_.min=32775,_.max=32776);var b=n.angle_instanced_arrays,w=n.webgl_draw_buffers,T=n.oes_vertex_array_object,A={dirty:!0,profile:v.profile},k={},M=[],E={},C={};function I(t){return t.replace(".","_")}function L(t,e,r){var n=I(t);M.push(t),k[n]=A[n]=!!r,E[n]=e}function P(t,e,r){var n=I(t);M.push(t),Array.isArray(r)?(A[n]=r.slice(),k[n]=r.slice()):A[n]=k[n]=r,C[n]=e}function z(t){return!!isNaN(t)}L(fe,3024),L(de,3042),P(me,"blendColor",[0,0,0,0]),P(ge,"blendEquationSeparate",[32774,32774]),P(ye,"blendFuncSeparate",[1,0,1,0]),L(ve,2929,!0),P(xe,"depthFunc",513),P(_e,"depthRange",[0,1]),P(be,"depthMask",!0),P(we,we,[!0,!0,!0,!0]),L(Te,2884),P(Ae,"cullFace",Tr),P(ke,ke,Ar),P(Me,Me,1),L(Se,32823),P(Ee,"polygonOffset",[0,0]),L(Ce,32926),L(Ie,32928),P(Le,"sampleCoverage",[1,!1]),L(Pe,2960),P(ze,"stencilMask",-1),P(De,"stencilFunc",[519,0,-1]),P(Oe,"stencilOpSeparate",[wr,kr,kr,kr]),P(Re,"stencilOpSeparate",[Tr,kr,kr,kr]),L(Fe,3089),P(Be,"scissor",[0,0,e.drawingBufferWidth,e.drawingBufferHeight]),P(je,je,[0,0,e.drawingBufferWidth,e.drawingBufferHeight]);var D={gl:e,context:m,strings:r,next:k,current:A,draw:d,elements:s,buffer:a,shader:f,attributes:p.state,vao:p,uniforms:u,framebuffer:c,extensions:n,timer:g,isBufferArgs:Ir},O={primTypes:F,compareFuncs:Sr,blendFuncs:Mr,blendEquations:_,stencilOps:Er,glTypes:S,orientationType:Cr};w&&(O.backBuffer=[Tr],O.drawBuffer=h(i.maxDrawbuffers,(function(t){return 0===t?[0]:h(t,(function(t){return 36064+t}))})));var R=0;function B(){var e=function(e){var r=e&&e.cache,n=0,i=[],a=[],o=[];function s(){var e=[],r=[];return t((function(){e.push.apply(e,ue(arguments))}),{def:function(){var t="v"+n++;return r.push(t),arguments.length>0&&(e.push(t,"="),e.push.apply(e,ue(arguments)),e.push(";")),t},toString:function(){return he([r.length>0?"var "+r.join(",")+";":"",he(e)])}})}function l(){var e=s(),r=s(),n=e.toString,i=r.toString;function a(t,n){r(t,n,"=",e.def(t,n),";")}return t((function(){e.apply(e,ue(arguments))}),{def:e.def,entry:e,exit:r,save:a,set:function(t,r,n){a(t,r),e(t,r,"=",n,";")},toString:function(){return n()+i()}})}var c=s(),u={};return{global:c,link:function(t,e){var r=e&&e.stable;if(!r)for(var s=0;s"u"?"Date.now()":"performance.now()"}function d(t){t(a=e.def(),"=",f(),";"),"string"==typeof i?t(c,".count+=",i,";"):t(c,".count++;"),g&&(n?t(o=e.def(),"=",h,".getNumPendingQueries();"):t(h,".beginQuery(",c,");"))}function m(t){t(c,".cpuTime+=",f(),"-",a,";"),g&&(n?t(h,".pushScopeStats(",o,",",h,".getNumPendingQueries(),",c,");"):t(h,".endQuery();"))}function y(t){var r=e.def(u,".profile");e(u,".profile=",t,";"),e.exit(u,".profile=",r,";")}if(p){if(zr(p))return void(p.enable?(d(e),m(e.exit),y("true")):y("false"));y(s=p.append(t,e))}else s=e.def(u,".profile");var v=t.block();d(v),e("if(",s,"){",v,"}");var x=t.block();m(x),e.exit("if(",s,"){",x,"}")}function W(t,e,r,n,i){var a=t.shared;n.forEach((function(n){var o,s=n.name,l=r.attributes[s];if(l){if(!i(l))return;o=l.append(t,e)}else{if(!i(Rr))return;var c=t.scopeAttrib(s);o={},Object.keys(new x).forEach((function(t){o[t]=e.def(c,".",t)}))}!function(r,n,i){var o=a.gl,s=e.def(r,".location"),l=e.def(a.attributes,"[",s,"]"),c=i.state,u=i.buffer,h=[i.x,i.y,i.z,i.w],p=["buffer","normalized","offset","stride"];function f(){e("if(!",l,".buffer){",o,".enableVertexAttribArray(",s,");}");var r,a=i.type;if(r=i.size?e.def(i.size,"||",n):n,e("if(",l,".type!==",a,"||",l,".size!==",r,"||",p.map((function(t){return l+"."+t+"!=="+i[t]})).join("||"),"){",o,".bindBuffer(",or,",",u,".buffer);",o,".vertexAttribPointer(",[s,r,a,i.normalized,i.stride,i.offset],");",l,".type=",a,";",l,".size=",r,";",p.map((function(t){return l+"."+t+"="+i[t]+";"})).join(""),"}"),b){var c=i.divisor;e("if(",l,".divisor!==",c,"){",t.instancing,".vertexAttribDivisorANGLE(",[s,c],");",l,".divisor=",c,";}")}}function d(){e("if(",l,".buffer){",o,".disableVertexAttribArray(",s,");",l,".buffer=null;","}if(",pe.map((function(t,e){return l+"."+t+"!=="+h[e]})).join("||"),"){",o,".vertexAttrib4f(",s,",",h,");",pe.map((function(t,e){return l+"."+t+"="+h[e]+";"})).join(""),"}")}1===c?f():2===c?d():(e("if(",c,"===",1,"){"),f(),e("}else{"),d(),e("}"))}(t.link(n),function(t){switch(t){case lr:case hr:case dr:return 2;case cr:case pr:case mr:return 3;case ur:case fr:case gr:return 4;default:return 1}}(n.info.type),o)}))}function Z(t,e,n,i,a,o){for(var s,l=t.shared,c=l.gl,u=0;u1){for(var M=[],S=[],E=0;E>1)",f],");")}function e(){r(d,".drawArraysInstancedANGLE(",[m,g,y,f],");")}h&&"null"!==h?x?t():(r("if(",h,"){"),t(),r("}else{"),e(),r("}")):e()}function w(){function t(){r(l+".drawElements("+[m,y,v,g+"<<(("+v+"-5121)>>1)"]+");")}function e(){r(l+".drawArrays("+[m,g,y]+");")}h&&"null"!==h?x?t():(r("if(",h,"){"),t(),r("}else{"),e(),r("}")):e()}b&&("number"!=typeof f||f>=0)?"string"==typeof f?(r("if(",f,">0){"),_(),r("}else if(",f,"<0){"),w(),r("}")):_():w()}function X(t,e,r,n,i){var a=B(),o=a.proc("body",i);return b&&(a.instancing=o.def(a.shared.extensions,".angle_instanced_arrays")),t(a,o,r,n),a.compile().body}function $(t,e,r,n){q(t,e),r.useVAO?r.drawVAO?e(t.shared.vao,".setVAO(",r.drawVAO.append(t,e),");"):e(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(e(t.shared.vao,".setVAO(null);"),W(t,e,r,n.attributes,(function(){return!0}))),Z(t,e,r,n.uniforms,(function(){return!0}),!1),Y(t,e,e,r)}function K(t,e,r,n){function i(){return!0}t.batchId="a1",q(t,e),W(t,e,r,n.attributes,i),Z(t,e,r,n.uniforms,i,!1),Y(t,e,e,r)}function J(t,e,r,n){q(t,e);var i=r.contextDep,a=e.def(),o=e.def();t.shared.props=o,t.batchId=a;var s=t.scope(),l=t.scope();function c(t){return t.contextDep&&i||t.propDep}function u(t){return!c(t)}if(e(s.entry,"for(",a,"=0;",a,"<","a1",";++",a,"){",o,"=","a0","[",a,"];",l,"}",s.exit),r.needsContext&&j(t,l,r.context),r.needsFramebuffer&&N(t,l,r.framebuffer),V(t,l,r.state,c),r.profile&&c(r.profile)&&H(t,l,r,!1,!0),n)r.useVAO?r.drawVAO?c(r.drawVAO)?l(t.shared.vao,".setVAO(",r.drawVAO.append(t,l),");"):s(t.shared.vao,".setVAO(",r.drawVAO.append(t,s),");"):s(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(s(t.shared.vao,".setVAO(null);"),W(t,s,r,n.attributes,u),W(t,l,r,n.attributes,c)),Z(t,s,r,n.uniforms,u,!1),Z(t,l,r,n.uniforms,c,!0),Y(t,s,l,r);else{var h=t.global.def("{}"),p=r.shader.progVar.append(t,l),f=l.def(p,".id"),d=l.def(h,"[",f,"]");l(t.shared.gl,".useProgram(",p,".program);","if(!",d,"){",d,"=",h,"[",f,"]=",t.link((function(t){return X(K,0,r,t,2)})),"(",p,");}",d,".call(this,a0[",a,"],",a,");")}}function Q(t,e,r){var n=e.static[r];if(n&&function(t){if("object"==typeof t&&!G(t)){for(var e=Object.keys(t),r=0;r0)return null;var n=e.static,i=Object.keys(n);if(i.length>0&&"number"==typeof n[i[0]]){for(var a=[],o=0;o0,w={framebuffer:u,draw:m,shader:y,state:g,dirty:b,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(w.profile=function(t){var e,r=t.static,n=t.dynamic;if(Ne in r){var i=!!r[Ne];(e=Dr((function(t,e){return i}))).enable=i}else if(Ne in n){var a=n[Ne];e=Or(a,(function(t,e){return t.invoke(e,a)}))}return e}(t),w.uniforms=function(t){var e=t.static,r=t.dynamic,n={};return Object.keys(e).forEach((function(t){var r,i=e[t];if("number"==typeof i||"boolean"==typeof i)r=Dr((function(){return i}));else if("function"==typeof i){var a=i._reglType;"texture2d"===a||"textureCube"===a?r=Dr((function(t){return t.link(i)})):("framebuffer"===a||"framebufferCube"===a)&&(r=Dr((function(t){return t.link(i.color[0])})))}else G(i)&&(r=Dr((function(t){return t.global.def("[",h(i.length,(function(t){return i[t]})),"]")})));r.value=i,n[t]=r})),Object.keys(r).forEach((function(t){var e=r[t];n[t]=Or(e,(function(t,r){return t.invoke(r,e)}))})),n}(i),w.drawVAO=w.scopeVAO=m.vao,!w.drawVAO&&y.program&&!l&&n.angle_instanced_arrays&&m.static.elements){var T=!0,A=y.program.attributes.map((function(t){var r=e.static[t];return T=T&&!!r,r}));if(T&&A.length>0){var k=p.getVAO(p.createVAO({attributes:A,elements:m.static.elements}));w.drawVAO=new Pr(null,null,null,(function(t,e){return t.link(k)})),w.useVAO=!0}}return l?w.useVAO=!0:w.attributes=function(t){var e=t.static,n=t.dynamic,i={};return Object.keys(e).forEach((function(t){var n=e[t],o=r.id(t),s=new x;if(Ir(n))s.state=1,s.buffer=a.getBuffer(a.create(n,or,!1,!0)),s.type=0;else{var l=a.getBuffer(n);if(l)s.state=1,s.buffer=l,s.type=0;else if("constant"in n){var c=n.constant;s.buffer="null",s.state=2,"number"==typeof c?s.x=c:pe.forEach((function(t,e){e"+e+"?"+n+".constant["+e+"]:0;"})).join(""),"}}else{","if(",o,"(",n,".buffer)){",u,"=",s,".createStream(",or,",",n,".buffer);","}else{",u,"=",s,".getBuffer(",n,".buffer);","}",h,'="type" in ',n,"?",a.glTypes,"[",n,".type]:",u,".dtype;",l.normalized,"=!!",n,".normalized;"),p("size"),p("offset"),p("stride"),p("divisor"),r("}}"),r.exit("if(",l.isStream,"){",s,".destroyStream(",u,");","}"),l}))})),i}(e),w.context=function(t){var e=t.static,r=t.dynamic,n={};return Object.keys(e).forEach((function(t){var r=e[t];n[t]=Dr((function(t,e){return"number"==typeof r||"boolean"==typeof r?""+r:t.link(r)}))})),Object.keys(r).forEach((function(t){var e=r[t];n[t]=Or(e,(function(t,r){return t.invoke(r,e)}))})),n}(o),w}(e,i,o,l);return m.shader.program&&(m.shader.program.attributes.sort((function(t,e){return t.name0&&r(t.shared.current,".dirty=true;"),t.shared.vao&&r(t.shared.vao,".setVAO(null);")}(d,m),function(t,e){var n=t.proc("scope",3);t.batchId="a2";var i=t.shared,a=i.current;if(j(t,n,e.context),e.framebuffer&&e.framebuffer.append(t,n),Lr(Object.keys(e.state)).forEach((function(r){var a=e.state[r],o=a.append(t,n);G(o)?o.forEach((function(e,i){z(e)?n.set(t.next[r],"["+i+"]",e):n.set(t.next[r],"["+i+"]",t.link(e,{stable:!0}))})):zr(a)?n.set(i.next,"."+r,t.link(o,{stable:!0})):n.set(i.next,"."+r,o)})),H(t,n,e,!0,!0),[He,Ze,We,Ye,Ge].forEach((function(r){var a=e.draw[r];if(a){var o=a.append(t,n);z(o)?n.set(i.draw,"."+r,o):n.set(i.draw,"."+r,t.link(o),{stable:!0})}})),Object.keys(e.uniforms).forEach((function(a){var o=e.uniforms[a].append(t,n);Array.isArray(o)&&(o="["+o.map((function(e){return z(e)?e:t.link(e,{stable:!0})}))+"]"),n.set(i.uniforms,"["+t.link(r.id(a),{stable:!0})+"]",o)})),Object.keys(e.attributes).forEach((function(r){var i=e.attributes[r].append(t,n),a=t.scopeAttrib(r);Object.keys(new x).forEach((function(t){n.set(a,"."+t,i[t])}))})),e.scopeVAO){var o=e.scopeVAO.append(t,n);z(o)?n.set(i.vao,".targetVAO",o):n.set(i.vao,".targetVAO",t.link(o,{stable:!0}))}function s(r){var a=e.shader[r];if(a){var o=a.append(t,n);z(o)?n.set(i.shader,"."+r,o):n.set(i.shader,"."+r,t.link(o,{stable:!0}))}}s(Ve),s(qe),Object.keys(e.state).length>0&&(n(a,".dirty=true;"),n.exit(a,".dirty=true;")),n("a1(",t.shared.context,",a0,",t.batchId,");")}(d,m),function(t,e){var r=t.proc("batch",2);t.batchId="0",q(t,r);var n=!1,i=!0;Object.keys(e.context).forEach((function(t){n=n||e.context[t].propDep})),n||(j(t,r,e.context),i=!1);var a=e.framebuffer,o=!1;function s(t){return t.contextDep&&n||t.propDep}a?(a.propDep?n=o=!0:a.contextDep&&n&&(o=!0),o||N(t,r,a)):N(t,r,null),e.state.viewport&&e.state.viewport.propDep&&(n=!0),U(t,r,e),V(t,r,e.state,(function(t){return!s(t)})),(!e.profile||!s(e.profile))&&H(t,r,e,!1,"a1"),e.contextDep=n,e.needsContext=i,e.needsFramebuffer=o;var l=e.shader.progVar;if(l.contextDep&&n||l.propDep)J(t,r,e,null);else{var c=l.append(t,r);if(r(t.shared.gl,".useProgram(",c,".program);"),e.shader.program)J(t,r,e,e.shader.program);else{r(t.shared.vao,".setVAO(null);");var u=t.global.def("{}"),h=r.def(c,".id"),p=r.def(u,"[",h,"]");r(t.cond(p).then(p,".call(this,a0,a1);").else(p,"=",u,"[",h,"]=",t.link((function(t){return X(J,0,e,t,2)})),"(",c,");",p,".call(this,a0,a1);"))}}Object.keys(e.state).length>0&&r(t.shared.current,".dirty=true;"),t.shared.vao&&r(t.shared.vao,".setVAO(null);")}(d,m),t(d.compile(),{destroy:function(){m.shader.program.destroy()}})}}}var Br="webglcontextlost",jr="webglcontextrestored";function Nr(t,e){for(var r=0;r"u"?1:window.devicePixelRatio,f=!1,d={},m=function(t){},g=function(){};if("string"==typeof o?r=document.querySelector(o):"object"==typeof o&&(function(t){return"string"==typeof t.nodeName&&"function"==typeof t.appendChild&&"function"==typeof t.getBoundingClientRect}(o)?r=o:function(t){return"function"==typeof t.drawArrays||"function"==typeof t.drawElements}(o)?i=(a=o).canvas:("gl"in o?a=o.gl:"canvas"in o?i=u(o.canvas):"container"in o&&(n=u(o.container)),"attributes"in o&&(s=o.attributes),"extensions"in o&&(l=c(o.extensions)),"optionalExtensions"in o&&(h=c(o.optionalExtensions)),"onDone"in o&&(m=o.onDone),"profile"in o&&(f=!!o.profile),"pixelRatio"in o&&(p=+o.pixelRatio),"cachedCode"in o&&(d=o.cachedCode))),r&&("canvas"===r.nodeName.toLowerCase()?i=r:n=r),!a){if(!i){var y=function(e,r,n){var i,a=document.createElement("canvas");function o(){var t=window.innerWidth,r=window.innerHeight;if(e!==document.body){var i=a.getBoundingClientRect();t=i.right-i.left,r=i.bottom-i.top}a.width=n*t,a.height=n*r}return t(a.style,{border:0,margin:0,padding:0,top:0,left:0,width:"100%",height:"100%"}),e.appendChild(a),e===document.body&&(a.style.position="absolute",t(e.style,{margin:0,padding:0})),e!==document.body&&"function"==typeof ResizeObserver?(i=new ResizeObserver((function(){setTimeout(o)}))).observe(e):window.addEventListener("resize",o,!1),o(),{canvas:a,onDestroy:function(){i?i.disconnect():window.removeEventListener("resize",o),e.removeChild(a)}}}(n||document.body,0,p);if(!y)return null;i=y.canvas,g=y.onDestroy}void 0===s.premultipliedAlpha&&(s.premultipliedAlpha=!0),a=function(t,e){function r(r){try{return t.getContext(r,e)}catch{return null}}return r("webgl")||r("experimental-webgl")||r("webgl-experimental")}(i,s)}return a?{gl:a,canvas:i,container:n,extensions:l,optionalExtensions:h,pixelRatio:p,profile:f,cachedCode:d,onDone:m,onDestroy:g}:(g(),m("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}(e);if(!r)return null;var n=r.gl,i=n.getContextAttributes(),a=(n.isContextLost(),function(t,e){var r={};function n(e){var n,i=e.toLowerCase();try{n=r[i]=t.getExtension(i)}catch{}return!!n}for(var i=0;i0)if(Array.isArray(e[0])){o=I(e);for(var c=1,u=1;u0)if("number"==typeof t[0]){var i=d.allocType(h.dtype,t.length);O(i,t),f(i,n),d.freeType(i)}else if(Array.isArray(t[0])||x(t[0])){r=I(t);var a=C(t,r,h.dtype);f(a,n),d.freeType(a)}}else if(_(t)){r=t.shape;var o=t.stride,s=0,l=0,c=0,u=0;1===r.length?(s=r[0],l=1,c=o[0],u=0):2===r.length&&(s=r[0],l=r[1],c=o[0],u=o[1]);var m=Array.isArray(t.data)?h.dtype:D(t.data),g=d.allocType(m,s*l);R(g,t.data,s,l,c,u,t.offset),f(g,n),d.freeType(g)}return p},r.profile&&(p.stats=h.stats),p.destroy=function(){c(h)},p},createStream:function(t,e){var r=o.pop();return r||(r=new a(t)),r.bind(),l(r,e,35040,0,1,!1),r},destroyStream:function(t){o.push(t)},clear:function(){b(i).forEach(c),o.forEach(c)},getBuffer:function(t){return t&&t._buffer instanceof a?t._buffer:null},restore:function(){b(i).forEach((function(e){e.buffer=t.createBuffer(),t.bindBuffer(e.type,e.buffer),t.bufferData(e.type,e.persistentData||e.byteLength,e.usage)}))},_initBuffer:l}}(n,p,r),It=function(t,e,r,n){var i={},a=0,o={uint8:B,uint16:j};function s(t){this.id=a++,i[this.id]=this,this.buffer=t,this.primType=4,this.vertCount=0,this.type=0}e.oes_element_index_uint&&(o.uint32=N),s.prototype.bind=function(){this.buffer.bind()};var l=[];function c(n,i,a,o,s,l,c){var u;if(n.buffer.bind(),i){var h=c;!c&&(!x(i)||_(i)&&!x(i.data))&&(h=e.oes_element_index_uint?N:j),r._initBuffer(n.buffer,i,a,h,3)}else t.bufferData(U,l,a),n.buffer.dtype=u||B,n.buffer.usage=a,n.buffer.dimension=3,n.buffer.byteLength=l;if(u=c,!c){switch(n.buffer.dtype){case B:case 5120:u=B;break;case j:case 5122:u=j;break;case N:case 5124:u=N}n.buffer.dtype=u}n.type=u;var p=s;p<0&&(p=n.buffer.byteLength,u===j?p>>=1:u===N&&(p>>=2)),n.vertCount=p;var f=o;if(o<0){f=4;var d=n.buffer.dimension;1===d&&(f=0),2===d&&(f=1),3===d&&(f=4)}n.primType=f}function u(t){n.elementsCount--,delete i[t.id],t.buffer.destroy(),t.buffer=null}return{create:function(t,e){var i=r.create(null,U,!0),a=new s(i._buffer);function l(t){if(t)if("number"==typeof t)i(t),a.primType=4,a.vertCount=0|t,a.type=B;else{var e=null,r=35044,n=-1,s=-1,u=0,h=0;Array.isArray(t)||x(t)||_(t)?e=t:("data"in t&&(e=t.data),"usage"in t&&(r=E[t.usage]),"primitive"in t&&(n=F[t.primitive]),"count"in t&&(s=0|t.count),"type"in t&&(h=o[t.type]),"length"in t?u=0|t.length:(u=s,h===j||5122===h?u*=2:(h===N||5124===h)&&(u*=4))),c(a,e,r,n,s,u,h)}else i(),a.primType=4,a.vertCount=0,a.type=B;return l}return n.elementsCount++,l(t),l._reglType="elements",l._elements=a,l.subdata=function(t,e){return i.subdata(t,e),l},l.destroy=function(){u(a)},l},createStream:function(t){var e=l.pop();return e||(e=new s(r.create(null,U,!0,!1)._buffer)),c(e,t,35040,-1,-1,0,0),e},destroyStream:function(t){l.push(t)},getElements:function(t){return"function"==typeof t&&t._elements instanceof s?t._elements:null},clear:function(){b(i).forEach(u)}}}(n,A,Ct,p),Lt=function(t,e,r,n,i,a,o){for(var s=r.maxAttributes,l=new Array(s),c=0;c=f.byteLength?u.subdata(f):(u.destroy(),e.buffers[c]=null)),e.buffers[c]||(u=e.buffers[c]=i.create(h,34962,!1,!0)),p.buffer=i.getBuffer(u),p.size=0|p.buffer.dimension,p.normalized=!1,p.type=p.buffer.dtype,p.offset=0,p.stride=0,p.divisor=0,p.state=1,s[c]=1):i.getBuffer(h)?(p.buffer=i.getBuffer(h),p.size=0|p.buffer.dimension,p.normalized=!1,p.type=p.buffer.dtype,p.offset=0,p.stride=0,p.divisor=0,p.state=1):i.getBuffer(h.buffer)?(p.buffer=i.getBuffer(h.buffer),p.size=0|(+h.size||p.buffer.dimension),p.normalized=!!h.normalized||!1,p.type="type"in h?S[h.type]:p.buffer.dtype,p.offset=0|(h.offset||0),p.stride=0|(h.stride||0),p.divisor=0|(h.divisor||0),p.state=1):"x"in h&&(p.x=+h.x||0,p.y=+h.y||0,p.z=+h.z||0,p.w=+h.w||0,p.state=2)}for(var d=0;d1)for(var y=0;yt&&(t=e.stats.uniformsCount)})),t},n.getMaxAttributesCount=function(){var t=0;return h.forEach((function(e){e.stats.attributesCount>t&&(t=e.stats.attributesCount)})),t}),{clear:function(){var t=e.deleteShader.bind(e);b(a).forEach(t),a={},b(o).forEach(t),o={},h.forEach((function(t){e.deleteProgram(t.program)})),h.length=0,u={},n.shaderCount=0},program:function(r,i,s,l){var c=u[i];c||(c=u[i]={});var p=c[r];if(p&&(p.refCount++,!l))return p;var m=new f(i,r);return n.shaderCount++,d(m,0,l),p||(c[r]=m),h.push(m),t(m,{destroy:function(){if(m.refCount--,m.refCount<=0){e.deleteProgram(m.program);var t=h.indexOf(m);h.splice(t,1),n.shaderCount--}c[m.vertId].refCount<=0&&(e.deleteShader(o[m.vertId]),delete o[m.vertId],delete u[m.fragId][m.vertId]),Object.keys(u[m.fragId]).length||(e.deleteShader(a[m.fragId]),delete a[m.fragId],delete u[m.fragId])}})},restore:function(){a={},o={};for(var t=0;t=0&&(m[t]=e)}));var v=Object.keys(m);n.textureFormats=v;var A=[];Object.keys(m).forEach((function(t){var e=m[t];A[e]=t}));var k=[];Object.keys(f).forEach((function(t){var e=f[t];k[e]=t}));var M=[];Object.keys(u).forEach((function(t){M[u[t]]=t}));var S=[];Object.keys(h).forEach((function(t){var e=h[t];S[e]=t}));var E=[];Object.keys(c).forEach((function(t){E[c[t]]=t}));var C=v.reduce((function(t,e){var n=m[e];return n===J||n===$||n===J||n===Q||n===et||n===rt||r.ext_srgb&&(n===nt||n===it)?t[n]=n:n===tt||e.indexOf("rgba")>=0?t[n]=X:t[n]=K,t}),{});function I(){this.internalformat=X,this.format=X,this.type=ct,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=37444,this.width=0,this.height=0,this.channels=0}function L(t,e){t.internalformat=e.internalformat,t.format=e.format,t.type=e.type,t.compressed=e.compressed,t.premultiplyAlpha=e.premultiplyAlpha,t.flipY=e.flipY,t.unpackAlignment=e.unpackAlignment,t.colorSpace=e.colorSpace,t.width=e.width,t.height=e.height,t.channels=e.channels}function P(t,e){if("object"==typeof e&&e){if("premultiplyAlpha"in e&&(t.premultiplyAlpha=e.premultiplyAlpha),"flipY"in e&&(t.flipY=e.flipY),"alignment"in e&&(t.unpackAlignment=e.alignment),"colorSpace"in e&&(t.colorSpace=p[e.colorSpace]),"type"in e){var r=e.type;t.type=f[r]}var n=t.width,i=t.height,a=t.channels,o=!1;"shape"in e?(n=e.shape[0],i=e.shape[1],3===e.shape.length&&(a=e.shape[2],o=!0)):("radius"in e&&(n=i=e.radius),"width"in e&&(n=e.width),"height"in e&&(i=e.height),"channels"in e&&(a=e.channels,o=!0)),t.width=0|n,t.height=0|i,t.channels=0|a;var s=!1;if("format"in e){var l=e.format,c=t.internalformat=m[l];t.format=C[c],l in f&&("type"in e||(t.type=f[l])),l in g&&(t.compressed=!0),s=!0}!o&&s?t.channels=bt[t.format]:o&&!s&&t.channels!==_t[t.format]&&(t.format=t.internalformat=_t[t.channels])}}function z(t){e.pixelStorei(37440,t.flipY),e.pixelStorei(37441,t.premultiplyAlpha),e.pixelStorei(37443,t.colorSpace),e.pixelStorei(3317,t.unpackAlignment)}function D(){I.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function O(t,e){var r=null;if(Ft(e)?r=e:e&&(P(t,e),"x"in e&&(t.xOffset=0|e.x),"y"in e&&(t.yOffset=0|e.y),Ft(e.data)&&(r=e.data)),e.copy){var n=a.viewportWidth,i=a.viewportHeight;t.width=t.width||n-t.xOffset,t.height=t.height||i-t.yOffset,t.needsCopy=!0}else if(r){if(x(r))t.channels=t.channels||4,t.data=r,!("type"in e)&&t.type===ct&&(t.type=Bt(r));else if(Pt(r))t.channels=t.channels||4,function(t,e){var r=e.length;switch(t.type){case ct:case ut:case ht:case pt:var n=d.allocType(t.type,r);n.set(e),t.data=n;break;case at:t.data=H(e)}}(t,r),t.alignment=1,t.needsFree=!0;else if(_(r)){var o=r.data;!Array.isArray(o)&&t.type===ct&&(t.type=Bt(o));var s,l,c,u,h,p,f=r.shape,m=r.stride;3===f.length?(c=f[2],p=m[2]):(c=1,p=1),s=f[0],l=f[1],u=m[0],h=m[1],t.alignment=1,t.width=s,t.height=l,t.channels=c,t.format=t.internalformat=_t[c],t.needsFree=!0,function(t,e,r,n,i,a){for(var o=t.width,s=t.height,l=t.channels,c=jt(t,o*s*l),u=0,h=0;h>=i,r.height>>=i,O(r,n[i]),t.mipmask|=1<=0&&!("faces"in e)&&(t.genMipmaps=!0)}if("mag"in e){var n=e.mag;t.magFilter=u[n]}var i=t.wrapS,a=t.wrapT;if("wrap"in e){var o=e.wrap;"string"==typeof o?i=a=c[o]:Array.isArray(o)&&(i=c[o[0]],a=c[o[1]])}else{if("wrapS"in e){var s=e.wrapS;i=c[s]}if("wrapT"in e){var p=e.wrapT;a=c[p]}}if(t.wrapS=i,t.wrapT=a,"anisotropic"in e&&(e.anisotropic,t.anisotropic=e.anisotropic),"mipmap"in e){var f=!1;switch(typeof e.mipmap){case"string":t.mipmapHint=l[e.mipmap],t.genMipmaps=!0,f=!0;break;case"boolean":f=t.genMipmaps=e.mipmap;break;case"object":t.genMipmaps=!1,f=!0}f&&!("min"in e)&&(t.minFilter=mt)}}function Vt(t,n){e.texParameteri(n,10241,t.minFilter),e.texParameteri(n,10240,t.magFilter),e.texParameteri(n,10242,t.wrapS),e.texParameteri(n,10243,t.wrapT),r.ext_texture_filter_anisotropic&&e.texParameteri(n,34046,t.anisotropic),t.genMipmaps&&(e.hint(33170,t.mipmapHint),e.generateMipmap(n))}var qt=0,Ht={},Gt=n.maxTextureUnits,Wt=Array(Gt).map((function(){return null}));function Zt(t){I.call(this),this.mipmask=0,this.internalformat=X,this.id=qt++,this.refCount=1,this.target=t,this.texture=e.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new It,s.profile&&(this.stats={size:0})}function Yt(t){e.activeTexture(vt),e.bindTexture(t.target,t.texture)}function Xt(){var t=Wt[0];t?e.bindTexture(t.target,t.texture):e.bindTexture(W,null)}function $t(t){var r=t.texture,n=t.unit,i=t.target;n>=0&&(e.activeTexture(vt+n),e.bindTexture(i,null),Wt[n]=null),e.deleteTexture(r),t.texture=null,t.params=null,t.pixels=null,t.refCount=0,delete Ht[t.id],o.textureCount--}return t(Zt.prototype,{bind:function(){var t=this;t.bindCount+=1;var r=t.unit;if(r<0){for(var n=0;n0)continue;i.unit=-1}Wt[n]=t,r=n;break}s.profile&&o.maxTextureUnits>l)-o,c.height=c.height||(n.height>>l)-s,Yt(n),F(c,W,o,s,l),Xt(),N(c),i},i.resize=function(t,r){var a=0|t,o=0|r||a;if(a===n.width&&o===n.height)return i;i.width=n.width=a,i.height=n.height=o,Yt(n);for(var l=0;n.mipmask>>l;++l){var c=a>>l,u=o>>l;if(!c||!u)break;e.texImage2D(W,l,n.format,c,u,0,n.format,n.type,null)}return Xt(),s.profile&&(n.stats.size=Ut(n.internalformat,n.type,a,o,!1,!1)),i},i._reglType="texture2d",i._texture=n,s.profile&&(i.stats=n.stats),i.destroy=function(){n.decRef()},i},createCube:function(t,r,n,i,a,l){var c=new Zt(Z);Ht[c.id]=c,o.cubeCount++;var u=new Array(6);function h(t,e,r,n,i,a){var o,l=c.texInfo;for(It.call(l),o=0;o<6;++o)u[o]=At();if("number"!=typeof t&&t){if("object"==typeof t)if(e)q(u[0],t),q(u[1],e),q(u[2],r),q(u[3],n),q(u[4],i),q(u[5],a);else if(Lt(l,t),P(c,t),"faces"in t){var p=t.faces;for(o=0;o<6;++o)L(u[o],c),q(u[o],p[o])}else for(o=0;o<6;++o)q(u[o],t)}else{var f=0|t||1;for(o=0;o<6;++o)V(u[o],f,f)}for(L(c,u[0]),l.genMipmaps?c.mipmask=(u[0].width<<1)-1:c.mipmask=u[0].mipmask,c.internalformat=u[0].internalformat,h.width=u[0].width,h.height=u[0].height,Yt(c),o=0;o<6;++o)wt(u[o],Y+o);for(Vt(l,Z),Xt(),s.profile&&(c.stats.size=Ut(c.internalformat,c.type,h.width,h.height,l.genMipmaps,!0)),h.format=A[c.internalformat],h.type=k[c.type],h.mag=M[l.magFilter],h.min=S[l.minFilter],h.wrapS=E[l.wrapS],h.wrapT=E[l.wrapT],o=0;o<6;++o)Ct(u[o]);return h}return h(t,r,n,i,a,l),h.subimage=function(t,e,r,n,i){var a=0|r,o=0|n,s=0|i,l=j();return L(l,c),l.width=0,l.height=0,O(l,e),l.width=l.width||(c.width>>s)-a,l.height=l.height||(c.height>>s)-o,Yt(c),F(l,Y+t,a,o,s),Xt(),N(l),h},h.resize=function(t){var r=0|t;if(r!==c.width){h.width=c.width=r,h.height=c.height=r,Yt(c);for(var n=0;n<6;++n)for(var i=0;c.mipmask>>i;++i)e.texImage2D(Y+n,i,c.format,r>>i,r>>i,0,c.format,c.type,null);return Xt(),s.profile&&(c.stats.size=Ut(c.internalformat,c.type,h.width,h.height,!1,!0)),h}},h._reglType="textureCube",h._texture=c,s.profile&&(h.stats=c.stats),h.destroy=function(){c.decRef()},h},clear:function(){for(var t=0;t>r,t.height>>r,0,t.internalformat,t.type,null);else for(var n=0;n<6;++n)e.texImage2D(Y+n,r,t.internalformat,t.width>>r,t.height>>r,0,t.internalformat,t.type,null);Vt(t.texInfo,t.target)}))},refresh:function(){for(var t=0;t=0?p=!0:c.indexOf(d)>=0&&(p=!1))),("depthTexture"in M||"depthStencilTexture"in M)&&(A=!(!M.depthTexture&&!M.depthStencilTexture)),"depth"in M&&("boolean"==typeof M.depth?s=M.depth:(_=M.depth,u=!1)),"stencil"in M&&("boolean"==typeof M.stencil?u=M.stencil:(b=M.stencil,s=!1)),"depthStencil"in M&&("boolean"==typeof M.depthStencil?s=u=M.depthStencil:(w=M.depthStencil,s=!1,u=!1))}else a=o=1;var E=null,C=null,I=null,L=null;if(Array.isArray(h))E=h.map(m);else if(h)E=[m(h)];else for(E=new Array(x),r=0;r0&&(s.depth=r[0].depth,s.stencil=r[0].stencil,s.depthStencil=r[0].depthStencil),r[a]?r[a](s):r[a]=M(s)}return t(n,{width:l,height:l,color:o})}return n(e),t(n,{faces:r,resize:function(t){var e,i=0|t;if(i===n.width)return n;var a=n.color;for(e=0;e=0;--t){var e=oe[t];e&&e(wt,null,0)}n.flush(),k&&k.update()}function pe(){!ue&&oe.length>0&&(ue=s.next(he))}function fe(){ue&&(s.cancel(he),ue=null)}function de(t){t.preventDefault(),fe(),se.forEach((function(t){t()}))}function me(t){n.getError(),a.restore(),Ht.restore(),Ct.restore(),Qt.restore(),te.restore(),ee.restore(),Lt.restore(),k&&k.restore(),re.procs.refresh(),pe(),le.forEach((function(t){t()}))}function ge(e){function r(t,e){var r={},n={};return Object.keys(t).forEach((function(i){var a=t[i];if(o.isDynamic(a))n[i]=o.unbox(a,i);else{if(e&&Array.isArray(a))for(var s=0;s0)return h.call(this,function(t){for(;f.length=0},read:ne,destroy:function(){oe.length=0,fe(),ae&&(ae.removeEventListener(Br,de),ae.removeEventListener(jr,me)),Ht.clear(),ee.clear(),te.clear(),Lt.clear(),Qt.clear(),It.clear(),Ct.clear(),k&&k.clear(),ce.forEach((function(t){t()}))},_gl:n,_refresh:we,poll:function(){be(),k&&k.update()},now:Te,stats:p,getCachedCode:function(){return f},preloadCachedCode:function(t){Object.entries(t).forEach((function(t){f[t[0]]=t[1]}))}});return r.onDone(null,Ae),Ae}},"object"==typeof t&&typeof e<"u"?e.exports=n():r.createREGL=n()}}),Xv=f({"node_modules/gl-util/context.js"(t,e){var r=Og();function n(t){if(t.container)if(t.container==document.body)document.body.style.width||(t.canvas.width=t.width||t.pixelRatio*window.innerWidth),document.body.style.height||(t.canvas.height=t.height||t.pixelRatio*window.innerHeight);else{var e=t.container.getBoundingClientRect();t.canvas.width=t.width||e.right-e.left,t.canvas.height=t.height||e.bottom-e.top}}function i(t){return"function"==typeof t.getContext&&"width"in t&&"height"in t}function a(){var t=document.createElement("canvas");return t.style.position="absolute",t.style.top=0,t.style.left=0,t}e.exports=function(t){if(t?"string"==typeof t&&(t={container:t}):t={},(t=i(t)||"string"==typeof(e=t).nodeName&&"function"==typeof e.appendChild&&"function"==typeof e.getBoundingClientRect?{container:t}:function(t){return"function"==typeof t.drawArrays||"function"==typeof t.drawElements}(t)?{gl:t}:r(t,{container:"container target element el canvas holder parent parentNode wrapper use ref root node",gl:"gl context webgl glContext",attrs:"attributes attrs contextAttributes",pixelRatio:"pixelRatio pxRatio px ratio pxratio pixelratio",width:"w width",height:"h height"},!0)).pixelRatio||(t.pixelRatio=window.pixelRatio||1),t.gl)return t.gl;var e;if(t.canvas&&(t.container=t.canvas.parentNode),t.container){if("string"==typeof t.container){var o=document.querySelector(t.container);if(!o)throw Error("Element "+t.container+" is not found");t.container=o}i(t.container)?(t.canvas=t.container,t.container=t.canvas.parentNode):t.canvas||(t.canvas=a(),t.container.appendChild(t.canvas),n(t))}else if(!t.canvas){if(!(typeof document<"u"))throw Error("Not DOM environment. Use headless-gl.");t.container=document.body||document.documentElement,t.canvas=a(),t.container.appendChild(t.canvas),n(t)}return t.gl||["webgl","experimental-webgl","webgl-experimental"].some((function(e){try{t.gl=t.canvas.getContext(e,t.attrs)}catch{}return t.gl})),t.gl}}}),$v=f({"node_modules/font-atlas/index.js"(t,e){var r=Wv(),n=[32,126];e.exports=function(t){var e=(t=t||{}).shape?t.shape:t.canvas?[t.canvas.width,t.canvas.height]:[512,512],i=t.canvas||document.createElement("canvas"),a=t.font,o="number"==typeof t.step?[t.step,t.step]:t.step||[32,32],s=t.chars||n;if(a&&"string"!=typeof a&&(a=r(a)),Array.isArray(s)){if(2===s.length&&"number"==typeof s[0]&&"number"==typeof s[1]){for(var l=[],c=s[0],u=0;c<=s[1];c++)l[u++]=String.fromCharCode(c);s=l}}else s=String(s).split("");e=e.slice(),i.width=e[0],i.height=e[1];var h=i.getContext("2d");h.fillStyle="#000",h.fillRect(0,0,i.width,i.height),h.font=a,h.textAlign="center",h.textBaseline="middle",h.fillStyle="#fff";var p=o[0]/2,f=o[1]/2;for(c=0;ce[0]-o[0]/2&&(p=o[0]/2,f+=o[1]);return i}}}),Kv=f({"node_modules/bit-twiddle/twiddle.js"(t){function e(t){var e=32;return(t&=-t)&&e--,65535&t&&(e-=16),16711935&t&&(e-=8),252645135&t&&(e-=4),858993459&t&&(e-=2),1431655765&t&&(e-=1),e}t.INT_BITS=32,t.INT_MAX=2147483647,t.INT_MIN=-1<<31,t.sign=function(t){return(t>0)-(t<0)},t.abs=function(t){var e=t>>31;return(t^e)-e},t.min=function(t,e){return e^(t^e)&-(t65535)<<4,e|=r=((t>>>=e)>255)<<3,e|=r=((t>>>=r)>15)<<2,(e|=r=((t>>>=r)>3)<<1)|(t>>>=r)>>1},t.log10=function(t){return t>=1e9?9:t>=1e8?8:t>=1e7?7:t>=1e6?6:t>=1e5?5:t>=1e4?4:t>=1e3?3:t>=100?2:t>=10?1:0},t.popCount=function(t){return 16843009*((t=(858993459&(t-=t>>>1&1431655765))+(t>>>2&858993459))+(t>>>4)&252645135)>>>24},t.countTrailingZeros=e,t.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,1+((t|=t>>>8)|t>>>16)},t.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)-(t>>>1)},t.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,27030>>>(t&=15)&1};var r=new Array(256);(function(t){for(var e=0;e<256;++e){var r=e,n=e,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;t[e]=n<>>8&255]<<16|r[t>>>16&255]<<8|r[t>>>24&255]},t.interleave2=function(t,e){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))<<1},t.deinterleave2=function(t,e){return(t=65535&((t=16711935&((t=252645135&((t=858993459&((t=t>>>e&1431655765)|t>>>1))|t>>>2))|t>>>4))|t>>>16))<<16>>16},t.interleave3=function(t,e,r){return t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2),(t|=(e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},t.deinterleave3=function(t,e){return(t=1023&((t=4278190335&((t=251719695&((t=3272356035&((t=t>>>e&1227133513)|t>>>2))|t>>>4))|t>>>8))|t>>>16))<<22>>22},t.nextCombination=function(t){var r=t|t-1;return r+1|(~r&-~r)-1>>>e(t)+1}}}),Jv=f({"node_modules/dup/dup.js"(t,e){function r(t,e,n){var i=0|t[n];if(i<=0)return[];var a,o=new Array(i);if(n===t.length-1)for(a=0;a"u"&&(e=0),typeof t){case"number":if(t>0)return function(t,e){var r,n;for(r=new Array(t),n=0;n0?n.pop():new ArrayBuffer(t)}function p(t){return new Uint8Array(h(t),0,t)}function f(t){return new Uint16Array(h(2*t),0,t)}function d(t){return new Uint32Array(h(4*t),0,t)}function m(t){return new Int8Array(h(t),0,t)}function g(t){return new Int16Array(h(2*t),0,t)}function y(t){return new Int32Array(h(4*t),0,t)}function v(t){return new Float32Array(h(4*t),0,t)}function x(t){return new Float64Array(h(8*t),0,t)}function _(t){return i?new Uint8ClampedArray(h(t),0,t):p(t)}function b(t){return a?new BigUint64Array(h(8*t),0,t):null}function w(t){return o?new BigInt64Array(h(8*t),0,t):null}function T(t){return new DataView(h(t),0,t)}function A(t){t=e.nextPow2(t);var r=e.log2(t),i=c[r];return i.length>0?i.pop():new n(t)}t.free=function(t){if(n.isBuffer(t))c[e.log2(t.length)].push(t);else{if("[object ArrayBuffer]"!==Object.prototype.toString.call(t)&&(t=t.buffer),!t)return;var r=t.length||t.byteLength,i=0|e.log2(r);l[i].push(t)}},t.freeUint8=t.freeUint16=t.freeUint32=t.freeBigUint64=t.freeInt8=t.freeInt16=t.freeInt32=t.freeBigInt64=t.freeFloat32=t.freeFloat=t.freeFloat64=t.freeDouble=t.freeUint8Clamped=t.freeDataView=function(t){u(t.buffer)},t.freeArrayBuffer=u,t.freeBuffer=function(t){c[e.log2(t.length)].push(t)},t.malloc=function(t,e){if(void 0===e||"arraybuffer"===e)return h(t);switch(e){case"uint8":return p(t);case"uint16":return f(t);case"uint32":return d(t);case"int8":return m(t);case"int16":return g(t);case"int32":return y(t);case"float":case"float32":return v(t);case"double":case"float64":return x(t);case"uint8_clamped":return _(t);case"bigint64":return w(t);case"biguint64":return b(t);case"buffer":return A(t);case"data":case"dataview":return T(t);default:return null}return null},t.mallocArrayBuffer=h,t.mallocUint8=p,t.mallocUint16=f,t.mallocUint32=d,t.mallocInt8=m,t.mallocInt16=g,t.mallocInt32=y,t.mallocFloat32=t.mallocFloat=v,t.mallocFloat64=t.mallocDouble=x,t.mallocUint8Clamped=_,t.mallocBigUint64=b,t.mallocBigInt64=w,t.mallocDataView=T,t.mallocBuffer=A,t.clearCache=function(){for(var t=0;t<32;++t)s.UINT8[t].length=0,s.UINT16[t].length=0,s.UINT32[t].length=0,s.INT8[t].length=0,s.INT16[t].length=0,s.INT32[t].length=0,s.FLOAT[t].length=0,s.DOUBLE[t].length=0,s.BIGUINT64[t].length=0,s.BIGINT64[t].length=0,s.UINT8C[t].length=0,l[t].length=0,c[t].length=0}}}),tx=f({"node_modules/is-plain-obj/index.js"(t,e){var r=Object.prototype.toString;e.exports=function(t){var e;return"[object Object]"===r.call(t)&&(null===(e=Object.getPrototypeOf(t))||e===Object.getPrototypeOf({}))}}}),ex=f({"node_modules/parse-unit/index.js"(t,e){e.exports=function(t,e){e||(e=[0,""]),t=String(t);var r=parseFloat(t,10);return e[0]=r,e[1]=t.match(/[\d.\-\+]*\s*(.*)/)[1]||"",e}}}),rx=f({"node_modules/to-px/topx.js"(t,e){var r=ex();function n(t,e){var n=r(getComputedStyle(t).getPropertyValue(e));return n[0]*i(n[1],t)}function i(t,e){switch(e=e||document.body,t=(t||"px").trim().toLowerCase(),(e===window||e===document)&&(e=document.body),t){case"%":return e.clientHeight/100;case"ch":case"ex":return function(t,e){var r=document.createElement("div");r.style["font-size"]="128"+t,e.appendChild(r);var i=n(r,"font-size")/128;return e.removeChild(r),i}(t,e);case"em":return n(e,"font-size");case"rem":return n(document.body,"font-size");case"vw":return window.innerWidth/100;case"vh":return window.innerHeight/100;case"vmin":return Math.min(window.innerWidth,window.innerHeight)/100;case"vmax":return Math.max(window.innerWidth,window.innerHeight)/100;case"in":return 96;case"cm":return 96/2.54;case"mm":return 96/25.4;case"pt":return 96/72;case"pc":return 16}return 1}e.exports=i}}),nx=f({"node_modules/detect-kerning/index.js"(t,e){e.exports=i;var r=(i.canvas=document.createElement("canvas")).getContext("2d"),n=a([32,126]);function i(t,e){Array.isArray(t)&&(t=t.join(", "));var i,o={},s=16,l=.05;e&&(2===e.length&&"number"==typeof e[0]?i=a(e):Array.isArray(e)?i=e:(e.o?i=a(e.o):e.pairs&&(i=e.pairs),e.fontSize&&(s=e.fontSize),null!=e.threshold&&(l=e.threshold))),i||(i=n),r.font=s+"px "+t;for(var c=0;cs*l){var f=(p-h)/s;o[u]=1e3*f}}return o}function a(t){for(var e=[],r=t[0];r<=t[1];r++)for(var n=String.fromCharCode(r),i=t[0];i0;n-=4)if(0!==r[n])return Math.floor(.25*(n-3)/e)}e.exports=r,r.canvas=document.createElement("canvas"),r.cache={}}}),ax=f({"node_modules/gl-text/dist.js"(t,e){var r=Zv(),n=Og(),i=Yv(),a=Xv(),o=Lv(),s=Od(),l=$v(),c=Qv(),u=Rg(),h=tx(),p=ex(),f=rx(),d=nx(),m=oy(),g=ix(),y=jg(),v=Kv().nextPow2,x=new o,_=!1;document.body&&((b=document.body.appendChild(document.createElement("div"))).style.font="italic small-caps bold condensed 16px/2 cursive",getComputedStyle(b).fontStretch&&(_=!0),document.body.removeChild(b));var b,w=function(t){var e;"function"==typeof(e=t)&&e._gl&&e.prop&&e.texture&&e.buffer?(t={regl:t},this.gl=t.regl._gl):this.gl=a(t),this.shader=x.get(this.gl),this.shader?this.regl=this.shader.regl:this.regl=t.regl||i({gl:this.gl}),this.charBuffer=this.regl.buffer({type:"uint8",usage:"stream"}),this.sizeBuffer=this.regl.buffer({type:"float",usage:"stream"}),this.shader||(this.shader=this.createShader(),x.set(this.gl,this.shader)),this.batch=[],this.fontSize=[],this.font=[],this.fontAtlas=[],this.draw=this.shader.draw.bind(this),this.render=function(){this.regl._refresh(),this.draw(this.batch)},this.canvas=this.gl.canvas,this.update(h(t)?t:{})};w.prototype.createShader=function(){var t=this.regl,e=t({blend:{enable:!0,color:[0,0,0,1],func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},stencil:{enable:!1},depth:{enable:!1},count:t.prop("count"),offset:t.prop("offset"),attributes:{charOffset:{offset:4,stride:8,buffer:t.this("sizeBuffer")},width:{offset:0,stride:8,buffer:t.this("sizeBuffer")},char:t.this("charBuffer"),position:t.this("position")},uniforms:{atlasSize:function(t,e){return[e.atlas.width,e.atlas.height]},atlasDim:function(t,e){return[e.atlas.cols,e.atlas.rows]},atlas:function(t,e){return e.atlas.texture},charStep:function(t,e){return e.atlas.step},em:function(t,e){return e.atlas.em},color:t.prop("color"),opacity:t.prop("opacity"),viewport:t.this("viewportArray"),scale:t.this("scale"),align:t.prop("align"),baseline:t.prop("baseline"),translate:t.this("translate"),positionOffset:t.prop("positionOffset")},primitive:"points",viewport:t.this("viewport"),vert:"\n\t\t\tprecision highp float;\n\t\t\tattribute float width, charOffset, char;\n\t\t\tattribute vec2 position;\n\t\t\tuniform float fontSize, charStep, em, align, baseline;\n\t\t\tuniform vec4 viewport;\n\t\t\tuniform vec4 color;\n\t\t\tuniform vec2 atlasSize, atlasDim, scale, translate, positionOffset;\n\t\t\tvarying vec2 charCoord, charId;\n\t\t\tvarying float charWidth;\n\t\t\tvarying vec4 fontColor;\n\t\t\tvoid main () {\n\t\t\t\tvec2 offset = floor(em * (vec2(align + charOffset, baseline)\n\t\t\t\t\t+ vec2(positionOffset.x, -positionOffset.y)))\n\t\t\t\t\t/ (viewport.zw * scale.xy);\n\n\t\t\t\tvec2 position = (position + translate) * scale;\n\t\t\t\tposition += offset * scale;\n\n\t\t\t\tcharCoord = position * viewport.zw + viewport.xy;\n\n\t\t\t\tgl_Position = vec4(position * 2. - 1., 0, 1);\n\n\t\t\t\tgl_PointSize = charStep;\n\n\t\t\t\tcharId.x = mod(char, atlasDim.x);\n\t\t\t\tcharId.y = floor(char / atlasDim.x);\n\n\t\t\t\tcharWidth = width * em;\n\n\t\t\t\tfontColor = color / 255.;\n\t\t\t}",frag:"\n\t\t\tprecision highp float;\n\t\t\tuniform float fontSize, charStep, opacity;\n\t\t\tuniform vec2 atlasSize;\n\t\t\tuniform vec4 viewport;\n\t\t\tuniform sampler2D atlas;\n\t\t\tvarying vec4 fontColor;\n\t\t\tvarying vec2 charCoord, charId;\n\t\t\tvarying float charWidth;\n\n\t\t\tfloat lightness(vec4 color) {\n\t\t\t\treturn color.r * 0.299 + color.g * 0.587 + color.b * 0.114;\n\t\t\t}\n\n\t\t\tvoid main () {\n\t\t\t\tvec2 uv = gl_FragCoord.xy - charCoord + charStep * .5;\n\t\t\t\tfloat halfCharStep = floor(charStep * .5 + .5);\n\n\t\t\t\t// invert y and shift by 1px (FF expecially needs that)\n\t\t\t\tuv.y = charStep - uv.y;\n\n\t\t\t\t// ignore points outside of character bounding box\n\t\t\t\tfloat halfCharWidth = ceil(charWidth * .5);\n\t\t\t\tif (floor(uv.x) > halfCharStep + halfCharWidth ||\n\t\t\t\t\tfloor(uv.x) < halfCharStep - halfCharWidth) return;\n\n\t\t\t\tuv += charId * charStep;\n\t\t\t\tuv = uv / atlasSize;\n\n\t\t\t\tvec4 color = fontColor;\n\t\t\t\tvec4 mask = texture2D(atlas, uv);\n\n\t\t\t\tfloat maskY = lightness(mask);\n\t\t\t\t// float colorY = lightness(color);\n\t\t\t\tcolor.a *= maskY;\n\t\t\t\tcolor.a *= opacity;\n\n\t\t\t\t// color.a += .1;\n\n\t\t\t\t// antialiasing, see yiq color space y-channel formula\n\t\t\t\t// color.rgb += (1. - color.rgb) * (1. - mask.rgb);\n\n\t\t\t\tgl_FragColor = color;\n\t\t\t}"});return{regl:t,draw:e,atlas:{}}},w.prototype.update=function(t){var e=this;if("string"==typeof t)t={text:t};else if(!t)return;null!=(t=n(t,{position:"position positions coord coords coordinates",font:"font fontFace fontface typeface cssFont css-font family fontFamily",fontSize:"fontSize fontsize size font-size",text:"text texts chars characters value values symbols",align:"align alignment textAlign textbaseline",baseline:"baseline textBaseline textbaseline",direction:"dir direction textDirection",color:"color colour fill fill-color fillColor textColor textcolor",kerning:"kerning kern",range:"range dataBox",viewport:"vp viewport viewBox viewbox viewPort",opacity:"opacity alpha transparency visible visibility opaque",offset:"offset positionOffset padding shift indent indentation"},!0)).opacity&&(Array.isArray(t.opacity)?this.opacity=t.opacity.map((function(t){return parseFloat(t)})):this.opacity=parseFloat(t.opacity)),null!=t.viewport&&(this.viewport=u(t.viewport),this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),null==this.viewport&&(this.viewport={x:0,y:0,width:this.gl.drawingBufferWidth,height:this.gl.drawingBufferHeight},this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),null!=t.kerning&&(this.kerning=t.kerning),null!=t.offset&&("number"==typeof t.offset&&(t.offset=[t.offset,0]),this.positionOffset=y(t.offset)),t.direction&&(this.direction=t.direction),t.range&&(this.range=t.range,this.scale=[1/(t.range[2]-t.range[0]),1/(t.range[3]-t.range[1])],this.translate=[-t.range[0],-t.range[1]]),t.scale&&(this.scale=t.scale),t.translate&&(this.translate=t.translate),this.scale||(this.scale=[1/this.viewport.width,1/this.viewport.height]),this.translate||(this.translate=[0,0]),!this.font.length&&!t.font&&(t.font=w.baseFontSize+"px sans-serif");var i,a=!1,o=!1;if(t.font&&(Array.isArray(t.font)?t.font:[t.font]).forEach((function(t,n){if("string"==typeof t)try{t=r.parse(t)}catch{t=r.parse(w.baseFontSize+"px "+t)}else{var i=t.style,s=t.weight,l=t.stretch,c=t.variant;t=r.parse(r.stringify(t)),i&&(t.style=i),s&&(t.weight=s),l&&(t.stretch=l),c&&(t.variant=c)}var u=r.stringify({size:w.baseFontSize,family:t.family,stretch:_?t.stretch:void 0,variant:t.variant,weight:t.weight,style:t.style}),h=p(t.size),d=Math.round(h[0]*f(h[1]));if(d!==e.fontSize[n]&&(o=!0,e.fontSize[n]=d),!(e.font[n]&&u==e.font[n].baseString||(a=!0,e.font[n]=w.fonts[u],e.font[n]))){var m=t.family.join(", "),y=[t.style];t.style!=t.variant&&y.push(t.variant),t.variant!=t.weight&&y.push(t.weight),_&&t.weight!=t.stretch&&y.push(t.stretch),e.font[n]={baseString:u,family:m,weight:t.weight,stretch:t.stretch,style:t.style,variant:t.variant,width:{},kerning:{},metrics:g(m,{origin:"top",fontSize:w.baseFontSize,fontStyle:y.join(" ")})},w.fonts[u]=e.font[n]}})),(a||o)&&this.font.forEach((function(n,i){var a=r.stringify({size:e.fontSize[i],family:n.family,stretch:_?n.stretch:void 0,variant:n.variant,weight:n.weight,style:n.style});if(e.fontAtlas[i]=e.shader.atlas[a],!e.fontAtlas[i]){var o=n.metrics;e.shader.atlas[a]=e.fontAtlas[i]={fontString:a,step:2*Math.ceil(e.fontSize[i]*o.bottom*.5),em:e.fontSize[i],cols:0,rows:0,height:0,width:0,chars:[],ids:{},texture:e.regl.texture()}}null==t.text&&(t.text=e.text)})),"string"==typeof t.text&&t.position&&t.position.length>2){for(var h=Array(.5*t.position.length),x=0;x2){for(var T=!t.position[0].length,A=c.mallocFloat(2*this.count),k=0,M=0;k1?e.align[r]:e.align[0]:e.align;if("number"==typeof n)return n;switch(n){case"right":case"end":return-t;case"center":case"centre":case"middle":return.5*-t}return 0}))),null==this.baseline&&null==t.baseline&&(t.baseline=0),null!=t.baseline&&(this.baseline=t.baseline,Array.isArray(this.baseline)||(this.baseline=[this.baseline]),this.baselineOffset=this.baseline.map((function(t,r){var n=(e.font[r]||e.font[0]).metrics,i=0;return i+=.5*n.bottom,-1*(i+="number"==typeof t?t-n.baseline:-n[t])}))),null!=t.color)if(t.color||(t.color="transparent"),"string"!=typeof t.color&&isNaN(t.color)){var H;if("number"==typeof t.color[0]&&t.color.length>this.counts.length){var G=t.color.length;H=c.mallocUint8(G);for(var W=(t.color.subarray||t.color.slice).bind(t.color),Z=0;Z4||this.baselineOffset.length>1||this.align&&this.align.length>1||this.fontAtlas.length>1||this.positionOffset.length>2){var $=Math.max(.5*this.position.length||0,.25*this.color.length||0,this.baselineOffset.length||0,this.alignOffset.length||0,this.font.length||0,this.opacity.length||0,.5*this.positionOffset.length||0);this.batch=Array($);for(var K=0;K1?this.counts[K]:this.counts[0],offset:this.textOffsets.length>1?this.textOffsets[K]:this.textOffsets[0],color:this.color?this.color.length<=4?this.color:this.color.subarray(4*K,4*K+4):[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[K]:this.opacity,baseline:null!=this.baselineOffset[K]?this.baselineOffset[K]:this.baselineOffset[0],align:this.align?null!=this.alignOffset[K]?this.alignOffset[K]:this.alignOffset[0]:0,atlas:this.fontAtlas[K]||this.fontAtlas[0],positionOffset:this.positionOffset.length>2?this.positionOffset.subarray(2*K,2*K+2):this.positionOffset}}else this.count?this.batch=[{count:this.count,offset:0,color:this.color||[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[0]:this.opacity,baseline:this.baselineOffset[0],align:this.alignOffset?this.alignOffset[0]:0,atlas:this.fontAtlas[0],positionOffset:this.positionOffset}]:this.batch=[]},w.prototype.destroy=function(){},w.prototype.kerning=!0,w.prototype.position={constant:new Float32Array(2)},w.prototype.translate=null,w.prototype.scale=null,w.prototype.font=null,w.prototype.text="",w.prototype.positionOffset=[0,0],w.prototype.opacity=1,w.prototype.color=new Uint8Array([0,0,0,255]),w.prototype.alignOffset=[0,0],w.maxAtlasSize=1024,w.atlasCanvas=document.createElement("canvas"),w.atlasContext=w.atlasCanvas.getContext("2d",{alpha:!1}),w.baseFontSize=64,w.fonts={},e.exports=w}}),ox=f({"src/lib/prepare_regl.js"(t,e){var r=Zd(),n=Yv();e.exports=function(t,e,i){var a=t._fullLayout,o=!0;return a._glcanvas.each((function(r){if(r.regl)r.regl.preloadCachedCode(i);else if(!r.pick||a._has("parcoords")){try{r.regl=n({canvas:this,attributes:{antialias:!r.pick,preserveDrawingBuffer:!0},pixelRatio:t._context.plotGlPixelRatio||window.devicePixelRatio,extensions:e||[],cachedCode:i||{}})}catch{o=!1}r.regl||(o=!1),o&&this.addEventListener("webglcontextlost",(function(e){t&&t.emit&&t.emit("plotly_webglcontextlost",{event:e,layer:r.key})}),!1)}})),o||r({container:a._glcontainer.node()}),o}}}),sx=f({"src/traces/scattergl/plot.js"(t,e){var r=hy(),n=zv(),i=Dv(),a=ax(),o=le(),s=Or().selectMode,l=ox(),c=Ye(),u=hi(),h=ry().styleTextSelection,p={};function f(t,e,r,n){var i=t._size,a=t.width*n,o=t.height*n,s=i.l*n,l=i.b*n,c=i.r*n,u=i.t*n,h=i.w*n,p=i.h*n;return[s+e.domain[0]*h,l+r.domain[0]*p,a-c-(1-e.domain[1])*h,o-u-(1-r.domain[1])*p]}(e.exports=function(t,e,d){if(d.length){var m,g,y=t._fullLayout,v=e._scene,x=e.xaxis,_=e.yaxis;if(v){if(!l(t,["ANGLE_instanced_arrays","OES_element_index_uint"],p))return void v.init();var b=v.count,w=y._glcanvas.data()[0].regl;if(u(t,e,d),v.dirty){if((v.line2d||v.error2d)&&!(v.scatter2d||v.fill2d||v.glText)&&w.clear({}),!0===v.error2d&&(v.error2d=i(w)),!0===v.line2d&&(v.line2d=n(w)),!0===v.scatter2d&&(v.scatter2d=r(w)),!0===v.fill2d&&(v.fill2d=n(w)),!0===v.glText)for(v.glText=new Array(b),m=0;mv.glText.length){var T=b-v.glText.length;for(m=0;mr&&(isNaN(e[n])||isNaN(e[n+1]));)n-=2;t.positions=e.slice(r,n+2)}return t})),v.line2d.update(v.lineOptions)),v.error2d){var k=(v.errorXOptions||[]).concat(v.errorYOptions||[]);v.error2d.update(k)}v.scatter2d&&v.scatter2d.update(v.markerOptions),v.fillOrder=o.repeat(null,b),v.fill2d&&(v.fillOptions=v.fillOptions.map((function(t,e){var r=d[e];if(t&&r&&r[0]&&r[0].trace){var n,i,a=r[0],o=a.trace,s=a.t,l=v.lineOptions[e],c=[];o._ownfill&&c.push(e),o._nexttrace&&c.push(e+1),c.length&&(v.fillOrder[e]=c);var u,h,p=[],f=l&&l.positions||s.positions;if("tozeroy"===o.fill){for(u=0;uu&&isNaN(f[h+1]);)h-=2;0!==f[u+1]&&(p=[f[u],0]),p=p.concat(f.slice(u,h+2)),0!==f[h+1]&&(p=p.concat([f[h],0]))}else if("tozerox"===o.fill){for(u=0;uu&&isNaN(f[h]);)h-=2;0!==f[u]&&(p=[0,f[u+1]]),p=p.concat(f.slice(u,h+2)),0!==f[h]&&(p=p.concat([0,f[h+1]]))}else if("toself"===o.fill||"tonext"===o.fill){for(p=[],n=0,t.splitNull=!0,i=0;i-1;for(m=0;ma&&l||ih?_.sizeAvg||Math.max(_.size,3):i(e,x),f=0;f2?(n=h[0],a=h[2],i=h[1],o=h[3]):h.length?(n=i=h[0],a=o=h[1]):(n=h.x,i=h.y,a=h.x+h.width,o=h.y+h.height),p.length>2?(s=p[0],c=p[2],l=p[1],u=p[3]):p.length?(s=l=p[0],c=u=p[1]):(s=p.x,l=p.y,c=p.x+p.width,u=p.y+p.height),[s,i,c,o]}function p(t){if("number"==typeof t)return[t,t,t,t];if(2===t.length)return[t[0],t[1],t[0],t[1]];{let e=s(t);return[e.x,e.y,e.x+e.width,e.y+e.height]}}e.exports=c,c.prototype.render=function(...t){return t.length&&this.update(...t),this.regl.attributes.preserveDrawingBuffer?this.draw():(this.dirty?null==this.planned&&(this.planned=a((()=>{this.draw(),this.dirty=!0,this.planned=null}))):(this.draw(),this.dirty=!0,a((()=>{this.dirty=!1}))),this)},c.prototype.update=function(...t){if(!t.length)return;for(let e=0;ee||!c.lower&&t{e[a+r]=n}))}this.scatter.draw(...e)}else this.scatter.draw();return this},c.prototype.destroy=function(){return this.traces.forEach((t=>{t.buffer&&t.buffer.destroy&&t.buffer.destroy()})),this.traces=null,this.passes=null,this.scatter.destroy(),this}}}),xx=f({"src/traces/splom/plot.js"(t,e){var r=vx(),n=le(),i=xe(),a=Or().selectMode;function o(t,e){var o,s,l,c,u,h=t._fullLayout,p=h._size,f=e.trace,d=e.t,m=h._splomScenes[f.uid],g=m.matrixOptions,y=g.cdata,v=h._glcanvas.data()[0].regl,x=h.dragmode;if(0!==y.length){g.lower=f.showupperhalf,g.upper=f.showlowerhalf,g.diagonal=f.diagonal.visible;var _=f._visibleDims,b=y.length,w=m.viewOpts={};for(w.ranges=new Array(b),w.domains=new Array(b),u=0;u<_.length;u++){l=_[u];var T=w.ranges[u]=new Array(4),A=w.domains[u]=new Array(4);(o=i.getFromId(t,f._diag[l][0]))&&(T[0]=o._rl[0],T[2]=o._rl[1],A[0]=o.domain[0],A[2]=o.domain[1]),(s=i.getFromId(t,f._diag[l][1]))&&(T[1]=s._rl[0],T[3]=s._rl[1],A[1]=s.domain[0],A[3]=s.domain[1])}var k=t._context.plotGlPixelRatio,M=p.l*k,S=p.b*k,E=p.w*k,C=p.h*k;w.viewport=[M,S,E+M,C+S],!0===m.matrix&&(m.matrix=r(v));var I=h.clickmode.indexOf("select")>-1,L=!0;if(a(x)||f.selectedpoints||I){var P=f._length;if(f.selectedpoints){m.selectBatch=f.selectedpoints;var z=f.selectedpoints,D={};for(l=0;l=e[r][0]&&t<=e[r][1])return!0;return!1}(r,n))return r;var i=t?-1:1,a=0,o=e.length-1;if(i<0){var s=a;a=o,o=s}for(var l=e[a],u=l,p=a;i*pe){p=n;break}}if(a=u,isNaN(a)&&(a=isNaN(h)||isNaN(p)?isNaN(h)?p:h:e-c[h][1]t[1]+n||e=.9*t[1]+.1*t[0]?"n":e<=.9*t[0]+.1*t[1]?"s":"ns"}(d,e);m&&(o.interval=l[a],o.intervalPix=d,o.region=m)}}if(t.ordinal&&!o.region){var y=t.unitTickvals,v=t.unitToPaddedPx.invert(e);for(n=0;n=x[0]&&v<=x[1]){o.clickableOrdinalRange=x;break}}}return o}function w(t,e){n.event.sourceEvent.stopPropagation();var i=e.height-n.mouse(t)[1]-2*r.verticalPadding,a=e.brush.svgBrush;a.wasDragged=!0,a._dragging=!0,a.grabbingBar?a.newExtent=[i-a.grabPoint,i+a.barLength-a.grabPoint].map(e.unitToPaddedPx.invert):a.newExtent=[a.startExtent,e.unitToPaddedPx.invert(i)].sort(o),e.brush.filterSpecified=!0,a.extent=a.stayingIntervals.concat([a.newExtent]),a.brushCallback(e),_(t.parentNode)}function T(t,e){var i=b(e,e.height-n.mouse(t)[1]-2*r.verticalPadding),a="crosshair";i.clickableOrdinalRange?a="pointer":i.region&&(a=i.region+"-resize"),n.select(document.body).style("cursor",a)}function A(t){t.on("mousemove",(function(t){n.event.preventDefault(),t.parent.inBrushDrag||T(this,t)})).on("mouseleave",(function(t){t.parent.inBrushDrag||y()})).call(n.behavior.drag().on("dragstart",(function(t){!function(t,e){n.event.sourceEvent.stopPropagation();var i=e.height-n.mouse(t)[1]-2*r.verticalPadding,a=e.unitToPaddedPx.invert(i),o=e.brush,s=b(e,i),l=s.interval,c=o.svgBrush;if(c.wasDragged=!1,c.grabbingBar="ns"===s.region,c.grabbingBar){var u=l.map(e.unitToPaddedPx);c.grabPoint=i-u[0]-r.verticalPadding,c.barLength=u[1]-u[0]}c.clickableOrdinalRange=s.clickableOrdinalRange,c.stayingIntervals=e.multiselect&&o.filterSpecified?o.filter.getConsolidated():[],l&&(c.stayingIntervals=c.stayingIntervals.filter((function(t){return t[0]!==l[0]&&t[1]!==l[1]}))),c.startExtent=s.region?l["s"===s.region?1:0]:a,e.parent.inBrushDrag=!0,c.brushStartCallback()}(this,t)})).on("drag",(function(t){w(this,t)})).on("dragend",(function(t){!function(t,e){var r=e.brush,i=r.filter,a=r.svgBrush;a._dragging||(T(t,e),w(t,e),e.brush.svgBrush.wasDragged=!1),a._dragging=!1,n.event.sourceEvent.stopPropagation();var o=a.grabbingBar;if(a.grabbingBar=!1,a.grabLocation=void 0,e.parent.inBrushDrag=!1,y(),!a.wasDragged)return a.wasDragged=void 0,a.clickableOrdinalRange?r.filterSpecified&&e.multiselect?a.extent.push(a.clickableOrdinalRange):(a.extent=[a.clickableOrdinalRange],r.filterSpecified=!0):o?(a.extent=a.stayingIntervals,0===a.extent.length&&M(r)):M(r),a.brushCallback(e),_(t.parentNode),void a.brushEndCallback(r.filterSpecified?i.getConsolidated():[]);var s=function(){i.set(i.getConsolidated())};if(e.ordinal){var l=e.unitTickvals;l[l.length-1]a.newExtent[0];a.extent=a.stayingIntervals.concat(c?[a.newExtent]:[]),a.extent.length||M(r),a.brushCallback(e),c?_(t.parentNode,s):(s(),_(t.parentNode))}else s();a.brushEndCallback(r.filterSpecified?i.getConsolidated():[])}(this,t)})))}function k(t,e){return t[0]-e[0]}function M(t){t.filterSpecified=!1,t.svgBrush.extent=[[-1/0,1/0]]}function S(t){return function(e){var r=e.brush,n=function(t){return t.svgBrush.extent.map((function(t){return t.slice()}))}(r),i=n.slice();r.filter.set(i),t()}}function E(t){for(var e,r=t.slice(),n=[],i=r.shift();i;){for(e=i.slice();(i=r.shift())&&i[0]<=e[1];)e[1]=Math.max(e[1],i[1]);n.push(e)}return 1===n.length&&n[0][0]>n[0][1]&&(n=[]),n}e.exports={makeBrush:function(t,e,r,n,i,a){var s=function(){var t,e,r=[];return{set:function(n){1===(r=n.map((function(t){return t.slice().sort(o)})).sort(k)).length&&r[0][0]===-1/0&&r[0][1]===1/0&&(r=[[0,-1]]),t=E(r),e=r.reduce((function(t,e){return[Math.min(t[0],e[0]),Math.max(t[1],e[1])]}),[1/0,-1/0])},get:function(){return r.slice()},getConsolidated:function(){return t},getBounds:function(){return e}}}();return s.set(r),{filter:s,filterSpecified:e,svgBrush:{extent:[],brushStartCallback:n,brushCallback:S(i),brushEndCallback:a}}},ensureAxisBrush:function(t,e,n){var o=t.selectAll("."+r.cn.axisBrush).data(a,i);o.enter().append("g").classed(r.cn.axisBrush,!0),function(t,e,n){var i=n._context.staticPlot,o=t.selectAll(".background").data(a);o.enter().append("rect").classed("background",!0).call(f).call(d).style("pointer-events",i?"none":"auto").attr("transform",s(0,r.verticalPadding)),o.call(A).attr("height",(function(t){return t.height-r.verticalPadding}));var l=t.selectAll(".highlight-shadow").data(a);l.enter().append("line").classed("highlight-shadow",!0).attr("x",-r.bar.width/2).attr("stroke-width",r.bar.width+r.bar.strokeWidth).attr("stroke",e).attr("opacity",r.bar.strokeOpacity).attr("stroke-linecap","butt"),l.attr("y1",(function(t){return t.height})).call(v);var c=t.selectAll(".highlight").data(a);c.enter().append("line").classed("highlight",!0).attr("x",-r.bar.width/2).attr("stroke-width",r.bar.width-r.bar.strokeWidth).attr("stroke",r.bar.fillColor).attr("opacity",r.bar.fillOpacity).attr("stroke-linecap","butt"),c.attr("y1",(function(t){return t.height})).call(v)}(o,e,n)},cleanRanges:function(t,e){if(Array.isArray(t[0])?(t=t.map((function(t){return t.sort(o)})),t=e.multiselect?E(t.sort(k)):[t[0]]):t=[t.sort(o)],e.tickvals){var r=e.tickvals.slice().sort(o);if(!(t=t.map((function(t){var e=[p(0,r,t[0],[]),p(1,r,t[1],[])];if(e[1]>e[0])return e})).filter((function(t){return t}))).length)return}return t.length>1?t:t[0]}}}}),Px=f({"src/traces/parcoords/defaults.js"(t,e){var r=le(),n=Ee().hasColorscale,i=qe(),a=Aa().defaults,o=je(),s=ir(),l=Ex(),c=Lx(),u=Cx().maxDimensionCount,h=hx();function p(t,e,n,i){function a(n,i){return r.coerce(t,e,l.dimensions,n,i)}var o=a("values"),u=a("visible");if(o&&o.length||(u=e.visible=!1),u){a("label"),a("tickvals"),a("ticktext"),a("tickformat");var h=a("range");e._ax={_id:"y",type:"linear",showexponent:"all",exponentformat:"B",range:h},s.setConvert(e._ax,i.layout),a("multiselect");var p=a("constraintrange");p&&(e.constraintrange=c.cleanRanges(p,e))}}e.exports=function(t,e,s,c){function f(n,i){return r.coerce(t,e,l,n,i)}var d=t.dimensions;Array.isArray(d)&&d.length>u&&(r.log("parcoords traces support up to "+u+" dimensions at the moment"),d.splice(u));var m=o(t,e,{name:"dimensions",layout:c,handleItemDefaults:p}),g=function(t,e,a,o,s){var l=s("line.color",a);if(n(t,"line")&&r.isArrayOrTypedArray(l)){if(l.length)return s("line.colorscale"),i(t,e,o,s,{prefix:"line.",cLetter:"c"}),l.length;e.line.color=a}return 1/0}(t,e,s,c,f);a(e,c,f),(!Array.isArray(m)||!m.length)&&(e.visible=!1),h(e,m,"values",g);var y=r.extendFlat({},c.font,{size:Math.round(c.font.size/1.2)});r.coerceFont(f,"labelfont",y),r.coerceFont(f,"tickfont",y,{autoShadowDflt:!0}),r.coerceFont(f,"rangefont",y),f("labelangle"),f("labelside"),f("unselected.line.color"),f("unselected.line.opacity")}}}),zx=f({"src/traces/parcoords/calc.js"(t,e){var r=le().isArrayOrTypedArray,n=Ze(),i=Ix().wrap;e.exports=function(t,e){var a,o;return n.hasColorscale(e,"line")&&r(e.line.color)?(a=e.line.color,o=n.extractOpts(e.line).colorscale,n.calc(t,e,{vals:a,containerStr:"line",cLetter:"c"})):(a=function(t){for(var e=new Array(t),r=0;r>>16,(65280&t)>>>8,255&t],alpha:1};if("number"==typeof t)return{space:"rgb",values:[t>>>16,(65280&t)>>>8,255&t],alpha:1};if(t=String(t).toLowerCase(),Ox.default[t])a=Ox.default[t].slice(),i="rgb";else if("transparent"===t)o=0,i="rgb",a=[0,0,0];else if("#"===t[0]){var s=t.slice(1),l=s.length;o=1,l<=4?(a=[parseInt(s[0]+s[0],16),parseInt(s[1]+s[1],16),parseInt(s[2]+s[2],16)],4===l&&(o=parseInt(s[3]+s[3],16)/255)):(a=[parseInt(s[0]+s[1],16),parseInt(s[2]+s[3],16),parseInt(s[4]+s[5],16)],8===l&&(o=parseInt(s[6]+s[7],16)/255)),a[0]||(a[0]=0),a[1]||(a[1]=0),a[2]||(a[2]=0),i="rgb"}else if(n=/^((?:rgba?|hs[lvb]a?|hwba?|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms|oklch|oklab|color))\s*\(([^\)]*)\)/.exec(t)){var c=n[1],u="cmyk"===(i=c.replace(/a$/,""))?4:"gray"===i?1:3;a=n[2].trim().split(/\s*[,\/]\s*|\s+/),"color"===i&&(i=a.shift()),o=(a=a.map((function(t,e){if("%"===t[t.length-1])return t=parseFloat(t)/100,3===e?t:"rgb"===i?255*t:"h"===i[0]||"l"===i[0]&&!e?100*t:"lab"===i?125*t:"lch"===i?e<2?150*t:360*t:"o"!==i[0]||e?"oklab"===i?.4*t:"oklch"===i?e<2?.4*t:360*t:t:t;if("h"===i[e]||2===e&&"h"===i[i.length-1]){if(void 0!==Fx[t])return Fx[t];if(t.endsWith("deg"))return parseFloat(t);if(t.endsWith("turn"))return 360*parseFloat(t);if(t.endsWith("grad"))return 360*parseFloat(t)/400;if(t.endsWith("rad"))return 180*parseFloat(t)/Math.PI}return"none"===t?0:parseFloat(t)}))).length>u?a.pop():1}else/[0-9](?:\s|\/|,)/.test(t)&&(a=t.match(/([0-9]+)/g).map((function(t){return parseFloat(t)})),i=(null==(r=null==(e=t.match(/([a-z])/gi))?void 0:e.join(""))?void 0:r.toLowerCase())||"rgb");return{space:i,values:a,alpha:o}}var Ox,Rx,Fx,Bx,jx,Nx=p({"node_modules/color-parse/index.js"(){var r,n;n=null!=(r=Id())?t(s(r)):{},Ox=m(e(n,"default",{value:r,enumerable:!0}),r),Rx=Dx,Fx={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}}),Ux=p({"node_modules/color-space/rgb.js"(){Bx={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}}}),Vx=p({"node_modules/color-space/hsl.js"(){Ux(),jx={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(t){var e,r,n,i,a,o=t[0]/360,s=t[1]/100,l=t[2]/100,c=0;if(0===s)return[a=255*l,a,a];for(e=2*l-(r=l<.5?l*(1+s):l+s-l*s),i=[0,0,0];c<3;)(n=o+1/3*-(c-1))<0?n++:n>1&&n--,a=6*n<1?e+6*(r-e)*n:2*n<1?r:3*n<2?e+(r-e)*(2/3-n)*6:e,i[c++]=255*a;return i}},Bx.hsl=function(t){var e,r,n=t[0]/255,i=t[1]/255,a=t[2]/255,o=Math.min(n,i,a),s=Math.max(n,i,a),l=s-o;return s===o?e=0:n===s?e=(i-a)/l:i===s?e=2+(a-n)/l:a===s&&(e=4+(n-i)/l),(e=Math.min(60*e,360))<0&&(e+=360),r=(o+s)/2,[e,100*(s===o?0:r<=.5?l/(s+o):l/(2-s-o)),100*r]}}}),qx={};function Hx(t){Array.isArray(t)&&t.raw&&(t=String.raw(...arguments)),t instanceof Number&&(t=+t);var e,r=Rx(t);if(!r.space)return[];let n="h"===r.space[0]?jx.min:Bx.min,i="h"===r.space[0]?jx.max:Bx.max;return(e=Array(3))[0]=Math.min(Math.max(r.values[0],n[0]),i[0]),e[1]=Math.min(Math.max(r.values[1],n[1]),i[1]),e[2]=Math.min(Math.max(r.values[2],n[2]),i[2]),"h"===r.space[0]&&(e=jx.rgb(e)),e.push(Math.min(Math.max(r.alpha,0),1)),e}d(qx,{default:()=>Hx});var Gx=p({"node_modules/color-rgba/index.js"(){Nx(),Ux(),Vx()}}),Wx=f({"src/traces/parcoords/helpers.js"(t){var e=le().isTypedArray;t.convertTypedArray=function(t){return e(t)?Array.prototype.slice.call(t):t},t.isOrdinal=function(t){return!!t.tickvals},t.isVisible=function(t){return t.visible||!("visible"in t)}}}),Zx=f({"src/traces/parcoords/lines.js"(t,e){var r=["precision highp float;","","varying vec4 fragColor;","","attribute vec4 p01_04, p05_08, p09_12, p13_16,"," p17_20, p21_24, p25_28, p29_32,"," p33_36, p37_40, p41_44, p45_48,"," p49_52, p53_56, p57_60, colors;","","uniform mat4 dim0A, dim1A, dim0B, dim1B, dim0C, dim1C, dim0D, dim1D,"," loA, hiA, loB, hiB, loC, hiC, loD, hiD;","","uniform vec2 resolution, viewBoxPos, viewBoxSize;","uniform float maskHeight;","uniform float drwLayer; // 0: context, 1: focus, 2: pick","uniform vec4 contextColor;","uniform sampler2D maskTexture, palette;","","bool isPick = (drwLayer > 1.5);","bool isContext = (drwLayer < 0.5);","","const vec4 ZEROS = vec4(0.0, 0.0, 0.0, 0.0);","const vec4 UNITS = vec4(1.0, 1.0, 1.0, 1.0);","","float val(mat4 p, mat4 v) {"," return dot(matrixCompMult(p, v) * UNITS, UNITS);","}","","float axisY(float ratio, mat4 A, mat4 B, mat4 C, mat4 D) {"," float y1 = val(A, dim0A) + val(B, dim0B) + val(C, dim0C) + val(D, dim0D);"," float y2 = val(A, dim1A) + val(B, dim1B) + val(C, dim1C) + val(D, dim1D);"," return y1 * (1.0 - ratio) + y2 * ratio;","}","","int iMod(int a, int b) {"," return a - b * (a / b);","}","","bool fOutside(float p, float lo, float hi) {"," return (lo < hi) && (lo > p || p > hi);","}","","bool vOutside(vec4 p, vec4 lo, vec4 hi) {"," return ("," fOutside(p[0], lo[0], hi[0]) ||"," fOutside(p[1], lo[1], hi[1]) ||"," fOutside(p[2], lo[2], hi[2]) ||"," fOutside(p[3], lo[3], hi[3])"," );","}","","bool mOutside(mat4 p, mat4 lo, mat4 hi) {"," return ("," vOutside(p[0], lo[0], hi[0]) ||"," vOutside(p[1], lo[1], hi[1]) ||"," vOutside(p[2], lo[2], hi[2]) ||"," vOutside(p[3], lo[3], hi[3])"," );","}","","bool outsideBoundingBox(mat4 A, mat4 B, mat4 C, mat4 D) {"," return mOutside(A, loA, hiA) ||"," mOutside(B, loB, hiB) ||"," mOutside(C, loC, hiC) ||"," mOutside(D, loD, hiD);","}","","bool outsideRasterMask(mat4 A, mat4 B, mat4 C, mat4 D) {"," mat4 pnts[4];"," pnts[0] = A;"," pnts[1] = B;"," pnts[2] = C;"," pnts[3] = D;",""," for(int i = 0; i < 4; ++i) {"," for(int j = 0; j < 4; ++j) {"," for(int k = 0; k < 4; ++k) {"," if(0 == iMod("," int(255.0 * texture2D(maskTexture,"," vec2("," (float(i * 2 + j / 2) + 0.5) / 8.0,"," (pnts[i][j][k] * (maskHeight - 1.0) + 1.0) / maskHeight"," ))[3]"," ) / int(pow(2.0, float(iMod(j * 4 + k, 8)))),"," 2"," )) return true;"," }"," }"," }"," return false;","}","","vec4 position(bool isContext, float v, mat4 A, mat4 B, mat4 C, mat4 D) {"," float x = 0.5 * sign(v) + 0.5;"," float y = axisY(x, A, B, C, D);"," float z = 1.0 - abs(v);",""," z += isContext ? 0.0 : 2.0 * float("," outsideBoundingBox(A, B, C, D) ||"," outsideRasterMask(A, B, C, D)"," );",""," return vec4("," 2.0 * (vec2(x, y) * viewBoxSize + viewBoxPos) / resolution - 1.0,"," z,"," 1.0"," );","}","","void main() {"," mat4 A = mat4(p01_04, p05_08, p09_12, p13_16);"," mat4 B = mat4(p17_20, p21_24, p25_28, p29_32);"," mat4 C = mat4(p33_36, p37_40, p41_44, p45_48);"," mat4 D = mat4(p49_52, p53_56, p57_60, ZEROS);",""," float v = colors[3];",""," gl_Position = position(isContext, v, A, B, C, D);",""," fragColor ="," isContext ? vec4(contextColor) :"," isPick ? vec4(colors.rgb, 1.0) : texture2D(palette, vec2(abs(v), 0.5));","}"].join("\n"),n=["precision highp float;","","varying vec4 fragColor;","","void main() {"," gl_FragColor = fragColor;","}"].join("\n"),i=Cx().maxDimensionCount,a=le(),o=1e-6,s=2048,l=new Uint8Array(4),c=new Uint8Array(4),u={shape:[256,1],format:"rgba",type:"uint8",mag:"nearest",min:"nearest"};function h(t,e,r,n,i){var a=t._gl;a.enable(a.SCISSOR_TEST),a.scissor(e,r,n,i),t.clear({color:[0,0,0,0],depth:1})}function p(t,e,r,n,i,a){var o=a.key;r.drawCompleted||(function(t){t.read({x:0,y:0,width:1,height:1,data:l})}(t),r.drawCompleted=!0),function s(l){var c=Math.min(n,i-l*n);0===l&&(window.cancelAnimationFrame(r.currentRafs[o]),delete r.currentRafs[o],h(t,a.scissorX,a.scissorY,a.scissorWidth,a.viewBoxSize[1])),!r.clearOnly&&(a.count=2*c,a.offset=2*l*n,e(a),l*n+c>>8*e)%256/255}function g(t,e,r){for(var n=new Array(8*e),i=0,a=0;au&&(u=t[n].dim1.canvasX,a=n);0===l&&h(k,0,0,o.canvasWidth,o.canvasHeight);var f=function(t){var e,r,n,i=[[],[]];for(n=0;n<64;n++){var a=!t&&ns._length&&(M=M.slice(0,s._length));var C,L=s.tickvals;function P(t,e){return{val:t,text:C[e]}}function z(t,e){return t.val-e.val}if(i(L)&&L.length){n.isTypedArray(L)&&(L=Array.from(L)),C=s.ticktext,i(C)&&C.length?C.length>L.length?C=C.slice(0,L.length):L.length>C.length&&(L=L.slice(0,C.length)):C=L.map(a(s.tickformat));for(var D=1;D=n||l>=i)return;var c=t.lineLayer.readPixel(s,i-1-l),u=0!==c[3],h=u?c[2]+256*(c[1]+256*c[0]):null,p={x:s,y:l,clientX:e.clientX,clientY:e.clientY,dataIndex:t.model.key,curveNumber:h};h!==C&&(u?a.hover(p):a.unhover&&a.unhover(p),C=h)}})),E.style("opacity",(function(t){return t.pick?0:1})),f.style("background","rgba(255, 255, 255, 0)");var B=f.selectAll("."+_.cn.parcoords).data(S,d);B.exit().remove(),B.enter().append("g").classed(_.cn.parcoords,!0).style("shape-rendering","crispEdges").style("pointer-events","none"),B.attr("transform",(function(t){return c(t.model.translateX,t.model.translateY)}));var j=B.selectAll("."+_.cn.parcoordsControlView).data(m,d);j.enter().append("g").classed(_.cn.parcoordsControlView,!0),j.attr("transform",(function(t){return c(t.model.pad.l,t.model.pad.t)}));var N=j.selectAll("."+_.cn.yAxis).data((function(t){return t.dimensions}),d);N.enter().append("g").classed(_.cn.yAxis,!0),j.each((function(t){O(N,t,x)})),E.each((function(t){if(t.viewModel){!t.lineLayer||a?t.lineLayer=w(this,t):t.lineLayer.update(t),(t.key||0===t.key)&&(t.viewModel[t.key]=t.lineLayer);var e=!t.context||a;t.lineLayer.render(t.viewModel.panels,e)}})),N.attr("transform",(function(t){return c(t.xScale(t.xIndex),0)})),N.call(r.behavior.drag().origin((function(t){return t})).on("drag",(function(t){var e=t.parent;k.linePickActive(!1),t.x=Math.max(-_.overdrag,Math.min(t.model.width+_.overdrag,r.event.x)),t.canvasX=t.x*t.model.canvasPixelRatio,N.sort((function(t,e){return t.x-e.x})).each((function(e,r){e.xIndex=r,e.x=t===e?e.x:e.xScale(e.xIndex),e.canvasX=e.x*e.model.canvasPixelRatio})),O(N,e,x),N.filter((function(e){return 0!==Math.abs(t.xIndex-e.xIndex)})).attr("transform",(function(t){return c(t.xScale(t.xIndex),0)})),r.select(this).attr("transform",c(t.x,0)),N.each((function(r,n,i){i===t.parent.key&&(e.dimensions[n]=r)})),e.contextLayer&&e.contextLayer.render(e.panels,!1,!I(e)),e.focusLayer.render&&e.focusLayer.render(e.panels)})).on("dragend",(function(t){var e=t.parent;t.x=t.xScale(t.xIndex),t.canvasX=t.x*t.model.canvasPixelRatio,O(N,e,x),r.select(this).attr("transform",(function(t){return c(t.x,0)})),e.contextLayer&&e.contextLayer.render(e.panels,!1,!I(e)),e.focusLayer&&e.focusLayer.render(e.panels),e.pickLayer&&e.pickLayer.render(e.panels,!0),k.linePickActive(!0),a&&a.axesMoved&&a.axesMoved(e.key,e.dimensions.map((function(t){return t.crossfilterDimensionIndex})))}))),N.exit().remove();var U=N.selectAll("."+_.cn.axisOverlays).data(m,d);U.enter().append("g").classed(_.cn.axisOverlays,!0),U.selectAll("."+_.cn.axis).remove();var V=U.selectAll("."+_.cn.axis).data(m,d);V.enter().append("g").classed(_.cn.axis,!0),V.each((function(t){var e=t.model.height/t.model.tickDistance,n=t.domainScale,i=n.domain();r.select(this).call(r.svg.axis().orient("left").tickSize(4).outerTickSize(2).ticks(e,t.tickFormat).tickValues(t.ordinal?i:null).tickFormat((function(e){return v.isOrdinal(t)?e:R(t.model.dimensions[t.visibleIndex],e)})).scale(n)),h.font(V.selectAll("text"),t.model.tickFont)})),V.selectAll(".domain, .tick>line").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),V.selectAll("text").style("cursor","default");var q=U.selectAll("."+_.cn.axisHeading).data(m,d);q.enter().append("g").classed(_.cn.axisHeading,!0);var H=q.selectAll("."+_.cn.axisTitle).data(m,d);H.enter().append("text").classed(_.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("pointer-events",o?"none":"auto"),H.text((function(t){return t.label})).each((function(e){var n=r.select(this);h.font(n,e.model.labelFont),u.convertToTspans(n,t)})).attr("transform",(function(t){var e=D(t.model.labelAngle,t.model.labelSide),r=_.axisTitleOffset;return(e.dir>0?"":c(0,2*r+t.model.height))+l(e.degrees)+c(-r*e.dx,-r*e.dy)})).attr("text-anchor",(function(t){var e=D(t.model.labelAngle,t.model.labelSide);return 2*Math.abs(e.dx)>Math.abs(e.dy)?e.dir*e.dx<0?"start":"end":"middle"}));var G=U.selectAll("."+_.cn.axisExtent).data(m,d);G.enter().append("g").classed(_.cn.axisExtent,!0);var W=G.selectAll("."+_.cn.axisExtentTop).data(m,d);W.enter().append("g").classed(_.cn.axisExtentTop,!0),W.attr("transform",c(0,-_.axisExtentOffset));var Z=W.selectAll("."+_.cn.axisExtentTopText).data(m,d);Z.enter().append("text").classed(_.cn.axisExtentTopText,!0).call(z),Z.text((function(t){return F(t,!0)})).each((function(t){h.font(r.select(this),t.model.rangeFont)}));var Y=G.selectAll("."+_.cn.axisExtentBottom).data(m,d);Y.enter().append("g").classed(_.cn.axisExtentBottom,!0),Y.attr("transform",(function(t){return c(0,t.model.height+_.axisExtentOffset)}));var X=Y.selectAll("."+_.cn.axisExtentBottomText).data(m,d);X.enter().append("text").classed(_.cn.axisExtentBottomText,!0).attr("dy","0.75em").call(z),X.text((function(t){return F(t,!1)})).each((function(t){h.font(r.select(this),t.model.rangeFont)})),b.ensureAxisBrush(U,T,t)}}}),Xx=f({"src/traces/parcoords/plot.js"(t,e){var r=Yx(),n=ox(),i=Wx().isVisible,a={};function o(t,e,r){var n=e.indexOf(r),i=t.indexOf(n);return-1===i&&(i+=e.length),i}(e.exports=function(t,e){var s=t._fullLayout;if(n(t,[],a)){var l={},c={},u={},h={},p=s._size;e.forEach((function(e,r){var n=e[0].trace;u[r]=n.index;var i=h[r]=n.index;l[r]=t.data[i].dimensions,c[r]=t.data[i].dimensions.slice()})),r(t,e,{width:p.w,height:p.h,margin:{t:p.t,r:p.r,b:p.b,l:p.l}},{filterChanged:function(e,r,n){var i=c[e][r],a=n.map((function(t){return t.slice()})),o="dimensions["+r+"].constraintrange",l=s._tracePreGUI[t._fullData[u[e]]._fullInput.uid];if(void 0===l[o]){var p=i.constraintrange;l[o]=p||null}var f=t._fullData[u[e]].dimensions[r];a.length?(1===a.length&&(a=a[0]),i.constraintrange=a,f.constraintrange=a.slice(),a=[a]):(delete i.constraintrange,delete f.constraintrange,a=null);var d={};d[o]=a,t.emit("plotly_restyle",[d,[h[e]]])},hover:function(e){t.emit("plotly_hover",e)},unhover:function(e){t.emit("plotly_unhover",e)},axesMoved:function(e,r){var n=function(t,e){return function(r,n){return o(t,e,r)-o(t,e,n)}}(r,c[e].filter(i));l[e].sort(n),c[e].filter((function(t){return!i(t)})).sort((function(t){return c[e].indexOf(t)})).forEach((function(t){l[e].splice(l[e].indexOf(t),1),l[e].splice(c[e].indexOf(t),0,t)})),t.emit("plotly_restyle",[{dimensions:[l[e]]},[h[e]]])}})}}).reglPrecompiled=a}}),$x=f({"src/traces/parcoords/base_plot.js"(t){var e=x(),r=we().getModuleCalcData,n=Xx(),i=ke();t.name="parcoords",t.plot=function(t){var e=r(t.calcdata,"parcoords")[0];e.length&&n(t,e)},t.clean=function(t,e,r,n){var i=n._has&&n._has("parcoords"),a=e._has&&e._has("parcoords");i&&!a&&(n._paperdiv.selectAll(".parcoords").remove(),n._glimages.selectAll("*").remove())},t.toSVG=function(t){var r=t._fullLayout._glimages,n=e.select(t).selectAll(".svg-container");n.filter((function(t,e){return e===n.size()-1})).selectAll(".gl-canvas-context, .gl-canvas-focus").each((function(){var t=this,e=t.toDataURL("image/png");r.append("svg:image").attr({xmlns:i.svg,"xlink:href":e,preserveAspectRatio:"none",x:0,y:0,width:t.style.width,height:t.style.height})})),window.setTimeout((function(){e.selectAll("#filterBarPattern").attr("id","filterBarPattern")}),60)}}}),Kx=f({"src/traces/parcoords/base_index.js"(t,e){e.exports={attributes:Ex(),supplyDefaults:Px(),calc:zx(),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcoords",basePlotModule:$x(),categories:["gl","regl","noOpacity","noHover"],meta:{}}}}),Jx=f({"src/traces/parcoords/index.js"(t,e){var r=Kx();r.plot=Xx(),e.exports=r}}),Qx=f({"lib/parcoords.js"(t,e){e.exports=Jx()}}),t_=f({"src/traces/parcats/attributes.js"(t,e){var r=R().extendFlat,n=U(),i=F(),a=Pe(),o=Ot().hovertemplateAttrs,s=Aa().attributes,l=r({editType:"calc"},a("line",{editTypeOverride:"calc"}),{shape:{valType:"enumerated",values:["linear","hspline"],dflt:"linear",editType:"plot"},hovertemplate:o({editType:"plot",arrayOk:!1},{keys:["count","probability"]})});e.exports={domain:s({name:"parcats",trace:!0,editType:"calc"}),hoverinfo:r({},n.hoverinfo,{flags:["count","probability"],editType:"plot",arrayOk:!1}),hoveron:{valType:"enumerated",values:["category","color","dimension"],dflt:"category",editType:"plot"},hovertemplate:o({editType:"plot",arrayOk:!1},{keys:["count","probability","category","categorycount","colorcount","bandcolorcount"]}),arrangement:{valType:"enumerated",values:["perpendicular","freeform","fixed"],dflt:"perpendicular",editType:"plot"},bundlecolors:{valType:"boolean",dflt:!0,editType:"plot"},sortpaths:{valType:"enumerated",values:["forward","backward"],dflt:"forward",editType:"plot"},labelfont:i({editType:"calc"}),tickfont:i({autoShadowDflt:!0,editType:"calc"}),dimensions:{_isLinkedToArray:"dimension",label:{valType:"string",editType:"calc"},categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array"],dflt:"trace",editType:"calc"},categoryarray:{valType:"data_array",editType:"calc"},ticktext:{valType:"data_array",editType:"calc"},values:{valType:"data_array",dflt:[],editType:"calc"},displayindex:{valType:"integer",editType:"calc"},editType:"calc",visible:{valType:"boolean",dflt:!0,editType:"calc"}},line:l,counts:{valType:"number",min:0,dflt:1,arrayOk:!0,editType:"calc"},customdata:void 0,hoverlabel:void 0,ids:void 0,legend:void 0,legendgroup:void 0,legendrank:void 0,opacity:void 0,selectedpoints:void 0,showlegend:void 0}}}),e_=f({"src/traces/parcats/defaults.js"(t,e){var r=le(),n=Ee().hasColorscale,i=qe(),a=Aa().defaults,o=je(),s=t_(),l=hx(),c=E().isTypedArraySpec;function u(t,e){function n(n,i){return r.coerce(t,e,s.dimensions,n,i)}var i=n("values"),a=n("visible");if(i&&i.length||(a=e.visible=!1),a){n("label"),n("displayindex",e._index);var o,l=t.categoryarray,u=r.isArrayOrTypedArray(l)&&l.length>0||c(l);u&&(o="array");var h=n("categoryorder",o);"array"===h?(n("categoryarray"),n("ticktext")):(delete t.categoryarray,delete t.ticktext),!u&&"array"===h&&(e.categoryorder="trace")}}e.exports=function(t,e,c,h){function p(n,i){return r.coerce(t,e,s,n,i)}var f=o(t,e,{name:"dimensions",handleItemDefaults:u}),d=function(t,e,a,o,s){s("line.shape"),s("line.hovertemplate");var l=s("line.color",o.colorway[0]);if(n(t,"line")&&r.isArrayOrTypedArray(l)){if(l.length)return s("line.colorscale"),i(t,e,o,s,{prefix:"line.",cLetter:"c"}),l.length;e.line.color=a}return 1/0}(t,e,c,h,p);a(e,h,p),(!Array.isArray(f)||!f.length)&&(e.visible=!1),l(e,f,"values",d),p("hoveron"),p("hovertemplate"),p("arrangement"),p("bundlecolors"),p("sortpaths"),p("counts");var m=h.font;r.coerceFont(p,"labelfont",m,{overrideDflt:{size:Math.round(m.size)}}),r.coerceFont(p,"tickfont",m,{autoShadowDflt:!0,overrideDflt:{size:Math.round(m.size/1.2)}})}}}),r_=f({"src/traces/parcats/calc.js"(t,e){var r=Ix().wrap,n=Ee().hasColorscale,i=We(),a=ie(),o=Qe(),s=le(),l=A();function c(t,e,r,n){return{dimensionInd:t,categoryInd:e,categoryValue:r,displayInd:e,categoryLabel:n,valueInds:[],count:0,dragY:null}}function u(t,e,r){t.valueInds.push(e),t.count+=r}function h(t,e,r){return{categoryInds:t,color:e,rawColor:r,valueInds:[],count:0}}function p(t,e,r){t.valueInds.push(e),t.count+=r}e.exports=function(t,e){var f=s.filterVisible(e.dimensions);if(0===f.length)return[];var d,m,g,y=f.map((function(t){var e;if("trace"===t.categoryorder)e=null;else if("array"===t.categoryorder)e=t.categoryarray;else{e=a(t.values);for(var r=!0,n=0;n=t.length||void 0!==e[t[r]])return!1;e[t[r]]=!0}return!0}(r))for(e=0;ee.model.rawColor?1:t.model.rawColor"),C=r.mouse(h)[0];a.loneHover({trace:p,x:x-d.left+m.left,y:b-d.top+m.top,text:E,color:t.model.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:10,fontColor:w,idealAlign:C1&&p.displayInd===h.dimensions.length-1?(i=c.left,a="left"):(i=c.left+c.width,a="right");var m=u.model.count,g=u.model.categoryLabel,y=m/u.parcatsViewModel.model.count,v={countLabel:m,categoryLabel:g,probabilityLabel:y.toFixed(3)},x=[];-1!==u.parcatsViewModel.hoverinfoItems.indexOf("count")&&x.push(["Count:",v.countLabel].join(" ")),-1!==u.parcatsViewModel.hoverinfoItems.indexOf("probability")&&x.push(["P("+v.categoryLabel+"):",v.probabilityLabel].join(" "));var _=x.join("
");return{trace:f,x:o*(i-e.left),y:s*(d-e.top),text:_,color:"lightgray",borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:12,fontColor:"black",idealAlign:a,hovertemplate:f.hovertemplate,hovertemplateLabels:v,eventData:[{data:f._input,fullData:f,count:m,category:g,probability:y}]}}function I(t){if(!t.parcatsViewModel.dragDimension&&-1===t.parcatsViewModel.hoverinfoItems.indexOf("skip")){if(r.mouse(this)[1]<-1)return;var e,n=t.parcatsViewModel.graphDiv,i=n._fullLayout,s=i._paperdiv.node().getBoundingClientRect(),l=t.parcatsViewModel.hoveron,u=this;"color"===l?(function(t){var e=r.select(t).datum(),n=M(e);T(n),n.each((function(){o.raiseToTop(this)})),r.select(t.parentNode).selectAll("rect.bandrect").filter((function(t){return t.color===e.color})).each((function(){o.raiseToTop(this),function(t){t.attr("stroke","black").attr("stroke-width",1.5)}(r.select(this))}))}(u),E(u,"plotly_hover",r.event)):(function(t){r.select(t.parentNode).selectAll("rect.bandrect").each((function(t){var e=M(t);T(e),e.each((function(){o.raiseToTop(this)}))})),function(t){t.select("rect.catrect").attr("stroke","black").attr("stroke-width",2.5)}(r.select(t.parentNode))}(u),S(u,"plotly_hover",r.event)),-1===t.parcatsViewModel.hoverinfoItems.indexOf("none")&&("category"===l?e=C(n,s,u):"color"===l?e=function(t,e,n){t._fullLayout._calcInverseTransform(t);var i,a,o=t._fullLayout._invScaleX,s=t._fullLayout._invScaleY,l=n.getBoundingClientRect(),u=r.select(n).datum(),h=u.categoryViewModel,p=h.parcatsViewModel,f=p.model.dimensions[h.model.dimensionInd],d=p.trace,m=l.y+l.height/2;p.dimensions.length>1&&f.displayInd===p.dimensions.length-1?(i=l.left,a="left"):(i=l.left+l.width,a="right");var g=h.model.categoryLabel,y=u.parcatsViewModel.model.count,v=0;u.categoryViewModel.bands.forEach((function(t){t.color===u.color&&(v+=t.count)}));var x=h.model.count,_=0;p.pathSelection.each((function(t){t.model.color===u.color&&(_+=t.model.count)}));var b=v/y,w=v/_,T=v/x,A={countLabel:v,categoryLabel:g,probabilityLabel:b.toFixed(3)},k=[];-1!==h.parcatsViewModel.hoverinfoItems.indexOf("count")&&k.push(["Count:",A.countLabel].join(" ")),-1!==h.parcatsViewModel.hoverinfoItems.indexOf("probability")&&(k.push("P(color ∩ "+g+"): "+A.probabilityLabel),k.push("P("+g+" | color): "+w.toFixed(3)),k.push("P(color | "+g+"): "+T.toFixed(3)));var M=k.join("
"),S=c.mostReadable(u.color,["black","white"]);return{trace:d,x:o*(i-e.left),y:s*(m-e.top),text:M,color:u.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontColor:S,fontSize:10,idealAlign:a,hovertemplate:d.hovertemplate,hovertemplateLabels:A,eventData:[{data:d._input,fullData:d,category:g,count:y,probability:b,categorycount:x,colorcount:_,bandcolorcount:v}]}}(n,s,u):"dimension"===l&&(e=function(t,e,n){var i=[];return r.select(n.parentNode.parentNode).selectAll("g.category").select("rect.catrect").each((function(){i.push(C(t,e,this))})),i}(n,s,u)),e&&a.loneHover(e,{container:i._hoverlayer.node(),outerContainer:i._paper.node(),gd:n}))}}function L(t){var e=t.parcatsViewModel;e.dragDimension||(w(e.pathSelection),A(e.dimensionSelection.selectAll("g.category")),k(e.dimensionSelection.selectAll("g.category").selectAll("rect.bandrect")),a.loneUnhover(e.graphDiv._fullLayout._hoverlayer.node()),e.pathSelection.sort(d),-1!==e.hoverinfoItems.indexOf("skip"))||("color"===t.parcatsViewModel.hoveron?E(this,"plotly_unhover",r.event):S(this,"plotly_unhover",r.event))}function P(t){"fixed"!==t.parcatsViewModel.arrangement&&(t.dragDimensionDisplayInd=t.model.displayInd,t.initialDragDimensionDisplayInds=t.parcatsViewModel.model.dimensions.map((function(t){return t.displayInd})),t.dragHasMoved=!1,t.dragCategoryDisplayInd=null,r.select(this).selectAll("g.category").select("rect.catrect").each((function(e){var n=r.mouse(this)[0],i=r.mouse(this)[1];-2<=n&&n<=e.width+2&&-2<=i&&i<=e.height+2&&(t.dragCategoryDisplayInd=e.model.displayInd,t.initialDragCategoryDisplayInds=t.model.categories.map((function(t){return t.displayInd})),e.model.dragY=e.y,o.raiseToTop(this.parentNode),r.select(this.parentNode).selectAll("rect.bandrect").each((function(e){e.yh.y+h.height/2&&(o.model.displayInd=h.model.displayInd,h.model.displayInd=l),t.dragCategoryDisplayInd=o.model.displayInd}if(null===t.dragCategoryDisplayInd||"freeform"===t.parcatsViewModel.arrangement){a.model.dragX=r.event.x;var p=t.parcatsViewModel.dimensions[n],f=t.parcatsViewModel.dimensions[i];void 0!==p&&a.model.dragXf.x&&(a.model.displayInd=f.model.displayInd,f.model.displayInd=t.dragDimensionDisplayInd),t.dragDimensionDisplayInd=a.model.displayInd}V(t.parcatsViewModel),U(t.parcatsViewModel),B(t.parcatsViewModel),F(t.parcatsViewModel)}}function D(t){if("fixed"!==t.parcatsViewModel.arrangement&&null!==t.dragDimensionDisplayInd){r.select(this).selectAll("text").attr("font-weight","normal");var e={},n=R(t.parcatsViewModel),a=t.parcatsViewModel.model.dimensions.map((function(t){return t.displayInd})),o=t.initialDragDimensionDisplayInds.some((function(t,e){return t!==a[e]}));o&&a.forEach((function(r,n){var i=t.parcatsViewModel.model.dimensions[n].containerInd;e["dimensions["+i+"].displayindex"]=r}));var s=!1;if(null!==t.dragCategoryDisplayInd){var l=t.model.categories.map((function(t){return t.displayInd}));if(s=t.initialDragCategoryDisplayInds.some((function(t,e){return t!==l[e]}))){var c=t.model.categories.slice().sort((function(t,e){return t.displayInd-e.displayInd})),u=c.map((function(t){return t.categoryValue})),h=c.map((function(t){return t.categoryLabel}));e["dimensions["+t.model.containerInd+"].categoryarray"]=[u],e["dimensions["+t.model.containerInd+"].ticktext"]=[h],e["dimensions["+t.model.containerInd+"].categoryorder"]="array"}}-1===t.parcatsViewModel.hoverinfoItems.indexOf("skip")&&!t.dragHasMoved&&t.potentialClickBand&&("color"===t.parcatsViewModel.hoveron?E(t.potentialClickBand,"plotly_click",r.event.sourceEvent):S(t.potentialClickBand,"plotly_click",r.event.sourceEvent)),t.model.dragX=null,null!==t.dragCategoryDisplayInd&&(t.parcatsViewModel.dimensions[t.dragDimensionDisplayInd].categories[t.dragCategoryDisplayInd].model.dragY=null,t.dragCategoryDisplayInd=null),t.dragDimensionDisplayInd=null,t.parcatsViewModel.dragDimension=null,t.dragHasMoved=null,t.potentialClickBand=null,V(t.parcatsViewModel),U(t.parcatsViewModel),r.transition().duration(300).ease("cubic-in-out").each((function(){B(t.parcatsViewModel,!0),F(t.parcatsViewModel,!0)})).each("end",(function(){(o||s)&&i.restyle(t.parcatsViewModel.graphDiv,e,[n])}))}}function R(t){for(var e,r=t.graphDiv._fullData,n=0;n=0;s--)u+="C"+c[s]+","+(e[s+1]+i)+" "+l[s]+","+(e[s]+i)+" "+(t[s]+r[s])+","+(e[s]+i),u+="l-"+r[s]+",0 ";return u+"Z"}function U(t){var e=t.dimensions,r=t.model,n=e.map((function(t){return t.categories.map((function(t){return t.y}))})),i=t.model.dimensions.map((function(t){return t.categories.map((function(t){return t.displayInd}))})),a=t.model.dimensions.map((function(t){return t.displayInd})),o=t.dimensions.map((function(t){return t.model.dimensionInd})),s=e.map((function(t){return t.x})),l=e.map((function(t){return t.width})),c=[];for(var u in r.paths)r.paths.hasOwnProperty(u)&&c.push(r.paths[u]);function h(t){var e=t.categoryInds.map((function(t,e){return i[e][t]}));return o.map((function(t){return e[t]}))}c.sort((function(e,r){var n=h(e),i=h(r);return"backward"===t.sortpaths&&(n.reverse(),i.reverse()),n.push(e.valueInds[0]),i.push(r.valueInds[0]),t.bundlecolors&&(n.unshift(e.rawColor),i.unshift(r.rawColor)),ni?1:0}));for(var p=new Array(c.length),f=e[0].model.count,d=e[0].categories.map((function(t){return t.height})).reduce((function(t,e){return t+e})),m=0;m0?d*(v.count/f):0;for(var x=new Array(n.length),_=0;_1?(t.width-80-16)/(n-1):0)*i;var a,o,s,l,c,u=[],h=t.model.maxCats,p=e.categories.length,f=e.count,d=t.height-8*(h-1),m=8*(h-p)/2,g=e.categories.map((function(t){return{displayInd:t.displayInd,categoryInd:t.categoryInd}}));for(g.sort((function(t,e){return t.displayInd-e.displayInd})),c=0;c0?o.count/f*d:0,s={key:o.valueInds[0],model:o,width:16,height:a,y:null!==o.dragY?o.dragY:m,bands:[],parcatsViewModel:t},m=m+a+8,u.push(s);return{key:e.dimensionInd,x:null!==e.dragX?e.dragX:r,y:0,width:16,model:e,categories:u,parcatsViewModel:t,dragCategoryDisplayInd:null,dragDimensionDisplayInd:null,initialDragDimensionDisplayInds:null,initialDragCategoryDisplayInds:null,dragHasMoved:null,potentialClickBand:null}}e.exports=function(t,e,r,n){h(r,t,n,e)}}}),i_=f({"src/traces/parcats/plot.js"(t,e){var r=n_();e.exports=function(t,e,n,i){var a=t._fullLayout,o=a._paper,s=a._size;r(t,o,e,{width:s.w,height:s.h,margin:{t:s.t,r:s.r,b:s.b,l:s.l}},n,i)}}}),a_=f({"src/traces/parcats/base_plot.js"(t){var e=we().getModuleCalcData,r=i_(),n="parcats";t.name=n,t.plot=function(t,i,a,o){var s=e(t.calcdata,n);if(s.length){var l=s[0];r(t,l,a,o)}},t.clean=function(t,e,r,n){var i=n._has&&n._has("parcats"),a=e._has&&e._has("parcats");i&&!a&&n._paperdiv.selectAll(".parcats").remove()}}}),o_=f({"src/traces/parcats/index.js"(t,e){e.exports={attributes:t_(),supplyDefaults:e_(),calc:r_(),plot:i_(),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcats",basePlotModule:a_(),categories:["noOpacity"],meta:{}}}}),s_=f({"lib/parcats.js"(t,e){e.exports=o_()}}),l_=f({"src/plots/mapbox/constants.js"(t,e){var r=Zt(),n="1.13.4",i='© OpenStreetMap contributors',a=['© Carto',i].join(" "),o=['Map tiles by Stamen Design','under CC BY 3.0',"|",'Data by OpenStreetMap contributors','under ODbL'].join(" "),s={"open-street-map":{id:"osm",version:8,sources:{"plotly-osm-tiles":{type:"raster",attribution:i,tiles:["https://a.tile.openstreetmap.org/{z}/{x}/{y}.png","https://b.tile.openstreetmap.org/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-osm-tiles",type:"raster",source:"plotly-osm-tiles",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"white-bg":{id:"white-bg",version:8,sources:{},layers:[{id:"white-bg",type:"background",paint:{"background-color":"#FFFFFF"},minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"carto-positron":{id:"carto-positron",version:8,sources:{"plotly-carto-positron":{type:"raster",attribution:a,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-positron",type:"raster",source:"plotly-carto-positron",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"carto-darkmatter":{id:"carto-darkmatter",version:8,sources:{"plotly-carto-darkmatter":{type:"raster",attribution:a,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/dark_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-darkmatter",type:"raster",source:"plotly-carto-darkmatter",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-terrain":{id:"stamen-terrain",version:8,sources:{"plotly-stamen-terrain":{type:"raster",attribution:o,tiles:["https://tiles.stadiamaps.com/tiles/stamen_terrain/{z}/{x}/{y}.png?api_key="],tileSize:256}},layers:[{id:"plotly-stamen-terrain",type:"raster",source:"plotly-stamen-terrain",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-toner":{id:"stamen-toner",version:8,sources:{"plotly-stamen-toner":{type:"raster",attribution:o,tiles:["https://tiles.stadiamaps.com/tiles/stamen_toner/{z}/{x}/{y}.png?api_key="],tileSize:256}},layers:[{id:"plotly-stamen-toner",type:"raster",source:"plotly-stamen-toner",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-watercolor":{id:"stamen-watercolor",version:8,sources:{"plotly-stamen-watercolor":{type:"raster",attribution:['Map tiles by Stamen Design','under CC BY 3.0',"|",'Data by OpenStreetMap contributors','under CC BY SA'].join(" "),tiles:["https://tiles.stadiamaps.com/tiles/stamen_watercolor/{z}/{x}/{y}.jpg?api_key="],tileSize:256}},layers:[{id:"plotly-stamen-watercolor",type:"raster",source:"plotly-stamen-watercolor",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"}},l=r(s);e.exports={requiredVersion:n,styleUrlPrefix:"mapbox://styles/mapbox/",styleUrlSuffix:"v9",styleValuesMapbox:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],styleValueDflt:"basic",stylesNonMapbox:s,styleValuesNonMapbox:l,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",wrongVersionErrorMsg:["Your custom plotly.js bundle is not using the correct mapbox-gl version","Please install @plotly/mapbox-gl@"+n+"."].join("\n"),noAccessTokenErrorMsg:["Missing Mapbox access token.","Mapbox trace type require a Mapbox access token to be registered.","For example:"," Plotly.newPlot(gd, data, layout, { mapboxAccessToken: 'my-access-token' });","More info here: https://www.mapbox.com/help/define-access-token/"].join("\n"),missingStyleErrorMsg:["No valid mapbox style found, please set `mapbox.style` to one of:",l.join(", "),"or register a Mapbox access token to use a Mapbox-served style."].join("\n"),multipleTokensErrorMsg:["Set multiple mapbox access token across different mapbox subplot,","using first token found as mapbox-gl does not allow multipleaccess tokens on the same page."].join("\n"),mapOnErrorMsg:"Mapbox error.",mapboxLogo:{path0:"m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z",path1:"M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z",path2:"M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z",polygon:"11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34"},styleRules:{map:"overflow:hidden;position:relative;","missing-css":"display:none;",canary:"background-color:salmon;","ctrl-bottom-left":"position: absolute; pointer-events: none; z-index: 2; bottom: 0; left: 0;","ctrl-bottom-right":"position: absolute; pointer-events: none; z-index: 2; right: 0; bottom: 0;",ctrl:"clear: both; pointer-events: auto; transform: translate(0, 0);","ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner":"display: none;","ctrl-attrib.mapboxgl-compact:hover .mapboxgl-ctrl-attrib-inner":"display: block; margin-top:2px","ctrl-attrib.mapboxgl-compact:hover":"padding: 2px 24px 2px 4px; visibility: visible; margin-top: 6px;","ctrl-attrib.mapboxgl-compact::after":'content: ""; cursor: pointer; position: absolute; background-image: url(\'data:image/svg+xml;charset=utf-8,%3Csvg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"%3E %3Cpath fill="%23333333" fill-rule="evenodd" d="M4,10a6,6 0 1,0 12,0a6,6 0 1,0 -12,0 M9,7a1,1 0 1,0 2,0a1,1 0 1,0 -2,0 M9,10a1,1 0 1,1 2,0l0,3a1,1 0 1,1 -2,0"/%3E %3C/svg%3E\'); background-color: rgba(255, 255, 255, 0.5); width: 24px; height: 24px; box-sizing: border-box; border-radius: 12px;',"ctrl-attrib.mapboxgl-compact":"min-height: 20px; padding: 0; margin: 10px; position: relative; background-color: #fff; border-radius: 3px 12px 12px 3px;","ctrl-bottom-right > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; right: 0","ctrl-bottom-left > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; left: 0","ctrl-bottom-left .mapboxgl-ctrl":"margin: 0 0 10px 10px; float: left;","ctrl-bottom-right .mapboxgl-ctrl":"margin: 0 10px 10px 0; float: right;","ctrl-attrib":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a:hover":"color: inherit; text-decoration: underline;","ctrl-attrib .mapbox-improve-map":"font-weight: bold; margin-left: 2px;","attrib-empty":"display: none;","ctrl-logo":'display:block; width: 21px; height: 21px; background-image: url(\'data:image/svg+xml;charset=utf-8,%3C?xml version="1.0" encoding="utf-8"?%3E %3Csvg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 21 21" style="enable-background:new 0 0 21 21;" xml:space="preserve"%3E%3Cg transform="translate(0,0.01)"%3E%3Cpath d="m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z" style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3Cpath d="M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpath d="M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpolygon points="11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34 " style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3C/g%3E%3C/svg%3E\')'}}}}),c_=f({"src/plots/mapbox/layout_attributes.js"(t,e){var r=le(),n=H().defaultLine,i=Aa().attributes,a=F(),o=Tn().textposition,s=Pt().overrideAll,l=ye().templatedArray,c=l_(),u=a({noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0});u.family.dflt="Open Sans Regular, Arial Unicode MS Regular",(e.exports=s({_arrayAttrRegexps:[r.counterRegex("mapbox",".layers",!0)],domain:i({name:"mapbox"}),accesstoken:{valType:"string",noBlank:!0,strict:!0},style:{valType:"any",values:c.styleValuesMapbox.concat(c.styleValuesNonMapbox),dflt:c.styleValueDflt},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},bounds:{west:{valType:"number"},east:{valType:"number"},south:{valType:"number"},north:{valType:"number"}},layers:l("layer",{visible:{valType:"boolean",dflt:!0},sourcetype:{valType:"enumerated",values:["geojson","vector","raster","image"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},sourceattribution:{valType:"string"},type:{valType:"enumerated",values:["circle","line","fill","symbol","raster"],dflt:"circle"},coordinates:{valType:"any"},below:{valType:"string"},color:{valType:"color",dflt:n},opacity:{valType:"number",min:0,max:1,dflt:1},minzoom:{valType:"number",min:0,max:24,dflt:0},maxzoom:{valType:"number",min:0,max:24,dflt:24},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2},dash:{valType:"data_array"}},fill:{outlinecolor:{valType:"color",dflt:n}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},placement:{valType:"enumerated",values:["point","line","line-center"],dflt:"point"},textfont:u,textposition:r.extendFlat({},o,{arrayOk:!1})}})},"plot","from-root")).uirevision={valType:"any",editType:"none"}}}),u_=f({"src/traces/scattermapbox/attributes.js"(t,e){var r=Ot().hovertemplateAttrs,n=Ot().texttemplateAttrs,i=wn(),a=Vm(),o=Tn(),s=c_(),l=U(),c=Pe(),u=R().extendFlat,h=Pt().overrideAll,p=c_(),f=a.line,d=a.marker;e.exports=h({lon:a.lon,lat:a.lat,cluster:{enabled:{valType:"boolean"},maxzoom:u({},p.layers.maxzoom,{}),step:{valType:"number",arrayOk:!0,dflt:-1,min:-1},size:{valType:"number",arrayOk:!0,dflt:20,min:0},color:{valType:"color",arrayOk:!0},opacity:u({},d.opacity,{dflt:1})},mode:u({},o.mode,{dflt:"markers"}),text:u({},o.text,{}),texttemplate:n({editType:"plot"},{keys:["lat","lon","text"]}),hovertext:u({},o.hovertext,{}),line:{color:f.color,width:f.width},connectgaps:o.connectgaps,marker:u({symbol:{valType:"string",dflt:"circle",arrayOk:!0},angle:{valType:"number",dflt:"auto",arrayOk:!0},allowoverlap:{valType:"boolean",dflt:!1},opacity:d.opacity,size:d.size,sizeref:d.sizeref,sizemin:d.sizemin,sizemode:d.sizemode},c("marker")),fill:a.fill,fillcolor:i(),textfont:s.layers.symbol.textfont,textposition:s.layers.symbol.textposition,below:{valType:"string"},selected:{marker:o.selected.marker},unselected:{marker:o.unselected.marker},hoverinfo:u({},l.hoverinfo,{flags:["lon","lat","text","name"]}),hovertemplate:r()},"calc","nested")}}),h_=f({"src/traces/scattermapbox/constants.js"(t,e){var r=["Metropolis Black Italic","Metropolis Black","Metropolis Bold Italic","Metropolis Bold","Metropolis Extra Bold Italic","Metropolis Extra Bold","Metropolis Extra Light Italic","Metropolis Extra Light","Metropolis Light Italic","Metropolis Light","Metropolis Medium Italic","Metropolis Medium","Metropolis Regular Italic","Metropolis Regular","Metropolis Semi Bold Italic","Metropolis Semi Bold","Metropolis Thin Italic","Metropolis Thin","Open Sans Bold Italic","Open Sans Bold","Open Sans Extrabold Italic","Open Sans Extrabold","Open Sans Italic","Open Sans Light Italic","Open Sans Light","Open Sans Regular","Open Sans Semibold Italic","Open Sans Semibold","Klokantech Noto Sans Bold","Klokantech Noto Sans CJK Bold","Klokantech Noto Sans CJK Regular","Klokantech Noto Sans Italic","Klokantech Noto Sans Regular"];e.exports={isSupportedFont:function(t){return-1!==r.indexOf(t)}}}}),p_=f({"src/traces/scattermapbox/defaults.js"(t,e){var r=le(),n=Ye(),i=Zn(),a=Yn(),o=$n(),s=Kn(),l=u_(),c=h_().isSupportedFont;e.exports=function(t,e,u,h){function p(n,i){return r.coerce(t,e,l,n,i)}function f(n,i){return r.coerce2(t,e,l,n,i)}var d=function(t,e,r){var n=r("lon")||[],i=r("lat")||[],a=Math.min(n.length,i.length);return e._length=a,a}(0,e,p);if(d){if(p("text"),p("texttemplate"),p("hovertext"),p("hovertemplate"),p("mode"),p("below"),n.hasMarkers(e)){i(t,e,u,h,p,{noLine:!0,noAngle:!0}),p("marker.allowoverlap"),p("marker.angle");var m=e.marker;"circle"!==m.symbol&&(r.isArrayOrTypedArray(m.size)&&(m.size=m.size[0]),r.isArrayOrTypedArray(m.color)&&(m.color=m.color[0]))}n.hasLines(e)&&(a(t,e,u,h,p,{noDash:!0}),p("connectgaps"));var g=f("cluster.maxzoom"),y=f("cluster.step"),v=f("cluster.color",e.marker&&e.marker.color||u),x=f("cluster.size"),_=f("cluster.opacity");if(p("cluster.enabled",!1!==g||!1!==y||!1!==v||!1!==x||!1!==_)||n.hasText(e)){var b=h.font.family;o(t,e,h,p,{noSelect:!0,noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,font:{family:c(b)?b:"Open Sans Regular",weight:h.font.weight,style:h.font.style,size:h.font.size,color:h.font.color}})}p("fill"),"none"!==e.fill&&s(t,e,u,p),r.coerceSelectionMarkerOpacity(e,p)}else e.visible=!1}}}),f_=f({"src/traces/scattermapbox/format_labels.js"(t,e){var r=ir();e.exports=function(t,e,n){var i={},a=n[e.subplot]._subplot.mockAxis,o=t.lonlat;return i.lonLabel=r.tickText(a,a.c2l(o[0]),!0).text,i.latLabel=r.tickText(a,a.c2l(o[1]),!0).text,i}}}),d_=f({"src/plots/mapbox/convert_text_opts.js"(t,e){var r=le();e.exports=function(t,e){var n=t.split(" "),i=n[0],a=n[1],o=r.isArrayOrTypedArray(e)?r.mean(e):e,s=.5+o/100,l=1.5+o/100,c=["",""],u=[0,0];switch(i){case"top":c[0]="top",u[1]=-l;break;case"bottom":c[0]="bottom",u[1]=l}switch(a){case"left":c[1]="right",u[0]=-s;break;case"right":c[1]="left",u[0]=s}return{anchor:c[0]&&c[1]?c.join("-"):c[0]?c[0]:c[1]?c[1]:"center",offset:u}}}}),m_=f({"src/traces/scattermapbox/convert.js"(t,e){var r=A(),n=le(),i=k().BADNUM,a=Xm(),o=Ze(),s=Qe(),l=Xe(),c=Ye(),u=h_().isSupportedFont,h=d_(),p=$e().appendArrayPointValue,f=Se().NEWLINES,d=Se().BR_TAG_ALL;function m(t){return{type:t,geojson:a.makeBlank(),layout:{visibility:"none"},filter:null,paint:{}}}function g(t,e){return n.isArrayOrTypedArray(t)?e?function(e){return r(t[e])?+t[e]:0}:function(e){return t[e]}:t?function(){return t}:y}function y(){return""}function v(t){return t[0]===i}function x(t,e){var r;if(n.isArrayOrTypedArray(t)&&n.isArrayOrTypedArray(e)){r=["step",["get","point_count"],t[0]];for(var i=1;i850?" Black":i>750?" Extra Bold":i>650?" Bold":i>550?" Semi Bold":i>450?" Medium":i>350?" Regular":i>250?" Light":i>150?" Extra Light":" Thin"):"Open Sans"===a.slice(0,2).join(" ")?(s="Open Sans",s+=i>750?" Extrabold":i>650?" Bold":i>550?" Semibold":i>350?" Regular":" Light"):"Klokantech Noto Sans"===a.slice(0,3).join(" ")&&(s="Klokantech Noto Sans","CJK"===a[3]&&(s+=" CJK"),s+=i>500?" Bold":" Regular")),o&&(s+=" Italic"),"Open Sans Regular Italic"===s?s="Open Sans Italic":"Open Sans Regular Bold"===s?s="Open Sans Bold":"Open Sans Regular Bold Italic"===s?s="Open Sans Bold Italic":"Klokantech Noto Sans Regular Italic"===s&&(s="Klokantech Noto Sans Italic"),u(s)||(s=r),s.split(", ")}e.exports=function(t,e){var i,u=e[0].trace,b=!0===u.visible&&0!==u._length,w="none"!==u.fill,T=c.hasLines(u),A=c.hasMarkers(u),k=c.hasText(u),M=A&&"circle"===u.marker.symbol,S=A&&"circle"!==u.marker.symbol,E=u.cluster&&u.cluster.enabled,C=m("fill"),I=m("line"),L=m("circle"),P=m("symbol"),z={fill:C,line:I,circle:L,symbol:P};if(!b)return z;if((w||T)&&(i=a.calcTraceToLineCoords(e)),w&&(C.geojson=a.makePolygon(i),C.layout.visibility="visible",n.extendFlat(C.paint,{"fill-color":u.fillcolor})),T&&(I.geojson=a.makeLine(i),I.layout.visibility="visible",n.extendFlat(I.paint,{"line-width":u.line.width,"line-color":u.line.color,"line-opacity":u.opacity})),M){var D=function(t){var e,i,a,c,u=t[0].trace,h=u.marker,p=u.selectedpoints,f=n.isArrayOrTypedArray(h.color),d=n.isArrayOrTypedArray(h.size),m=n.isArrayOrTypedArray(h.opacity);function g(t){return u.opacity*t}f&&(i=o.hasColorscale(u,"marker")?o.makeColorScaleFuncFromTrace(h):n.identity),d&&(a=l(u)),m&&(c=function(t){return g(r(t)?+n.constrain(t,0,1):0)});var y,x=[];for(e=0;e=0;r--){var n=e[r];i.removeLayer(u.layerIds[n])}t||i.removeSource(u.sourceIds.circle)}(t):function(t){for(var e=a.nonCluster,r=e.length-1;r>=0;r--){var n=e[r];i.removeLayer(u.layerIds[n]),t||i.removeSource(u.sourceIds[n])}}(t)}function p(t){l?function(t){t||u.addSource("circle",o.circle,e.cluster);for(var r=a.cluster,n=0;n=0;r--){var n=e[r];t.removeLayer(this.layerIds[n]),t.removeSource(this.sourceIds[n])}},e.exports=function(t,e){var r,i,s,l=e[0].trace,c=l.cluster&&l.cluster.enabled,u=!0!==l.visible,h=new o(t,l.uid,c,u),p=n(t.gd,e),f=h.below=t.belowLookup["trace-"+l.uid];if(c)for(h.addSource("circle",p.circle,l.cluster),r=0;r")}function u(t){return t+"°"}}e.exports={hoverPoints:function(t,e,a){var c=t.cd,u=c[0].trace,h=t.xa,p=t.ya,f=t.subplot,d=[],m=s+u.uid+"-circle",g=u.cluster&&u.cluster.enabled;if(g){var y=f.map.queryRenderedFeatures(null,{layers:[m]});d=y.map((function(t){return t.id}))}var v=360*(e>=0?Math.floor((e+180)/360):Math.ceil((e-180)/360)),x=e-v;if(r.getClosest(c,(function(t){var e=t.lonlat;if(e[0]===o||g&&-1===d.indexOf(t.i+1))return 1/0;var r=n.modHalf(e[0],360),i=e[1],s=f.project([r,i]),l=s.x-h.c2p([x,i]),c=s.y-p.c2p([r,a]),u=Math.max(3,t.mrc||0);return Math.max(Math.sqrt(l*l+c*c)-u,1-3/u)}),t),!1!==t.index){var _=c[t.index],b=_.lonlat,w=[n.modHalf(b[0],360)+v,b[1]],T=h.c2p(w),A=p.c2p(w),k=_.mrc||1;t.x0=T-k,t.x1=T+k,t.y0=A-k,t.y1=A+k;var M={};M[u.subplot]={_subplot:f};var S=u._module.formatLabels(_,u,M);return t.lonLabel=S.lonLabel,t.latLabel=S.latLabel,t.color=i(u,_),t.extraText=l(u,_,c[0].t.labels),t.hovertemplate=u.hovertemplate,[t]}},getExtraText:l}}}),v_=f({"src/traces/scattermapbox/event_data.js"(t,e){e.exports=function(t,e){return t.lon=e.lon,t.lat=e.lat,t}}}),x_=f({"src/traces/scattermapbox/select.js"(t,e){var r=le(),n=Ye(),i=k().BADNUM;e.exports=function(t,e){var a,o=t.cd,s=t.xaxis,l=t.yaxis,c=[],u=o[0].trace;if(!n.hasMarkers(u))return[];if(!1===e)for(a=0;a"u"&&(e=1e-6),i=t,o=0;o<8;o++){if(a=this.sampleCurveX(i)-t,Math.abs(a)(n=1))return n;for(;ra?r=i:n=i,i=.5*(n-r)+r}return i},i.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var a=o;function o(t,e){this.x=t,this.y=e}o.prototype={clone:function(){return new o(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,r=t.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[0]*this.x+t[1]*this.y,r=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=r,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),r=Math.sin(t),n=e*this.x-r*this.y,i=r*this.x+e*this.y;return this.x=n,this.y=i,this},_rotateAround:function(t,e){var r=Math.cos(t),n=Math.sin(t),i=e.x+r*(this.x-e.x)-n*(this.y-e.y),a=e.y+n*(this.x-e.x)+r*(this.y-e.y);return this.x=i,this.y=a,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},o.convert=function(t){return t instanceof o?t:Array.isArray(t)?new o(t[0],t[1]):t};var s=typeof self<"u"?self:{},l=Math.pow(2,53)-1;function c(t,e,r,i){var a=new n(t,e,r,i);return function(t){return a.solve(t)}}var u=c(.25,.1,.25,1);function h(t,e,r){return Math.min(r,Math.max(e,t))}function p(t,e,r){var n=r-e,i=((t-e)%n+n)%n+e;return i===e?r:i}function f(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var n=0,i=e;n>e/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}function y(t){return!!t&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(t)}function v(t,e){t.forEach((function(t){e[t]&&(e[t]=e[t].bind(e))}))}function x(t,e){return-1!==t.indexOf(e,t.length-e.length)}function _(t,e,r){var n={};for(var i in t)n[i]=e.call(r||this,t[i],i,t);return n}function b(t,e,r){var n={};for(var i in t)e.call(r||this,t[i],i,t)&&(n[i]=t[i]);return n}function w(t){return Array.isArray(t)?t.map(w):"object"==typeof t&&t?_(t,w):t}var T={};function A(t){T[t]||(typeof console<"u"&&console.warn(t),T[t]=!0)}function k(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function M(t){for(var e=0,r=0,n=t.length,i=n-1,a=void 0,o=void 0;r@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(function(t,r,n,i){var a=n||i;return e[r]=!a||a.toLowerCase(),""})),e["max-age"]){var r=parseInt(e["max-age"],10);isNaN(r)?delete e["max-age"]:e["max-age"]=r}return e}var C=null;function I(t){if(null==C){var e=t.navigator?t.navigator.userAgent:null;C=!!t.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return C}function L(t){try{var e=s[t];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch{return!1}}var P,z,D,O,R=s.performance&&s.performance.now?s.performance.now.bind(s.performance):Date.now.bind(Date),F=s.requestAnimationFrame||s.mozRequestAnimationFrame||s.webkitRequestAnimationFrame||s.msRequestAnimationFrame,B=s.cancelAnimationFrame||s.mozCancelAnimationFrame||s.webkitCancelAnimationFrame||s.msCancelAnimationFrame,j={now:R,frame:function(t){var e=F(t);return{cancel:function(){return B(e)}}},getImageData:function(t,e){void 0===e&&(e=0);var r=s.document.createElement("canvas"),n=r.getContext("2d");if(!n)throw new Error("failed to create canvas 2d context");return r.width=t.width,r.height=t.height,n.drawImage(t,0,0,t.width,t.height),n.getImageData(-e,-e,t.width+2*e,t.height+2*e)},resolveURL:function(t){return P||(P=s.document.createElement("a")),P.href=t,P.href},hardwareConcurrency:s.navigator&&s.navigator.hardwareConcurrency||4,get devicePixelRatio(){return s.devicePixelRatio},get prefersReducedMotion(){return!!s.matchMedia&&(null==z&&(z=s.matchMedia("(prefers-reduced-motion: reduce)")),z.matches)}},N={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?0===this.API_URL.indexOf("https://api.mapbox.cn")?"https://events.mapbox.cn/events/v2":0===this.API_URL.indexOf("https://api.mapbox.com")?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},U={supported:!1,testSupport:function(t){V||!O||(q?H(t):D=t)}},V=!1,q=!1;function H(t){var e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e);try{if(t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,O),t.isContextLost())return;U.supported=!0}catch{}t.deleteTexture(e),V=!0}s.document&&((O=s.document.createElement("img")).onload=function(){D&&H(D),D=null,q=!0},O.onerror=function(){V=!0,D=null},O.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var G="01",W=function(t,e){this._transformRequestFn=t,this._customAccessToken=e,this._createSkuToken()};function Z(t){return 0===t.indexOf("mapbox:")}W.prototype._createSkuToken=function(){var t=function(){for(var t="",e=0;e<10;e++)t+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",G,t].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=t.token,this._skuTokenExpiresAt=t.tokenExpiresAt},W.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},W.prototype.transformRequest=function(t,e){return this._transformRequestFn&&this._transformRequestFn(t,e)||{url:t}},W.prototype.normalizeStyleURL=function(t,e){if(!Z(t))return t;var r=K(t);return r.path="/styles/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||e)},W.prototype.normalizeGlyphsURL=function(t,e){if(!Z(t))return t;var r=K(t);return r.path="/fonts/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||e)},W.prototype.normalizeSourceURL=function(t,e){if(!Z(t))return t;var r=K(t);return r.path="/v4/"+r.authority+".json",r.params.push("secure"),this._makeAPIURL(r,this._customAccessToken||e)},W.prototype.normalizeSpriteURL=function(t,e,r,n){var i=K(t);return Z(t)?(i.path="/styles/v1"+i.path+"/sprite"+e+r,this._makeAPIURL(i,this._customAccessToken||n)):(i.path+=""+e+r,J(i))},W.prototype.normalizeTileURL=function(t,e){if(this._isSkuTokenExpired()&&this._createSkuToken(),t&&!Z(t))return t;var r=K(t),n=j.devicePixelRatio>=2||512===e?"@2x":"",i=U.supported?".webp":"$1";r.path=r.path.replace(/(\.(png|jpg)\d*)(?=$)/,""+n+i),r.path=r.path.replace(/^.+\/v4\//,"/"),r.path="/v4"+r.path;var a=this._customAccessToken||function(t){for(var e=0,r=t;e=0&&t.params.splice(i,1)}if("/"!==n.path&&(t.path=""+n.path+t.path),!N.REQUIRE_ACCESS_TOKEN)return J(t);if(!(e=e||N.ACCESS_TOKEN))throw new Error("An API access token is required to use Mapbox GL. "+r);if("s"===e[0])throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+r);return t.params=t.params.filter((function(t){return-1===t.indexOf("access_token")})),t.params.push("access_token="+e),J(t)};var Y=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function X(t){return Y.test(t)}var $=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function K(t){var e=t.match($);if(!e)throw new Error("Unable to parse URL object");return{protocol:e[1],authority:e[2],path:e[3]||"/",params:e[4]?e[4].split("&"):[]}}function J(t){var e=t.params.length?"?"+t.params.join("&"):"";return t.protocol+"://"+t.authority+t.path+e}var Q="mapbox.eventData";function tt(t){if(!t)return null;var e=t.split(".");if(!e||3!==e.length)return null;try{var r=JSON.parse(function(t){return decodeURIComponent(s.atob(t).split("").map((function(t){return"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)})).join(""))}(e[1]));return r}catch{return null}}var et=function(t){this.type=t,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null};et.prototype.getStorageKey=function(t){var e,r=tt(N.ACCESS_TOKEN),n="";return r&&r.u?(e=r.u,n=s.btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(function(t,e){return String.fromCharCode(+("0x"+e))})))):n=N.ACCESS_TOKEN||"",t?Q+"."+t+":"+n:Q+":"+n},et.prototype.fetchEventData=function(){var t=L("localStorage"),e=this.getStorageKey(),r=this.getStorageKey("uuid");if(t)try{var n=s.localStorage.getItem(e);n&&(this.eventData=JSON.parse(n));var i=s.localStorage.getItem(r);i&&(this.anonId=i)}catch{A("Unable to read from LocalStorage")}},et.prototype.saveEventData=function(){var t=L("localStorage"),e=this.getStorageKey(),r=this.getStorageKey("uuid");if(t)try{s.localStorage.setItem(r,this.anonId),Object.keys(this.eventData).length>=1&&s.localStorage.setItem(e,JSON.stringify(this.eventData))}catch{A("Unable to write to LocalStorage")}},et.prototype.processRequests=function(t){},et.prototype.postEvent=function(t,e,n,i){var a=this;if(N.EVENTS_URL){var o=K(N.EVENTS_URL);o.params.push("access_token="+(i||N.ACCESS_TOKEN||""));var s={event:this.type,created:new Date(t).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:r,skuId:G,userId:this.anonId},l=e?f(s,e):s,c={url:J(o),headers:{"Content-Type":"text/plain"},body:JSON.stringify([l])};this.pendingRequest=At(c,(function(t){a.pendingRequest=null,n(t),a.saveEventData(),a.processRequests(i)}))}},et.prototype.queueRequest=function(t,e){this.queue.push(t),this.processRequests(e)};var rt,nt,it=function(t){function e(){t.call(this,"map.load"),this.success={},this.skuToken=""}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.postMapLoadEvent=function(t,e,r,n){this.skuToken=r,(N.EVENTS_URL&&n||N.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return Z(t)||X(t)})))&&this.queueRequest({id:e,timestamp:Date.now()},n)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){var r=this.queue.shift(),n=r.id,i=r.timestamp;n&&this.success[n]||(this.anonId||this.fetchEventData(),y(this.anonId)||(this.anonId=g()),this.postEvent(i,{skuToken:this.skuToken},(function(t){t||n&&(e.success[n]=!0)}),t))}},e}(et),at=function(t){function e(e){t.call(this,"appUserTurnstile"),this._customAccessToken=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.postTurnstileEvent=function(t,e){N.EVENTS_URL&&N.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return Z(t)||X(t)}))&&this.queueRequest(Date.now(),e)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){(!this.anonId||!this.eventData.lastSuccess||!this.eventData.tokenU)&&this.fetchEventData();var r=tt(N.ACCESS_TOKEN),n=r?r.u:N.ACCESS_TOKEN,i=n!==this.eventData.tokenU;y(this.anonId)||(this.anonId=g(),i=!0);var a=this.queue.shift();if(this.eventData.lastSuccess){var o=new Date(this.eventData.lastSuccess),s=new Date(a),l=(a-this.eventData.lastSuccess)/864e5;i=i||l>=1||l<-1||o.getDate()!==s.getDate()}else i=!0;if(!i)return this.processRequests();this.postEvent(a,{"enabled.telemetry":!1},(function(t){t||(e.eventData.lastSuccess=a,e.eventData.tokenU=n)}),t)}},e}(et),ot=new at,st=ot.postTurnstileEvent.bind(ot),lt=new it,ct=lt.postMapLoadEvent.bind(lt),ut="mapbox-tiles",ht=500,pt=50;function ft(){s.caches&&!rt&&(rt=s.caches.open(ut))}function dt(t){var e=t.indexOf("?");return e<0?t:t.slice(0,e)}var mt,gt=1/0;function yt(){return null==mt&&(mt=s.OffscreenCanvas&&new s.OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof s.createImageBitmap),mt}var vt={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(vt);var xt=function(t){function e(e,r,n){401===r&&X(n)&&(e+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),t.call(this,e),this.status=r,this.url=n,this.name=this.constructor.name,this.message=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},e}(Error),_t=S()?function(){return self.worker&&self.worker.referrer}:function(){return("blob:"===s.location.protocol?s.parent:s).location.href};function bt(t,e){var r=new s.AbortController,n=new s.Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,referrer:_t(),signal:r.signal}),i=!1,a=!1,o=function(t){return t.indexOf("sku=")>0&&X(t)}(n.url);"json"===t.type&&n.headers.set("Accept","application/json");var l=function(r,i,l){if(!a){if(r&&"SecurityError"!==r.message&&A(r),i&&l)return c(i);var u=Date.now();s.fetch(n).then((function(r){if(r.ok){var n=o?r.clone():null;return c(r,n,u)}return e(new xt(r.statusText,r.status,t.url))})).catch((function(t){20!==t.code&&e(new Error(t.message))}))}},c=function(r,o,l){("arrayBuffer"===t.type?r.arrayBuffer():"json"===t.type?r.json():r.text()).then((function(t){a||(o&&l&&function(t,e,r){if(ft(),rt){var n={status:e.status,statusText:e.statusText,headers:new s.Headers};e.headers.forEach((function(t,e){return n.headers.set(e,t)}));var i=E(e.headers.get("Cache-Control")||"");i["no-store"]||(i["max-age"]&&n.headers.set("Expires",new Date(r+1e3*i["max-age"]).toUTCString()),new Date(n.headers.get("Expires")).getTime()-r<42e4||function(t,e){if(void 0===nt)try{new Response(new ReadableStream),nt=!0}catch{nt=!1}nt?e(t.body):t.blob().then(e)}(e,(function(e){var r=new s.Response(e,n);ft(),rt&&rt.then((function(e){return e.put(dt(t.url),r)})).catch((function(t){return A(t.message)}))})))}}(n,o,l),i=!0,e(null,t,r.headers.get("Cache-Control"),r.headers.get("Expires")))})).catch((function(t){a||e(new Error(t.message))}))};return o?function(t,e){if(ft(),!rt)return e(null);var r=dt(t.url);rt.then((function(t){t.match(r).then((function(n){var i=function(t){if(!t)return!1;var e=new Date(t.headers.get("Expires")||0),r=E(t.headers.get("Cache-Control")||"");return e>Date.now()&&!r["no-cache"]}(n);t.delete(r),i&&t.put(r,n.clone()),e(null,n,i)})).catch(e)})).catch(e)}(n,l):l(null,null),{cancel:function(){a=!0,i||r.abort()}}}var wt=function(t,e){if(!function(t){return/^file:/.test(t)||/^file:/.test(_t())&&!/^\w+:/.test(t)}(t.url)){if(s.fetch&&s.Request&&s.AbortController&&s.Request.prototype.hasOwnProperty("signal"))return bt(t,e);if(S()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",t,e,void 0,!0)}return function(t,e){var r=new s.XMLHttpRequest;for(var n in r.open(t.method||"GET",t.url,!0),"arrayBuffer"===t.type&&(r.responseType="arraybuffer"),t.headers)r.setRequestHeader(n,t.headers[n]);return"json"===t.type&&(r.responseType="text",r.setRequestHeader("Accept","application/json")),r.withCredentials="include"===t.credentials,r.onerror=function(){e(new Error(r.statusText))},r.onload=function(){if((r.status>=200&&r.status<300||0===r.status)&&null!==r.response){var n=r.response;if("json"===t.type)try{n=JSON.parse(r.response)}catch(t){return e(t)}e(null,n,r.getResponseHeader("Cache-Control"),r.getResponseHeader("Expires"))}else e(new xt(r.statusText,r.status,t.url))},r.send(t.body),{cancel:function(){return r.abort()}}}(t,e)},Tt=function(t,e){return wt(f(t,{type:"arrayBuffer"}),e)},At=function(t,e){return wt(f(t,{method:"POST"}),e)};function kt(t){var e=s.document.createElement("a");return e.href=t,e.protocol===s.document.location.protocol&&e.host===s.document.location.host}var Mt,St,Et="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";Mt=[],St=0;var Ct=function(t,e){if(U.supported&&(t.headers||(t.headers={}),t.headers.accept="image/webp,*/*"),St>=N.MAX_PARALLEL_IMAGE_REQUESTS){var r={requestParameters:t,callback:e,cancelled:!1,cancel:function(){this.cancelled=!0}};return Mt.push(r),r}St++;var n=!1,i=function(){if(!n)for(n=!0,St--;Mt.length&&St0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)},Dt.prototype.setEventedParent=function(t,e){return this._eventedParent=t,this._eventedParentData=e,this};var Ot={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}},Rt=function(t,e,r,n){this.message=(t?t+": ":"")+r,n&&(this.identifier=n),null!=e&&e.__line__&&(this.line=e.__line__)};function Ft(t){var e=t.key,r=t.value;return r?[new Rt(e,r,"constants have been deprecated as of v8")]:[]}function Bt(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var n=0,i=e;n":"value"===t.itemType.kind?"array":"array<"+e+">"}return t.kind}var ee=[qt,Ht,Gt,Wt,Zt,Kt,Yt,Qt(Xt),Jt];function re(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!re(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(var r=0,n=ee;r255?255:t}function i(t){return t<0?0:t>1?1:t}function a(t){return"%"===t[t.length-1]?n(parseFloat(t)/100*255):n(parseInt(t))}function o(t){return"%"===t[t.length-1]?i(parseFloat(t)/100):i(parseFloat(t))}function s(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}try{e.parseCSSColor=function(t){var e,i=t.replace(/ /g,"").toLowerCase();if(i in r)return r[i].slice();if("#"===i[0])return 4===i.length?(e=parseInt(i.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===i.length&&(e=parseInt(i.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var l=i.indexOf("("),c=i.indexOf(")");if(-1!==l&&c+1===i.length){var u=i.substr(0,l),h=i.substr(l+1,c-(l+1)).split(","),p=1;switch(u){case"rgba":if(4!==h.length)return null;p=o(h.pop());case"rgb":return 3!==h.length?null:[a(h[0]),a(h[1]),a(h[2]),p];case"hsla":if(4!==h.length)return null;p=o(h.pop());case"hsl":if(3!==h.length)return null;var f=(parseFloat(h[0])%360+360)%360/360,d=o(h[1]),m=o(h[2]),g=m<=.5?m*(d+1):m+d-m*d,y=2*m-g;return[n(255*s(y,g,f+1/3)),n(255*s(y,g,f)),n(255*s(y,g,f-1/3)),p];default:return null}}return null}}catch{}})).parseCSSColor,oe=function(t,e,r,n){void 0===n&&(n=1),this.r=t,this.g=e,this.b=r,this.a=n};oe.parse=function(t){if(t){if(t instanceof oe)return t;if("string"==typeof t){var e=ae(t);if(e)return new oe(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3])}}},oe.prototype.toString=function(){var t=this.toArray(),e=t[0],r=t[1],n=t[2],i=t[3];return"rgba("+Math.round(e)+","+Math.round(r)+","+Math.round(n)+","+i+")"},oe.prototype.toArray=function(){var t=this,e=t.r,r=t.g,n=t.b,i=t.a;return 0===i?[0,0,0,0]:[255*e/i,255*r/i,255*n/i,i]},oe.black=new oe(0,0,0,1),oe.white=new oe(1,1,1,1),oe.transparent=new oe(0,0,0,0),oe.red=new oe(1,0,0,1);var se=function(t,e,r){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};se.prototype.compare=function(t,e){return this.collator.compare(t,e)},se.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var le=function(t,e,r,n,i){this.text=t,this.image=e,this.scale=r,this.fontStack=n,this.textColor=i},ce=function(t){this.sections=t};ce.fromString=function(t){return new ce([new le(t,null,null,null,null)])},ce.prototype.isEmpty=function(){return 0===this.sections.length||!this.sections.some((function(t){return 0!==t.text.length||t.image&&0!==t.image.name.length}))},ce.factory=function(t){return t instanceof ce?t:ce.fromString(t)},ce.prototype.toString=function(){return 0===this.sections.length?"":this.sections.map((function(t){return t.text})).join("")},ce.prototype.serialize=function(){for(var t=["format"],e=0,r=this.sections;e=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof r&&r>=0&&r<=255?typeof n>"u"||"number"==typeof n&&n>=0&&n<=1?null:"Invalid rgba value ["+[t,e,r,n].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof n?[t,e,r,n]:[t,e,r]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function pe(t){if(null===t)return!0;if("string"==typeof t)return!0;if("boolean"==typeof t)return!0;if("number"==typeof t)return!0;if(t instanceof oe)return!0;if(t instanceof se)return!0;if(t instanceof ce)return!0;if(t instanceof ue)return!0;if(Array.isArray(t)){for(var e=0,r=t;e2){var s=t[1];if("string"!=typeof s||!(s in ye)||"object"===s)return e.error('The item type argument of "array" must be one of string, number, boolean',1);a=ye[s],n++}else a=Xt;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);o=t[2],n++}r=Qt(a,o)}else r=ye[i];for(var l=[];n1)&&e.push(n)}}return e.concat(this.args.map((function(t){return t.serialize()})))};var xe=function(t){this.type=Kt,this.sections=t};xe.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[1];if(!Array.isArray(r)&&"object"==typeof r)return e.error("First argument must be an image or text section.");for(var n=[],i=!1,a=1;a<=t.length-1;++a){var o=t[a];if(i&&"object"==typeof o&&!Array.isArray(o)){i=!1;var s=null;if(o["font-scale"]&&!(s=e.parse(o["font-scale"],1,Ht)))return null;var l=null;if(o["text-font"]&&!(l=e.parse(o["text-font"],1,Qt(Gt))))return null;var c=null;if(o["text-color"]&&!(c=e.parse(o["text-color"],1,Zt)))return null;var u=n[n.length-1];u.scale=s,u.font=l,u.textColor=c}else{var h=e.parse(t[a],1,Xt);if(!h)return null;var p=h.type.kind;if("string"!==p&&"value"!==p&&"null"!==p&&"resolvedImage"!==p)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");i=!0,n.push({content:h,scale:null,font:null,textColor:null})}}return new xe(n)},xe.prototype.evaluate=function(t){return new ce(this.sections.map((function(e){var r=e.content.evaluate(t);return fe(r)===Jt?new le("",r,null,null,null):new le(de(r),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))},xe.prototype.eachChild=function(t){for(var e=0,r=this.sections;e-1),r},_e.prototype.eachChild=function(t){t(this.input)},_e.prototype.outputDefined=function(){return!1},_e.prototype.serialize=function(){return["image",this.input.serialize()]};var be={"to-boolean":Wt,"to-color":Zt,"to-number":Ht,"to-string":Gt},we=function(t,e){this.type=t,this.args=e};we.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[0];if(("to-boolean"===r||"to-string"===r)&&2!==t.length)return e.error("Expected one argument.");for(var n=be[r],i=[],a=1;a4?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":he(e[0],e[1],e[2],e[3])))return new oe(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new ge(r||"Could not parse color from value '"+("string"==typeof e?e:String(JSON.stringify(e)))+"'")}if("number"===this.type.kind){for(var o=null,s=0,l=this.args;s=e[2]||t[1]<=e[1]||t[3]>=e[3])}function Ie(t,e){var r=function(t){return(180+t)/360}(t[0]),n=function(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}(t[1]),i=Math.pow(2,e.z);return[Math.round(r*i*Se),Math.round(n*i*Se)]}function Le(t,e,r){var n=t[0]-e[0],i=t[1]-e[1],a=t[0]-r[0],o=t[1]-r[1];return n*o-a*i==0&&n*a<=0&&i*o<=0}function Pe(t,e,r){return e[1]>t[1]!=r[1]>t[1]&&t[0]<(r[0]-e[0])*(t[1]-e[1])/(r[1]-e[1])+e[0]}function ze(t,e){for(var r=!1,n=0,i=e.length;n0&&h<0||u<0&&h>0}function Re(t,e,r,n){var i=[e[0]-t[0],e[1]-t[1]];return 0!==function(t,e){return t[0]*e[1]-t[1]*e[0]}([n[0]-r[0],n[1]-r[1]],i)&&!(!Oe(t,e,r,n)||!Oe(r,n,t,e))}function Fe(t,e,r){for(var n=0,i=r;nr[2]){var i=.5*n,a=t[0]-r[0]>i?-n:r[0]-t[0]>i?n:0;0===a&&(a=t[0]-r[2]>i?-n:r[2]-t[0]>i?n:0),t[0]+=a}Ee(e,t)}function qe(t,e,r,n){for(var i=Math.pow(2,n.z)*Se,a=[n.x*Se,n.y*Se],o=[],s=0,l=t;s=0)return!1;var r=!0;return t.eachChild((function(t){r&&!Ye(t,e)&&(r=!1)})),r}Ge.parse=function(t,e){if(2!==t.length)return e.error("'within' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(pe(t[1])){var r=t[1];if("FeatureCollection"===r.type)for(var n=0;ne))throw new ge("Input is not a number.");o=s-1}return 0}$e.prototype.parse=function(t,e,r,n,i){return void 0===i&&(i={}),e?this.concat(e,r,n)._parse(t,i):this._parse(t,i)},$e.prototype._parse=function(t,e){function r(t,e,r){return"assert"===r?new ve(e,[t]):"coerce"===r?new we(e,[t]):t}if((null===t||"string"==typeof t||"boolean"==typeof t||"number"==typeof t)&&(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var n=t[0];if("string"!=typeof n)return this.error("Expression name must be a string, but found "+typeof n+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var i=this.registry[n];if(i){var a=i.parse(t,this);if(!a)return null;if(this.expectedType){var o=this.expectedType,s=a.type;if("string"!==o.kind&&"number"!==o.kind&&"boolean"!==o.kind&&"object"!==o.kind&&"array"!==o.kind||"value"!==s.kind)if("color"!==o.kind&&"formatted"!==o.kind&&"resolvedImage"!==o.kind||"value"!==s.kind&&"string"!==s.kind){if(this.checkSubtype(o,s))return null}else a=r(a,o,e.typeAnnotation||"coerce");else a=r(a,o,e.typeAnnotation||"assert")}if(!(a instanceof me)&&"resolvedImage"!==a.type.kind&&Ke(a)){var l=new Ae;try{a=new me(a.type,a.evaluate(l))}catch(t){return this.error(t.message),null}}return a}return this.error('Unknown expression "'+n+'". If you wanted a literal array, use ["literal", [...]].',0)}return typeof t>"u"?this.error("'undefined' value invalid. Use null instead."):"object"==typeof t?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof t+" instead.")},$e.prototype.concat=function(t,e,r){var n="number"==typeof t?this.path.concat(t):this.path,i=r?this.scope.concat(r):this.scope;return new $e(this.registry,n,e||null,i,this.errors)},$e.prototype.error=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];var n=""+this.key+e.map((function(t){return"["+t+"]"})).join("");this.errors.push(new Ut(n,t))},$e.prototype.checkSubtype=function(t,e){var r=re(t,e);return r&&this.error(r),r};var Qe=function(t,e,r){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var n=0,i=r;n=o)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',l);var u=e.parse(s,c,i);if(!u)return null;i=i||u.type,n.push([o,u])}return new Qe(i,r,n)},Qe.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var i=e.length;return n>=e[i-1]?r[i-1].evaluate(t):r[Je(e,n)].evaluate(t)},Qe.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t};var er=Object.freeze({__proto__:null,number:tr,color:function(t,e,r){return new oe(tr(t.r,e.r,r),tr(t.g,e.g,r),tr(t.b,e.b,r),tr(t.a,e.a,r))},array:function(t,e,r){return t.map((function(t,n){return tr(t,e[n],r)}))}}),rr=.95047,nr=1.08883,ir=4/29,ar=6/29,or=3*ar*ar,sr=ar*ar*ar,lr=Math.PI/180,cr=180/Math.PI;function ur(t){return t>sr?Math.pow(t,1/3):t/or+ir}function hr(t){return t>ar?t*t*t:or*(t-ir)}function pr(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function fr(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function dr(t){var e=fr(t.r),r=fr(t.g),n=fr(t.b),i=ur((.4124564*e+.3575761*r+.1804375*n)/rr),a=ur((.2126729*e+.7151522*r+.072175*n)/1);return{l:116*a-16,a:500*(i-a),b:200*(a-ur((.0193339*e+.119192*r+.9503041*n)/nr)),alpha:t.a}}function mr(t){var e=(t.l+16)/116,r=isNaN(t.a)?e:e+t.a/500,n=isNaN(t.b)?e:e-t.b/200;return e=1*hr(e),r=rr*hr(r),n=nr*hr(n),new oe(pr(3.2404542*r-1.5371385*e-.4985314*n),pr(-.969266*r+1.8760108*e+.041556*n),pr(.0556434*r-.2040259*e+1.0572252*n),t.alpha)}function gr(t,e,r){var n=e-t;return t+r*(n>180||n<-180?n-360*Math.round(n/360):n)}var yr={forward:dr,reverse:mr,interpolate:function(t,e,r){return{l:tr(t.l,e.l,r),a:tr(t.a,e.a,r),b:tr(t.b,e.b,r),alpha:tr(t.alpha,e.alpha,r)}}},vr={forward:function(t){var e=dr(t),r=e.l,n=e.a,i=e.b,a=Math.atan2(i,n)*cr;return{h:a<0?a+360:a,c:Math.sqrt(n*n+i*i),l:r,alpha:t.a}},reverse:function(t){var e=t.h*lr,r=t.c;return mr({l:t.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:t.alpha})},interpolate:function(t,e,r){return{h:gr(t.h,e.h,r),c:tr(t.c,e.c,r),l:tr(t.l,e.l,r),alpha:tr(t.alpha,e.alpha,r)}}},xr=Object.freeze({__proto__:null,lab:yr,hcl:vr}),_r=function(t,e,r,n,i){this.type=t,this.operator=e,this.interpolation=r,this.input=n,this.labels=[],this.outputs=[];for(var a=0,o=i;a1})))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:s}}if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(!(i=e.parse(i,2,Ht)))return null;var l=[],c=null;"interpolate-hcl"===r||"interpolate-lab"===r?c=Zt:e.expectedType&&"value"!==e.expectedType.kind&&(c=e.expectedType);for(var u=0;u=h)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',f);var m=e.parse(p,d,c);if(!m)return null;c=c||m.type,l.push([h,m])}return"number"===c.kind||"color"===c.kind||"array"===c.kind&&"number"===c.itemType.kind&&"number"==typeof c.N?new _r(c,r,n,i,l):e.error("Type "+te(c)+" is not interpolatable.")},_r.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var i=e.length;if(n>=e[i-1])return r[i-1].evaluate(t);var a=Je(e,n),o=e[a],s=e[a+1],l=_r.interpolationFactor(this.interpolation,n,o,s),c=r[a].evaluate(t),u=r[a+1].evaluate(t);return"interpolate"===this.operator?er[this.type.kind.toLowerCase()](c,u,l):"interpolate-hcl"===this.operator?vr.reverse(vr.interpolate(vr.forward(c),vr.forward(u),l)):yr.reverse(yr.interpolate(yr.forward(c),yr.forward(u),l))},_r.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e=r.length)throw new ge("Array index out of bounds: "+e+" > "+(r.length-1)+".");if(e!==Math.floor(e))throw new ge("Array index must be an integer, but found "+e+" instead.");return r[e]},Ar.prototype.eachChild=function(t){t(this.index),t(this.input)},Ar.prototype.outputDefined=function(){return!1},Ar.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var kr=function(t,e){this.type=Wt,this.needle=t,this.haystack=e};kr.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,Xt),n=e.parse(t[2],2,Xt);return r&&n?ne(r.type,[Wt,Gt,Ht,qt,Xt])?new kr(r,n):e.error("Expected first argument to be of type boolean, string, number or null, but found "+te(r.type)+" instead"):null},kr.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!r)return!1;if(!ie(e,["boolean","string","number","null"]))throw new ge("Expected first argument to be of type boolean, string, number or null, but found "+te(fe(e))+" instead.");if(!ie(r,["string","array"]))throw new ge("Expected second argument to be of type array or string, but found "+te(fe(r))+" instead.");return r.indexOf(e)>=0},kr.prototype.eachChild=function(t){t(this.needle),t(this.haystack)},kr.prototype.outputDefined=function(){return!0},kr.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var Mr=function(t,e,r){this.type=Ht,this.needle=t,this.haystack=e,this.fromIndex=r};Mr.parse=function(t,e){if(t.length<=2||t.length>=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,Xt),n=e.parse(t[2],2,Xt);if(!r||!n)return null;if(!ne(r.type,[Wt,Gt,Ht,qt,Xt]))return e.error("Expected first argument to be of type boolean, string, number or null, but found "+te(r.type)+" instead");if(4===t.length){var i=e.parse(t[3],3,Ht);return i?new Mr(r,n,i):null}return new Mr(r,n)},Mr.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!ie(e,["boolean","string","number","null"]))throw new ge("Expected first argument to be of type boolean, string, number or null, but found "+te(fe(e))+" instead.");if(!ie(r,["string","array"]))throw new ge("Expected second argument to be of type array or string, but found "+te(fe(r))+" instead.");if(this.fromIndex){var n=this.fromIndex.evaluate(t);return r.indexOf(e,n)}return r.indexOf(e)},Mr.prototype.eachChild=function(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)},Mr.prototype.outputDefined=function(){return!1},Mr.prototype.serialize=function(){if(null!=this.fromIndex&&void 0!==this.fromIndex){var t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var Sr=function(t,e,r,n,i,a){this.inputType=t,this.type=e,this.input=r,this.cases=n,this.outputs=i,this.otherwise=a};Sr.parse=function(t,e){if(t.length<5)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if(t.length%2!=1)return e.error("Expected an even number of arguments.");var r,n;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);for(var i={},a=[],o=2;oNumber.MAX_SAFE_INTEGER)return c.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof p&&Math.floor(p)!==p)return c.error("Numeric branch labels must be integer values.");if(r){if(c.checkSubtype(r,fe(p)))return null}else r=fe(p);if(typeof i[String(p)]<"u")return c.error("Branch labels must be unique.");i[String(p)]=a.length}var f=e.parse(l,o,n);if(!f)return null;n=n||f.type,a.push(f)}var d=e.parse(t[1],1,Xt);if(!d)return null;var m=e.parse(t[t.length-1],t.length-1,n);return!m||"value"!==d.type.kind&&e.concat(1).checkSubtype(r,d.type)?null:new Sr(r,n,d,i,a,m)},Sr.prototype.evaluate=function(t){var e=this.input.evaluate(t);return(fe(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},Sr.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},Sr.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))&&this.otherwise.outputDefined()},Sr.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],r=[],n={},i=0,a=Object.keys(this.cases).sort();i=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,Xt),n=e.parse(t[2],2,Ht);if(!r||!n)return null;if(!ne(r.type,[Qt(Xt),Gt,Xt]))return e.error("Expected first argument to be of type array or string, but found "+te(r.type)+" instead");if(4===t.length){var i=e.parse(t[3],3,Ht);return i?new Cr(r.type,r,n,i):null}return new Cr(r.type,r,n)},Cr.prototype.evaluate=function(t){var e=this.input.evaluate(t),r=this.beginIndex.evaluate(t);if(!ie(e,["string","array"]))throw new ge("Expected first argument to be of type array or string, but found "+te(fe(e))+" instead.");if(this.endIndex){var n=this.endIndex.evaluate(t);return e.slice(r,n)}return e.slice(r)},Cr.prototype.eachChild=function(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)},Cr.prototype.outputDefined=function(){return!1},Cr.prototype.serialize=function(){if(null!=this.endIndex&&void 0!==this.endIndex){var t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var zr=Pr("==",(function(t,e,r){return e===r}),Lr),Dr=Pr("!=",(function(t,e,r){return e!==r}),(function(t,e,r,n){return!Lr(0,e,r,n)})),Or=Pr("<",(function(t,e,r){return e",(function(t,e,r){return e>r}),(function(t,e,r,n){return n.compare(e,r)>0})),Fr=Pr("<=",(function(t,e,r){return e<=r}),(function(t,e,r,n){return n.compare(e,r)<=0})),Br=Pr(">=",(function(t,e,r){return e>=r}),(function(t,e,r,n){return n.compare(e,r)>=0})),jr=function(t,e,r,n,i){this.type=Gt,this.number=t,this.locale=e,this.currency=r,this.minFractionDigits=n,this.maxFractionDigits=i};jr.parse=function(t,e){if(3!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,Ht);if(!r)return null;var n=t[2];if("object"!=typeof n||Array.isArray(n))return e.error("NumberFormat options argument must be an object.");var i=null;if(n.locale&&!(i=e.parse(n.locale,1,Gt)))return null;var a=null;if(n.currency&&!(a=e.parse(n.currency,1,Gt)))return null;var o=null;if(n["min-fraction-digits"]&&!(o=e.parse(n["min-fraction-digits"],1,Ht)))return null;var s=null;return n["max-fraction-digits"]&&!(s=e.parse(n["max-fraction-digits"],1,Ht))?null:new jr(r,i,a,o,s)},jr.prototype.evaluate=function(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))},jr.prototype.eachChild=function(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)},jr.prototype.outputDefined=function(){return!1},jr.prototype.serialize=function(){var t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]};var Nr=function(t){this.type=Ht,this.input=t};Nr.parse=function(t,e){if(2!==t.length)return e.error("Expected 1 argument, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?e.error("Expected argument of type string or array, but found "+te(r.type)+" instead."):new Nr(r):null},Nr.prototype.evaluate=function(t){var e=this.input.evaluate(t);if("string"==typeof e)return e.length;if(Array.isArray(e))return e.length;throw new ge("Expected value to be of type string or array, but found "+te(fe(e))+" instead.")},Nr.prototype.eachChild=function(t){t(this.input)},Nr.prototype.outputDefined=function(){return!1},Nr.prototype.serialize=function(){var t=["length"];return this.eachChild((function(e){t.push(e.serialize())})),t};var Ur={"==":zr,"!=":Dr,">":Rr,"<":Or,">=":Br,"<=":Fr,array:ve,at:Ar,boolean:ve,case:Er,coalesce:wr,collator:Me,format:xe,image:_e,in:kr,"index-of":Mr,interpolate:_r,"interpolate-hcl":_r,"interpolate-lab":_r,length:Nr,let:Tr,literal:me,match:Sr,number:ve,"number-format":jr,object:ve,slice:Cr,step:Qe,string:ve,"to-boolean":we,"to-color":we,"to-number":we,"to-string":we,var:Xe,within:Ge};function Vr(t,e){var r=e[0],n=e[1],i=e[2],a=e[3];r=r.evaluate(t),n=n.evaluate(t),i=i.evaluate(t);var o=a?a.evaluate(t):1,s=he(r,n,i,o);if(s)throw new ge(s);return new oe(r/255*o,n/255*o,i/255*o,o)}function qr(t,e){return t in e}function Hr(t,e){var r=e[t];return typeof r>"u"?null:r}function Gr(t){return{type:t}}function Wr(t){return{result:"success",value:t}}function Zr(t){return{result:"error",value:t}}function Yr(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function Xr(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function $r(t){return!!t.expression&&t.expression.interpolated}function Kr(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function Jr(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function Qr(t){return t}function tn(t,e){var r,n,i,a="color"===e.type,o=t.stops&&"object"==typeof t.stops[0][0],s=o||void 0!==t.property,l=o||!s,c=t.type||($r(e)?"exponential":"interval");if(a&&((t=Bt({},t)).stops&&(t.stops=t.stops.map((function(t){return[t[0],oe.parse(t[1])]}))),t.default?t.default=oe.parse(t.default):t.default=oe.parse(e.default)),t.colorSpace&&"rgb"!==t.colorSpace&&!xr[t.colorSpace])throw new Error("Unknown color space: "+t.colorSpace);if("exponential"===c)r=an;else if("interval"===c)r=nn;else if("categorical"===c){r=rn,n=Object.create(null);for(var u=0,h=t.stops;u=t.stops[n-1][0])return t.stops[n-1][1];var i=Je(t.stops.map((function(t){return t[0]})),r);return t.stops[i][1]}function an(t,e,r){var n=void 0!==t.base?t.base:1;if("number"!==Kr(r))return en(t.default,e.default);var i=t.stops.length;if(1===i||r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[i-1][0])return t.stops[i-1][1];var a=Je(t.stops.map((function(t){return t[0]})),r),o=function(t,e,r,n){var i=n-r,a=t-r;return 0===i?0:1===e?a/i:(Math.pow(e,a)-1)/(Math.pow(e,i)-1)}(r,n,t.stops[a][0],t.stops[a+1][0]),s=t.stops[a][1],l=t.stops[a+1][1],c=er[e.type]||Qr;if(t.colorSpace&&"rgb"!==t.colorSpace){var u=xr[t.colorSpace];c=function(t,e){return u.reverse(u.interpolate(u.forward(t),u.forward(e),o))}}return"function"==typeof s.evaluate?{evaluate:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var r=s.evaluate.apply(void 0,t),n=l.evaluate.apply(void 0,t);if(void 0!==r&&void 0!==n)return c(r,n,o)}}:c(s,l,o)}function on(t,e,r){return"color"===e.type?r=oe.parse(r):"formatted"===e.type?r=ce.fromString(r.toString()):"resolvedImage"===e.type?r=ue.fromString(r.toString()):Kr(r)!==e.type&&("enum"!==e.type||!e.values[r])&&(r=void 0),en(r,t.default,e.default)}ke.register(Ur,{error:[{kind:"error"},[Gt],function(t,e){var r=e[0];throw new ge(r.evaluate(t))}],typeof:[Gt,[Xt],function(t,e){return te(fe(e[0].evaluate(t)))}],"to-rgba":[Qt(Ht,4),[Zt],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[Zt,[Ht,Ht,Ht],Vr],rgba:[Zt,[Ht,Ht,Ht,Ht],Vr],has:{type:Wt,overloads:[[[Gt],function(t,e){return qr(e[0].evaluate(t),t.properties())}],[[Gt,Yt],function(t,e){var r=e[0],n=e[1];return qr(r.evaluate(t),n.evaluate(t))}]]},get:{type:Xt,overloads:[[[Gt],function(t,e){return Hr(e[0].evaluate(t),t.properties())}],[[Gt,Yt],function(t,e){var r=e[0],n=e[1];return Hr(r.evaluate(t),n.evaluate(t))}]]},"feature-state":[Xt,[Gt],function(t,e){return Hr(e[0].evaluate(t),t.featureState||{})}],properties:[Yt,[],function(t){return t.properties()}],"geometry-type":[Gt,[],function(t){return t.geometryType()}],id:[Xt,[],function(t){return t.id()}],zoom:[Ht,[],function(t){return t.globals.zoom}],"heatmap-density":[Ht,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[Ht,[],function(t){return t.globals.lineProgress||0}],accumulated:[Xt,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[Ht,Gr(Ht),function(t,e){for(var r=0,n=0,i=e;n":[Wt,[Gt,Xt],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],a=n.value;return typeof i==typeof a&&i>a}],"filter-id->":[Wt,[Xt],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>i}],"filter-<=":[Wt,[Gt,Xt],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],a=n.value;return typeof i==typeof a&&i<=a}],"filter-id-<=":[Wt,[Xt],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n<=i}],"filter->=":[Wt,[Gt,Xt],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],a=n.value;return typeof i==typeof a&&i>=a}],"filter-id->=":[Wt,[Xt],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>=i}],"filter-has":[Wt,[Xt],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[Wt,[],function(t){return null!==t.id()&&void 0!==t.id()}],"filter-type-in":[Wt,[Qt(Gt)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[Wt,[Qt(Xt)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[Wt,[Gt,Qt(Xt)],function(t,e){var r=e[0];return e[1].value.indexOf(t.properties()[r.value])>=0}],"filter-in-large":[Wt,[Gt,Qt(Xt)],function(t,e){var r=e[0],n=e[1];return function(t,e,r,n){for(;r<=n;){var i=r+n>>1;if(e[i]===t)return!0;e[i]>t?n=i-1:r=i+1}return!1}(t.properties()[r.value],n.value,0,n.value.length-1)}],all:{type:Wt,overloads:[[[Wt,Wt],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)&&n.evaluate(t)}],[Gr(Wt),function(t,e){for(var r=0,n=e;r0&&"string"==typeof t[0]&&t[0]in Ur}function cn(t,e){var r=new $e(Ur,[],e?function(t){var e={color:Zt,string:Gt,number:Ht,enum:Gt,boolean:Wt,formatted:Kt,resolvedImage:Jt};return"array"===t.type?Qt(e[t.value]||Xt,t.length):e[t.type]}(e):void 0),n=r.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return n?Wr(new sn(n,e)):Zr(r.errors)}sn.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i,a){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)},sn.prototype.evaluate=function(t,e,r,n,i,a){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=r||null,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a||null;try{var o=this.expression.evaluate(this._evaluator);if(null==o||"number"==typeof o&&o!=o)return this._defaultValue;if(this._enumValues&&!(o in this._enumValues))throw new ge("Expected value to be one of "+Object.keys(this._enumValues).map((function(t){return JSON.stringify(t)})).join(", ")+", but found "+JSON.stringify(o)+" instead.");return o}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,typeof console<"u"&&console.warn(t.message)),this._defaultValue}};var un=function(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!Ze(e.expression)};un.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i,a){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n,i,a)},un.prototype.evaluate=function(t,e,r,n,i,a){return this._styleExpression.evaluate(t,e,r,n,i,a)};var hn=function(t,e,r,n){this.kind=t,this.zoomStops=r,this._styleExpression=e,this.isStateDependent="camera"!==t&&!Ze(e.expression),this.interpolationType=n};function pn(t,e){if("error"===(t=cn(t,e)).result)return t;var r=t.value.expression,n=We(r);if(!n&&!Yr(e))return Zr([new Ut("","data expressions not supported")]);var i=Ye(r,["zoom"]);if(!i&&!Xr(e))return Zr([new Ut("","zoom expressions not supported")]);var a=dn(r);if(!a&&!i)return Zr([new Ut("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(a instanceof Ut)return Zr([a]);if(a instanceof _r&&!$r(e))return Zr([new Ut("",'"interpolate" expressions cannot be used with this property')]);if(!a)return Wr(new un(n?"constant":"source",t.value));var o=a instanceof _r?a.interpolation:void 0;return Wr(new hn(n?"camera":"composite",t.value,a.labels,o))}hn.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i,a){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n,i,a)},hn.prototype.evaluate=function(t,e,r,n,i,a){return this._styleExpression.evaluate(t,e,r,n,i,a)},hn.prototype.interpolationFactor=function(t,e,r){return this.interpolationType?_r.interpolationFactor(this.interpolationType,t,e,r):0};var fn=function(t,e){this._parameters=t,this._specification=e,Bt(this,tn(this._parameters,this._specification))};function dn(t){var e=null;if(t instanceof Tr)e=dn(t.result);else if(t instanceof wr)for(var r=0,n=t.args;rn.maximum?[new Rt(e,r,r+" is greater than the maximum value "+n.maximum)]:[]}function vn(t){var e,r,n,i=t.valueSpec,a=jt(t.value.type),o={},s="categorical"!==a&&void 0===t.value.property,l=!s,c="array"===Kr(t.value.stops)&&"array"===Kr(t.value.stops[0])&&"object"===Kr(t.value.stops[0][0]),u=mn({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===a)return[new Rt(t.key,t.value,'identity function may not have a "stops" property')];var e=[],r=t.value;return e=e.concat(gn({key:t.key,value:r,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:h})),"array"===Kr(r)&&0===r.length&&e.push(new Rt(t.key,r,"array must have at least one stop")),e},default:function(t){return Vn({key:t.key,value:t.value,valueSpec:i,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===a&&s&&u.push(new Rt(t.key,t.value,'missing required property "property"')),"identity"!==a&&!t.value.stops&&u.push(new Rt(t.key,t.value,'missing required property "stops"')),"exponential"===a&&t.valueSpec.expression&&!$r(t.valueSpec)&&u.push(new Rt(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(l&&!Yr(t.valueSpec)?u.push(new Rt(t.key,t.value,"property functions not supported")):s&&!Xr(t.valueSpec)&&u.push(new Rt(t.key,t.value,"zoom functions not supported"))),("categorical"===a||c)&&void 0===t.value.property&&u.push(new Rt(t.key,t.value,'"property" property is required')),u;function h(t){var e=[],a=t.value,s=t.key;if("array"!==Kr(a))return[new Rt(s,a,"array expected, "+Kr(a)+" found")];if(2!==a.length)return[new Rt(s,a,"array length 2 expected, length "+a.length+" found")];if(c){if("object"!==Kr(a[0]))return[new Rt(s,a,"object expected, "+Kr(a[0])+" found")];if(void 0===a[0].zoom)return[new Rt(s,a,"object stop key must have zoom")];if(void 0===a[0].value)return[new Rt(s,a,"object stop key must have value")];if(n&&n>jt(a[0].zoom))return[new Rt(s,a[0].zoom,"stop zoom values must appear in ascending order")];jt(a[0].zoom)!==n&&(n=jt(a[0].zoom),r=void 0,o={}),e=e.concat(mn({key:s+"[0]",value:a[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:yn,value:p}}))}else e=e.concat(p({key:s+"[0]",value:a[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},a));return ln(Nt(a[1]))?e.concat([new Rt(s+"[1]",a[1],"expressions are not allowed in function stops.")]):e.concat(Vn({key:s+"[1]",value:a[1],valueSpec:i,style:t.style,styleSpec:t.styleSpec}))}function p(t,n){var s=Kr(t.value),l=jt(t.value),c=null!==t.value?t.value:n;if(e){if(s!==e)return[new Rt(t.key,c,s+" stop domain type must match previous stop domain type "+e)]}else e=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new Rt(t.key,c,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==a){var u="number expected, "+s+" found";return Yr(i)&&void 0===a&&(u+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Rt(t.key,c,u)]}return"categorical"!==a||"number"!==s||isFinite(l)&&Math.floor(l)===l?"categorical"!==a&&"number"===s&&void 0!==r&&l=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(var e=0,r=t.slice(1);ee?1:0}function kn(t){if(!Array.isArray(t))return!1;if("within"===t[0])return!0;for(var e=1;e"===e||"<="===e||">="===e?Sn(t[1],t[2],e):"any"===e?function(t){return["any"].concat(t.map(Mn))}(t.slice(1)):"all"===e?["all"].concat(t.slice(1).map(Mn)):"none"===e?["all"].concat(t.slice(1).map(Mn).map(In)):"in"===e?En(t[1],t.slice(2)):"!in"===e?In(En(t[1],t.slice(2))):"has"===e?Cn(t[1]):"!has"===e?In(Cn(t[1])):"within"!==e||t}function Sn(t,e,r){switch(t){case"$type":return["filter-type-"+r,e];case"$id":return["filter-id-"+r,e];default:return["filter-"+r,t,e]}}function En(t,e){if(0===e.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some((function(t){return typeof t!=typeof e[0]}))?["filter-in-large",t,["literal",e.sort(An)]]:["filter-in-small",t,["literal",e]]}}function Cn(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function In(t){return["!",t]}function Ln(t){return bn(Nt(t.value))?xn(Bt({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Pn(t)}function Pn(t){var e=t.value,r=t.key;if("array"!==Kr(e))return[new Rt(r,e,"array expected, "+Kr(e)+" found")];var n,i=t.styleSpec,a=[];if(e.length<1)return[new Rt(r,e,"filter array must have at least 1 element")];switch(a=a.concat(_n({key:r+"[0]",value:e[0],valueSpec:i.filter_operator,style:t.style,styleSpec:t.styleSpec})),jt(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&"$type"===jt(e[1])&&a.push(new Rt(r,e,'"$type" cannot be use with operator "'+e[0]+'"'));case"==":case"!=":3!==e.length&&a.push(new Rt(r,e,'filter array for operator "'+e[0]+'" must have 3 elements'));case"in":case"!in":e.length>=2&&"string"!==(n=Kr(e[1]))&&a.push(new Rt(r+"[1]",e[1],"string expected, "+n+" found"));for(var o=2;o=u[f+0]&&n>=u[f+1])?(o[p]=!0,a.push(c[p])):o[p]=!1}}},ti.prototype._forEachCell=function(t,e,r,n,i,a,o,s){for(var l=this._convertToCellCoord(t),c=this._convertToCellCoord(e),u=this._convertToCellCoord(r),h=this._convertToCellCoord(n),p=l;p<=u;p++)for(var f=c;f<=h;f++){var d=this.d*f+p;if((!s||s(this._convertFromCellCoord(p),this._convertFromCellCoord(f),this._convertFromCellCoord(p+1),this._convertFromCellCoord(f+1)))&&i.call(this,t,e,r,n,d,a,o,s))return}},ti.prototype._convertFromCellCoord=function(t){return(t-this.padding)/this.scale},ti.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},ti.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=Qn+this.cells.length+1+1,r=0,n=0;n=0)){var h=t[u];c[u]=ni[l].shallow.indexOf(u)>=0?h:li(h,e)}t instanceof Error&&(c.message=t.message)}if(c.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==l&&(c.$name=l),c}throw new Error("can't serialize object of type "+typeof t)}function ci(t){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||oi(t)||si(t)||ArrayBuffer.isView(t)||t instanceof ei)return t;if(Array.isArray(t))return t.map(ci);if("object"==typeof t){var e=t.$name||"Object",r=ni[e].klass;if(!r)throw new Error("can't deserialize unregistered class "+e);if(r.deserialize)return r.deserialize(t);for(var n=Object.create(r.prototype),i=0,a=Object.keys(t);i=0?s:ci(s)}}return n}throw new Error("can't deserialize object of type "+typeof t)}var ui=function(){this.first=!0};ui.prototype.update=function(t,e){var r=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=e):this.lastFloorZoom=128&&t<=255},Arabic:function(t){return t>=1536&&t<=1791},"Arabic Supplement":function(t){return t>=1872&&t<=1919},"Arabic Extended-A":function(t){return t>=2208&&t<=2303},"Hangul Jamo":function(t){return t>=4352&&t<=4607},"Unified Canadian Aboriginal Syllabics":function(t){return t>=5120&&t<=5759},Khmer:function(t){return t>=6016&&t<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(t){return t>=6320&&t<=6399},"General Punctuation":function(t){return t>=8192&&t<=8303},"Letterlike Symbols":function(t){return t>=8448&&t<=8527},"Number Forms":function(t){return t>=8528&&t<=8591},"Miscellaneous Technical":function(t){return t>=8960&&t<=9215},"Control Pictures":function(t){return t>=9216&&t<=9279},"Optical Character Recognition":function(t){return t>=9280&&t<=9311},"Enclosed Alphanumerics":function(t){return t>=9312&&t<=9471},"Geometric Shapes":function(t){return t>=9632&&t<=9727},"Miscellaneous Symbols":function(t){return t>=9728&&t<=9983},"Miscellaneous Symbols and Arrows":function(t){return t>=11008&&t<=11263},"CJK Radicals Supplement":function(t){return t>=11904&&t<=12031},"Kangxi Radicals":function(t){return t>=12032&&t<=12255},"Ideographic Description Characters":function(t){return t>=12272&&t<=12287},"CJK Symbols and Punctuation":function(t){return t>=12288&&t<=12351},Hiragana:function(t){return t>=12352&&t<=12447},Katakana:function(t){return t>=12448&&t<=12543},Bopomofo:function(t){return t>=12544&&t<=12591},"Hangul Compatibility Jamo":function(t){return t>=12592&&t<=12687},Kanbun:function(t){return t>=12688&&t<=12703},"Bopomofo Extended":function(t){return t>=12704&&t<=12735},"CJK Strokes":function(t){return t>=12736&&t<=12783},"Katakana Phonetic Extensions":function(t){return t>=12784&&t<=12799},"Enclosed CJK Letters and Months":function(t){return t>=12800&&t<=13055},"CJK Compatibility":function(t){return t>=13056&&t<=13311},"CJK Unified Ideographs Extension A":function(t){return t>=13312&&t<=19903},"Yijing Hexagram Symbols":function(t){return t>=19904&&t<=19967},"CJK Unified Ideographs":function(t){return t>=19968&&t<=40959},"Yi Syllables":function(t){return t>=40960&&t<=42127},"Yi Radicals":function(t){return t>=42128&&t<=42191},"Hangul Jamo Extended-A":function(t){return t>=43360&&t<=43391},"Hangul Syllables":function(t){return t>=44032&&t<=55215},"Hangul Jamo Extended-B":function(t){return t>=55216&&t<=55295},"Private Use Area":function(t){return t>=57344&&t<=63743},"CJK Compatibility Ideographs":function(t){return t>=63744&&t<=64255},"Arabic Presentation Forms-A":function(t){return t>=64336&&t<=65023},"Vertical Forms":function(t){return t>=65040&&t<=65055},"CJK Compatibility Forms":function(t){return t>=65072&&t<=65103},"Small Form Variants":function(t){return t>=65104&&t<=65135},"Arabic Presentation Forms-B":function(t){return t>=65136&&t<=65279},"Halfwidth and Fullwidth Forms":function(t){return t>=65280&&t<=65519}};function pi(t){for(var e=0,r=t;e=65097&&t<=65103)||hi["CJK Compatibility Ideographs"](t)||hi["CJK Compatibility"](t)||hi["CJK Radicals Supplement"](t)||hi["CJK Strokes"](t)||hi["CJK Symbols and Punctuation"](t)&&!(t>=12296&&t<=12305)&&!(t>=12308&&t<=12319)&&12336!==t||hi["CJK Unified Ideographs Extension A"](t)||hi["CJK Unified Ideographs"](t)||hi["Enclosed CJK Letters and Months"](t)||hi["Hangul Compatibility Jamo"](t)||hi["Hangul Jamo Extended-A"](t)||hi["Hangul Jamo Extended-B"](t)||hi["Hangul Jamo"](t)||hi["Hangul Syllables"](t)||hi.Hiragana(t)||hi["Ideographic Description Characters"](t)||hi.Kanbun(t)||hi["Kangxi Radicals"](t)||hi["Katakana Phonetic Extensions"](t)||hi.Katakana(t)&&12540!==t||!(!hi["Halfwidth and Fullwidth Forms"](t)||65288===t||65289===t||65293===t||t>=65306&&t<=65310||65339===t||65341===t||65343===t||t>=65371&&t<=65503||65507===t||t>=65512&&t<=65519)||!(!hi["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||hi["Unified Canadian Aboriginal Syllabics"](t)||hi["Unified Canadian Aboriginal Syllabics Extended"](t)||hi["Vertical Forms"](t)||hi["Yijing Hexagram Symbols"](t)||hi["Yi Syllables"](t)||hi["Yi Radicals"](t))}function gi(t){return!(mi(t)||function(t){return!!(hi["Latin-1 Supplement"](t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||hi["General Punctuation"](t)&&(8214===t||8224===t||8225===t||8240===t||8241===t||8251===t||8252===t||8258===t||8263===t||8264===t||8265===t||8273===t)||hi["Letterlike Symbols"](t)||hi["Number Forms"](t)||hi["Miscellaneous Technical"](t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||9003===t||t>=9085&&t<=9114||t>=9150&&t<=9165||9167===t||t>=9169&&t<=9179||t>=9186&&t<=9215)||hi["Control Pictures"](t)&&9251!==t||hi["Optical Character Recognition"](t)||hi["Enclosed Alphanumerics"](t)||hi["Geometric Shapes"](t)||hi["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||hi["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||hi["CJK Symbols and Punctuation"](t)||hi.Katakana(t)||hi["Private Use Area"](t)||hi["CJK Compatibility Forms"](t)||hi["Small Form Variants"](t)||hi["Halfwidth and Fullwidth Forms"](t)||8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t)}(t))}function yi(t){return hi.Arabic(t)||hi["Arabic Supplement"](t)||hi["Arabic Extended-A"](t)||hi["Arabic Presentation Forms-A"](t)||hi["Arabic Presentation Forms-B"](t)}function vi(t){return t>=1424&&t<=2303||hi["Arabic Presentation Forms-A"](t)||hi["Arabic Presentation Forms-B"](t)}function xi(t,e){return!(!e&&vi(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||hi.Khmer(t))}function _i(t){for(var e=0,r=t;e-1&&(ki="error"),Ai&&Ai(t)};function Ei(){Ci.fire(new Pt("pluginStateChange",{pluginStatus:ki,pluginURL:Mi}))}var Ci=new Dt,Ii=function(){return ki},Li=function(){if(ki!==bi||!Mi)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");ki=wi,Ei(),Mi&&Tt({url:Mi},(function(t){t?Si(t):(ki=Ti,Ei())}))},Pi={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return ki===Ti||null!=Pi.applyArabicShaping},isLoading:function(){return ki===wi},setState:function(t){ki=t.pluginStatus,Mi=t.pluginURL},isParsed:function(){return null!=Pi.applyArabicShaping&&null!=Pi.processBidirectionalText&&null!=Pi.processStyledBidirectionalText},getPluginURL:function(){return Mi}},zi=function(t,e){this.zoom=t,e?(this.now=e.now,this.fadeDuration=e.fadeDuration,this.zoomHistory=e.zoomHistory,this.transition=e.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new ui,this.transition={})};zi.prototype.isSupportedScript=function(t){return function(t,e){for(var r=0,n=t;rthis.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*e}};var Di=function(t,e){this.property=t,this.value=e,this.expression=function(t,e){if(Jr(t))return new fn(t,e);if(ln(t)){var r=pn(t,e);if("error"===r.result)throw new Error(r.value.map((function(t){return t.key+": "+t.message})).join(", "));return r.value}var n=t;return"string"==typeof t&&"color"===e.type&&(n=oe.parse(t)),{kind:"constant",evaluate:function(){return n}}}(void 0===e?t.specification.default:e,t.specification)};Di.prototype.isDataDriven=function(){return"source"===this.expression.kind||"composite"===this.expression.kind},Di.prototype.possiblyEvaluate=function(t,e,r){return this.property.possiblyEvaluate(this,t,e,r)};var Oi=function(t){this.property=t,this.value=new Di(t,void 0)};Oi.prototype.transitioned=function(t,e){return new Fi(this.property,this.value,e,f({},t.transition,this.transition),t.now)},Oi.prototype.untransitioned=function(){return new Fi(this.property,this.value,null,{},0)};var Ri=function(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)};Ri.prototype.getValue=function(t){return w(this._values[t].value.value)},Ri.prototype.setValue=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new Oi(this._values[t].property)),this._values[t].value=new Di(this._values[t].property,null===e?void 0:w(e))},Ri.prototype.getTransition=function(t){return w(this._values[t].transition)},Ri.prototype.setTransition=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new Oi(this._values[t].property)),this._values[t].transition=w(e)||void 0},Ri.prototype.serialize=function(){for(var t={},e=0,r=Object.keys(this._values);ethis.end)return this.prior=null,i;if(this.value.isDataDriven())return this.prior=null,i;if(n=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}(o))}return i};var Bi=function(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)};Bi.prototype.possiblyEvaluate=function(t,e,r){for(var n=new Ui(this._properties),i=0,a=Object.keys(this._values);in.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},e.prototype.interpolate=function(t){return t},e}(qi),Gi=function(t){this.specification=t};Gi.prototype.possiblyEvaluate=function(t,e,r,n){if(void 0!==t.value){if("constant"===t.expression.kind){var i=t.expression.evaluate(e,null,{},r,n);return this._calculate(i,i,i,e)}return this._calculate(t.expression.evaluate(new zi(Math.floor(e.zoom-1),e)),t.expression.evaluate(new zi(Math.floor(e.zoom),e)),t.expression.evaluate(new zi(Math.floor(e.zoom+1),e)),e)}},Gi.prototype._calculate=function(t,e,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},Gi.prototype.interpolate=function(t){return t};var Wi=function(t){this.specification=t};Wi.prototype.possiblyEvaluate=function(t,e,r,n){return!!t.expression.evaluate(e,null,{},r,n)},Wi.prototype.interpolate=function(){return!1};var Zi=function(t){for(var e in this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],t){var r=t[e];r.specification.overridable&&this.overridableProperties.push(e);var n=this.defaultPropertyValues[e]=new Di(r,void 0),i=this.defaultTransitionablePropertyValues[e]=new Oi(r);this.defaultTransitioningPropertyValues[e]=i.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=n.possiblyEvaluate({})}};ii("DataDrivenProperty",qi),ii("DataConstantProperty",Vi),ii("CrossFadedDataDrivenProperty",Hi),ii("CrossFadedProperty",Gi),ii("ColorRampProperty",Wi);var Yi="-transition",Xi=function(t){function e(e,r){if(t.call(this),this.id=e.id,this.type=e.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},"custom"!==e.type&&(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,"background"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),r.layout&&(this._unevaluatedLayout=new ji(r.layout)),r.paint)){for(var n in this._transitionablePaint=new Ri(r.paint),e.paint)this.setPaintProperty(n,e.paint[n],{validate:!1});for(var i in e.layout)this.setLayoutProperty(i,e.layout[i],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Ui(r.paint)}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},e.prototype.getLayoutProperty=function(t){return"visibility"===t?this.visibility:this._unevaluatedLayout.getValue(t)},e.prototype.setLayoutProperty=function(t,e,r){if(void 0===r&&(r={}),null!=e){var n="layers."+this.id+".layout."+t;if(this._validate($n,n,t,e,r))return}"visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility=e},e.prototype.getPaintProperty=function(t){return x(t,Yi)?this._transitionablePaint.getTransition(t.slice(0,-11)):this._transitionablePaint.getValue(t)},e.prototype.setPaintProperty=function(t,e,r){if(void 0===r&&(r={}),null!=e){var n="layers."+this.id+".paint."+t;if(this._validate(Xn,n,t,e,r))return!1}if(x(t,Yi))return this._transitionablePaint.setTransition(t.slice(0,-11),e||void 0),!1;var i=this._transitionablePaint._values[t],a="cross-faded-data-driven"===i.property.specification["property-type"],o=i.value.isDataDriven(),s=i.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);var l=this._transitionablePaint._values[t].value;return l.isDataDriven()||o||a||this._handleOverridablePaintPropertyUpdate(t,s,l)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){},e.prototype._handleOverridablePaintPropertyUpdate=function(t,e,r){return!1},e.prototype.isHidden=function(t){return!!(this.minzoom&&t=this.maxzoom)||"none"===this.visibility},e.prototype.updateTransitions=function(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)},e.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},e.prototype.recalculate=function(t,e){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,e)},e.prototype.serialize=function(){var t={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(t.layout=t.layout||{},t.layout.visibility=this.visibility),b(t,(function(t,e){return!(void 0===t||"layout"===e&&!Object.keys(t).length||"paint"===e&&!Object.keys(t).length)}))},e.prototype._validate=function(t,e,r,n,i){return void 0===i&&(i={}),(!i||!1!==i.validate)&&Kn(this,t.call(Zn,{key:e,layerType:this.type,objectKey:r,value:n,styleSpec:Ot,style:{glyphs:!0,sprite:!0}}))},e.prototype.is3D=function(){return!1},e.prototype.isTileClipped=function(){return!1},e.prototype.hasOffscreenPass=function(){return!1},e.prototype.resize=function(){},e.prototype.isStateDependent=function(){for(var t in this.paint._values){var e=this.paint.get(t);if(e instanceof Ni&&Yr(e.property.specification)&&("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent)return!0}return!1},e}(Dt),$i={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Ki=function(t,e){this._structArray=t,this._pos1=e*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},Ji=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function Qi(t,e){void 0===e&&(e=1);var r=0,n=0;return{members:t.map((function(t){var i=function(t){return $i[t].BYTES_PER_ELEMENT}(t.type),a=r=ta(r,Math.max(e,i)),o=t.components||1;return n=Math.max(n,i),r+=i*o,{name:t.name,type:t.type,components:o,offset:a}})),size:ta(r,Math.max(n,e)),alignment:e}}function ta(t,e){return Math.ceil(t/e)*e}Ji.serialize=function(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}},Ji.deserialize=function(t){var e=Object.create(this.prototype);return e.arrayBuffer=t.arrayBuffer,e.length=t.length,e.capacity=t.arrayBuffer.byteLength/e.bytesPerElement,e._refreshViews(),e},Ji.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},Ji.prototype.clear=function(){this.length=0},Ji.prototype.resize=function(t){this.reserve(t),this.length=t},Ji.prototype.reserve=function(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}},Ji.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var ea=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.int16[n+0]=e,this.int16[n+1]=r,t},e}(Ji);ea.prototype.bytesPerElement=4,ii("StructArrayLayout2i4",ea);var ra=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var a=4*t;return this.int16[a+0]=e,this.int16[a+1]=r,this.int16[a+2]=n,this.int16[a+3]=i,t},e}(Ji);ra.prototype.bytesPerElement=8,ii("StructArrayLayout4i8",ra);var na=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i,a)},e.prototype.emplace=function(t,e,r,n,i,a,o){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=a,this.int16[s+5]=o,t},e}(Ji);na.prototype.bytesPerElement=12,ii("StructArrayLayout2i4i12",na);var ia=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i,a)},e.prototype.emplace=function(t,e,r,n,i,a,o){var s=4*t,l=8*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.uint8[l+4]=n,this.uint8[l+5]=i,this.uint8[l+6]=a,this.uint8[l+7]=o,t},e}(Ji);ia.prototype.bytesPerElement=8,ii("StructArrayLayout2i4ub8",ia);var aa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.float32[n+0]=e,this.float32[n+1]=r,t},e}(Ji);aa.prototype.bytesPerElement=8,ii("StructArrayLayout2f8",aa);var oa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,l,c){var u=this.length;return this.resize(u+1),this.emplace(u,t,e,r,n,i,a,o,s,l,c)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,l,c,u){var h=10*t;return this.uint16[h+0]=e,this.uint16[h+1]=r,this.uint16[h+2]=n,this.uint16[h+3]=i,this.uint16[h+4]=a,this.uint16[h+5]=o,this.uint16[h+6]=s,this.uint16[h+7]=l,this.uint16[h+8]=c,this.uint16[h+9]=u,t},e}(Ji);oa.prototype.bytesPerElement=20,ii("StructArrayLayout10ui20",oa);var sa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,l,c,u,h){var p=this.length;return this.resize(p+1),this.emplace(p,t,e,r,n,i,a,o,s,l,c,u,h)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,l,c,u,h,p){var f=12*t;return this.int16[f+0]=e,this.int16[f+1]=r,this.int16[f+2]=n,this.int16[f+3]=i,this.uint16[f+4]=a,this.uint16[f+5]=o,this.uint16[f+6]=s,this.uint16[f+7]=l,this.int16[f+8]=c,this.int16[f+9]=u,this.int16[f+10]=h,this.int16[f+11]=p,t},e}(Ji);sa.prototype.bytesPerElement=24,ii("StructArrayLayout4i4ui4i24",sa);var la=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.float32[i+0]=e,this.float32[i+1]=r,this.float32[i+2]=n,t},e}(Ji);la.prototype.bytesPerElement=12,ii("StructArrayLayout3f12",la);var ca=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){var r=1*t;return this.uint32[r+0]=e,t},e}(Ji);ca.prototype.bytesPerElement=4,ii("StructArrayLayout1ul4",ca);var ua=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,l){var c=this.length;return this.resize(c+1),this.emplace(c,t,e,r,n,i,a,o,s,l)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,l,c){var u=10*t,h=5*t;return this.int16[u+0]=e,this.int16[u+1]=r,this.int16[u+2]=n,this.int16[u+3]=i,this.int16[u+4]=a,this.int16[u+5]=o,this.uint32[h+3]=s,this.uint16[u+8]=l,this.uint16[u+9]=c,t},e}(Ji);ua.prototype.bytesPerElement=20,ii("StructArrayLayout6i1ul2ui20",ua);var ha=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i,a)},e.prototype.emplace=function(t,e,r,n,i,a,o){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=a,this.int16[s+5]=o,t},e}(Ji);ha.prototype.bytesPerElement=12,ii("StructArrayLayout2i2i2i12",ha);var pa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n,i)},e.prototype.emplace=function(t,e,r,n,i,a){var o=4*t,s=8*t;return this.float32[o+0]=e,this.float32[o+1]=r,this.float32[o+2]=n,this.int16[s+6]=i,this.int16[s+7]=a,t},e}(Ji);pa.prototype.bytesPerElement=16,ii("StructArrayLayout2f1f2i16",pa);var fa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var a=12*t,o=3*t;return this.uint8[a+0]=e,this.uint8[a+1]=r,this.float32[o+1]=n,this.float32[o+2]=i,t},e}(Ji);fa.prototype.bytesPerElement=12,ii("StructArrayLayout2ub2f12",fa);var da=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.uint16[i+0]=e,this.uint16[i+1]=r,this.uint16[i+2]=n,t},e}(Ji);da.prototype.bytesPerElement=6,ii("StructArrayLayout3ui6",da);var ma=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,l,c,u,h,p,f,d,m,g){var y=this.length;return this.resize(y+1),this.emplace(y,t,e,r,n,i,a,o,s,l,c,u,h,p,f,d,m,g)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,l,c,u,h,p,f,d,m,g,y){var v=24*t,x=12*t,_=48*t;return this.int16[v+0]=e,this.int16[v+1]=r,this.uint16[v+2]=n,this.uint16[v+3]=i,this.uint32[x+2]=a,this.uint32[x+3]=o,this.uint32[x+4]=s,this.uint16[v+10]=l,this.uint16[v+11]=c,this.uint16[v+12]=u,this.float32[x+7]=h,this.float32[x+8]=p,this.uint8[_+36]=f,this.uint8[_+37]=d,this.uint8[_+38]=m,this.uint32[x+10]=g,this.int16[v+22]=y,t},e}(Ji);ma.prototype.bytesPerElement=48,ii("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",ma);var ga=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,l,c,u,h,p,f,d,m,g,y,v,x,_,b,w,T,A,k,M,S){var E=this.length;return this.resize(E+1),this.emplace(E,t,e,r,n,i,a,o,s,l,c,u,h,p,f,d,m,g,y,v,x,_,b,w,T,A,k,M,S)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,l,c,u,h,p,f,d,m,g,y,v,x,_,b,w,T,A,k,M,S,E){var C=34*t,I=17*t;return this.int16[C+0]=e,this.int16[C+1]=r,this.int16[C+2]=n,this.int16[C+3]=i,this.int16[C+4]=a,this.int16[C+5]=o,this.int16[C+6]=s,this.int16[C+7]=l,this.uint16[C+8]=c,this.uint16[C+9]=u,this.uint16[C+10]=h,this.uint16[C+11]=p,this.uint16[C+12]=f,this.uint16[C+13]=d,this.uint16[C+14]=m,this.uint16[C+15]=g,this.uint16[C+16]=y,this.uint16[C+17]=v,this.uint16[C+18]=x,this.uint16[C+19]=_,this.uint16[C+20]=b,this.uint16[C+21]=w,this.uint16[C+22]=T,this.uint32[I+12]=A,this.float32[I+13]=k,this.float32[I+14]=M,this.float32[I+15]=S,this.float32[I+16]=E,t},e}(Ji);ga.prototype.bytesPerElement=68,ii("StructArrayLayout8i15ui1ul4f68",ga);var ya=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){var r=1*t;return this.float32[r+0]=e,t},e}(Ji);ya.prototype.bytesPerElement=4,ii("StructArrayLayout1f4",ya);var va=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.int16[i+0]=e,this.int16[i+1]=r,this.int16[i+2]=n,t},e}(Ji);va.prototype.bytesPerElement=6,ii("StructArrayLayout3i6",va);var xa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=2*t,a=4*t;return this.uint32[i+0]=e,this.uint16[a+2]=r,this.uint16[a+3]=n,t},e}(Ji);xa.prototype.bytesPerElement=8,ii("StructArrayLayout1ul2ui8",xa);var _a=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.uint16[n+0]=e,this.uint16[n+1]=r,t},e}(Ji);_a.prototype.bytesPerElement=4,ii("StructArrayLayout2ui4",_a);var ba=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){var r=1*t;return this.uint16[r+0]=e,t},e}(Ji);ba.prototype.bytesPerElement=2,ii("StructArrayLayout1ui2",ba);var wa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var a=4*t;return this.float32[a+0]=e,this.float32[a+1]=r,this.float32[a+2]=n,this.float32[a+3]=i,t},e}(Ji);wa.prototype.bytesPerElement=16,ii("StructArrayLayout4f16",wa);var Ta=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},anchorPoint:{configurable:!0}};return r.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},r.x1.get=function(){return this._structArray.int16[this._pos2+2]},r.y1.get=function(){return this._structArray.int16[this._pos2+3]},r.x2.get=function(){return this._structArray.int16[this._pos2+4]},r.y2.get=function(){return this._structArray.int16[this._pos2+5]},r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.anchorPoint.get=function(){return new a(this.anchorPointX,this.anchorPointY)},Object.defineProperties(e.prototype,r),e}(Ki);Ta.prototype.size=20;var Aa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new Ta(this,t)},e}(ua);ii("CollisionBoxArray",Aa);var ka=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},placedOrientation:{configurable:!0},hidden:{configurable:!0},crossTileID:{configurable:!0},associatedIconIndex:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},r.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},r.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},r.segment.get=function(){return this._structArray.uint16[this._pos2+10]},r.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},r.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},r.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},r.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},r.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},r.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},r.placedOrientation.set=function(t){this._structArray.uint8[this._pos1+37]=t},r.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},r.hidden.set=function(t){this._structArray.uint8[this._pos1+38]=t},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+10]=t},r.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(e.prototype,r),e}(Ki);ka.prototype.size=48;var Ma=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new ka(this,t)},e}(ma);ii("PlacedSymbolArray",Ma);var Sa=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},placedIconSymbolIndex:{configurable:!0},verticalPlacedIconSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},verticalIconBoxStartIndex:{configurable:!0},verticalIconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},numVerticalIconVertices:{configurable:!0},useRuntimeCollisionCircles:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0},collisionCircleDiameter:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},r.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},r.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},r.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},r.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},r.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},r.key.get=function(){return this._structArray.uint16[this._pos2+8]},r.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},r.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},r.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},r.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},r.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},r.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},r.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},r.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},r.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},r.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},r.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},r.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},r.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+12]=t},r.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},r.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},r.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},r.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(e.prototype,r),e}(Ki);Sa.prototype.size=68;var Ea=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new Sa(this,t)},e}(ga);ii("SymbolInstanceArray",Ea);var Ca=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getoffsetX=function(t){return this.float32[1*t+0]},e}(ya);ii("GlyphOffsetArray",Ca);var Ia=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getx=function(t){return this.int16[3*t+0]},e.prototype.gety=function(t){return this.int16[3*t+1]},e.prototype.gettileUnitDistanceFromAnchor=function(t){return this.int16[3*t+2]},e}(va);ii("SymbolLineVertexArray",Ia);var La=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(e.prototype,r),e}(Ki);La.prototype.size=8;var Pa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new La(this,t)},e}(xa);ii("FeatureIndexArray",Pa);var za=Qi([{name:"a_pos",components:2,type:"Int16"}],4).members,Da=function(t){void 0===t&&(t=[]),this.segments=t};function Oa(t,e){return 256*(t=h(Math.floor(t),0,255))+h(Math.floor(e),0,255)}Da.prototype.prepareSegment=function(t,e,r,n){var i=this.segments[this.segments.length-1];return t>Da.MAX_VERTEX_ARRAY_LENGTH&&A("Max vertices per segment is "+Da.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+t),(!i||i.vertexLength+t>Da.MAX_VERTEX_ARRAY_LENGTH||i.sortKey!==n)&&(i={vertexOffset:e.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},void 0!==n&&(i.sortKey=n),this.segments.push(i)),i},Da.prototype.get=function(){return this.segments},Da.prototype.destroy=function(){for(var t=0,e=this.segments;t>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<13|i>>>19))+((5*(i>>>16)&65535)<<16)&4294967295))+((58964+(a>>>16)&65535)<<16);switch(l=0,r){case 3:l^=(255&t.charCodeAt(c+2))<<16;case 2:l^=(255&t.charCodeAt(c+1))<<8;case 1:i^=l=(65535&(l=(l=(65535&(l^=255&t.charCodeAt(c)))*o+(((l>>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295}return i^=t.length,i=2246822507*(65535&(i^=i>>>16))+((2246822507*(i>>>16)&65535)<<16)&4294967295,i=3266489909*(65535&(i^=i>>>13))+((3266489909*(i>>>16)&65535)<<16)&4294967295,(i^=i>>>16)>>>0}})),Ba=e((function(t){t.exports=function(t,e){for(var r,n=t.length,i=e^n,a=0;n>=4;)r=1540483477*(65535&(r=255&t.charCodeAt(a)|(255&t.charCodeAt(++a))<<8|(255&t.charCodeAt(++a))<<16|(255&t.charCodeAt(++a))<<24))+((1540483477*(r>>>16)&65535)<<16),i=1540483477*(65535&i)+((1540483477*(i>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),n-=4,++a;switch(n){case 3:i^=(255&t.charCodeAt(a+2))<<16;case 2:i^=(255&t.charCodeAt(a+1))<<8;case 1:i=1540483477*(65535&(i^=255&t.charCodeAt(a)))+((1540483477*(i>>>16)&65535)<<16)}return i=1540483477*(65535&(i^=i>>>13))+((1540483477*(i>>>16)&65535)<<16),(i^=i>>>15)>>>0}})),ja=Fa,Na=Fa,Ua=Ba;ja.murmur3=Na,ja.murmur2=Ua;var Va=function(){this.ids=[],this.positions=[],this.indexed=!1};Va.prototype.add=function(t,e,r,n){this.ids.push(Ha(t)),this.positions.push(e,r,n)},Va.prototype.getPositions=function(t){for(var e=Ha(t),r=0,n=this.ids.length-1;r>1;this.ids[i]>=e?n=i:r=i+1}for(var a=[];this.ids[r]===e;){var o=this.positions[3*r],s=this.positions[3*r+1],l=this.positions[3*r+2];a.push({index:o,start:s,end:l}),r++}return a},Va.serialize=function(t,e){var r=new Float64Array(t.ids),n=new Uint32Array(t.positions);return Ga(r,n,0,r.length-1),e&&e.push(r.buffer,n.buffer),{ids:r,positions:n}},Va.deserialize=function(t){var e=new Va;return e.ids=t.ids,e.positions=t.positions,e.indexed=!0,e};var qa=Math.pow(2,53)-1;function Ha(t){var e=+t;return!isNaN(e)&&e<=qa?e:ja(String(t))}function Ga(t,e,r,n){for(;r>1],a=r-1,o=n+1;;){do{a++}while(t[a]i);if(a>=o)break;Wa(t,a,o),Wa(e,3*a,3*o),Wa(e,3*a+1,3*o+1),Wa(e,3*a+2,3*o+2)}o-ro.x+1||lo.y+1)&&A("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return r}function yo(t,e){return{type:t.type,id:t.id,properties:t.properties,geometry:e?go(t):[]}}function vo(t,e,r,n,i){t.emplaceBack(2*e+(n+1)/2,2*r+(i+1)/2)}var xo=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new ea,this.indexArray=new da,this.segments=new Da,this.programConfigurations=new co(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function _o(t,e){for(var r=0;r1){if(Ao(t,e))return!0;for(var n=0;n1?t.distSqr(r):t.distSqr(r.sub(e)._mult(i)._add(e))}function Eo(t,e){for(var r,n,i,a=!1,o=0;oe.y!=i.y>e.y&&e.x<(i.x-n.x)*(e.y-n.y)/(i.y-n.y)+n.x&&(a=!a);return a}function Co(t,e){for(var r=!1,n=0,i=t.length-1;ne.y!=o.y>e.y&&e.x<(o.x-a.x)*(e.y-a.y)/(o.y-a.y)+a.x&&(r=!r)}return r}function Io(t,e,r){var n=r[0],i=r[2];if(t.xi.x&&e.x>i.x||t.yi.y&&e.y>i.y)return!1;var a=k(t,e,r[0]);return a!==k(t,e,r[1])||a!==k(t,e,r[2])||a!==k(t,e,r[3])}function Lo(t,e,r){var n=e.paint.get(t).value;return"constant"===n.kind?n.value:r.programConfigurations.get(e.id).getMaxValue(t)}function Po(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function zo(t,e,r,n,i){if(!e[0]&&!e[1])return t;var o=a.convert(e)._mult(i);"viewport"===r&&o._rotate(-n);for(var s=[],l=0;l=po||u<0||u>=po)){var h=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),p=h.vertexLength;vo(this.layoutVertexArray,c,u,-1,-1),vo(this.layoutVertexArray,c,u,1,-1),vo(this.layoutVertexArray,c,u,1,1),vo(this.layoutVertexArray,c,u,-1,1),this.indexArray.emplaceBack(p,p+1,p+2),this.indexArray.emplaceBack(p,p+3,p+2),h.vertexLength+=4,h.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{},n)},ii("CircleBucket",xo,{omit:["layers"]});var Do=new Zi({"circle-sort-key":new qi(Ot.layout_circle["circle-sort-key"])}),Oo={paint:new Zi({"circle-radius":new qi(Ot.paint_circle["circle-radius"]),"circle-color":new qi(Ot.paint_circle["circle-color"]),"circle-blur":new qi(Ot.paint_circle["circle-blur"]),"circle-opacity":new qi(Ot.paint_circle["circle-opacity"]),"circle-translate":new Vi(Ot.paint_circle["circle-translate"]),"circle-translate-anchor":new Vi(Ot.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new Vi(Ot.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new Vi(Ot.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new qi(Ot.paint_circle["circle-stroke-width"]),"circle-stroke-color":new qi(Ot.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new qi(Ot.paint_circle["circle-stroke-opacity"])}),layout:Do},Ro=typeof Float32Array<"u"?Float32Array:Array;function Fo(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Bo(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],c=e[6],u=e[7],h=e[8],p=e[9],f=e[10],d=e[11],m=e[12],g=e[13],y=e[14],v=e[15],x=r[0],_=r[1],b=r[2],w=r[3];return t[0]=x*n+_*s+b*h+w*m,t[1]=x*i+_*l+b*p+w*g,t[2]=x*a+_*c+b*f+w*y,t[3]=x*o+_*u+b*d+w*v,x=r[4],_=r[5],b=r[6],w=r[7],t[4]=x*n+_*s+b*h+w*m,t[5]=x*i+_*l+b*p+w*g,t[6]=x*a+_*c+b*f+w*y,t[7]=x*o+_*u+b*d+w*v,x=r[8],_=r[9],b=r[10],w=r[11],t[8]=x*n+_*s+b*h+w*m,t[9]=x*i+_*l+b*p+w*g,t[10]=x*a+_*c+b*f+w*y,t[11]=x*o+_*u+b*d+w*v,x=r[12],_=r[13],b=r[14],w=r[15],t[12]=x*n+_*s+b*h+w*m,t[13]=x*i+_*l+b*p+w*g,t[14]=x*a+_*c+b*f+w*y,t[15]=x*o+_*u+b*d+w*v,t}Math.hypot||(Math.hypot=function(){for(var t=arguments,e=0,r=arguments.length;r--;)e+=t[r]*t[r];return Math.sqrt(e)});var jo,No=Bo;function Uo(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,t}jo=new Ro(3),Ro!=Float32Array&&(jo[0]=0,jo[1]=0,jo[2]=0),function(){var t=new Ro(4);Ro!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0)}();var Vo=(function(){var t=new Ro(2);Ro!=Float32Array&&(t[0]=0,t[1]=0)}(),function(t){function e(e){t.call(this,e,Oo)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createBucket=function(t){return new xo(t)},e.prototype.queryRadius=function(t){var e=t;return Lo("circle-radius",this,e)+Lo("circle-stroke-width",this,e)+Po(this.paint.get("circle-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,a,o,s){for(var l=zo(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),a.angle,o),c=this.paint.get("circle-radius").evaluate(e,r)+this.paint.get("circle-stroke-width").evaluate(e,r),u="map"===this.paint.get("circle-pitch-alignment"),h=u?l:function(t,e){return t.map((function(t){return qo(t,e)}))}(l,s),p=u?c*o:c,f=0,d=n;ft.width||i.height>t.height||r.x>t.width-i.width||r.y>t.height-i.height)throw new RangeError("out of range source coordinates for image copy");if(i.width>e.width||i.height>e.height||n.x>e.width-i.width||n.y>e.height-i.height)throw new RangeError("out of range destination coordinates for image copy");for(var o=t.data,s=e.data,l=0;l80*r){n=a=t[0],i=o=t[1];for(var d=r;da&&(a=s),l>o&&(o=l);c=0!==(c=Math.max(a-n,o-i))?1/c:0}return ss(p,f,r,n,i,c),f}function as(t,e,r,n,i){var a,o;if(i===Cs(t,e,r,n)>0)for(a=e;a=e;a-=n)o=Ms(a,t[a],t[a+1],o);return o&&_s(o,o.next)&&(Ss(o),o=o.next),o}function os(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!_s(n,n.next)&&0!==xs(n.prev,n,n.next))n=n.next;else{if(Ss(n),(n=e=n.prev)===n.next)break;r=!0}}while(r||n!==e);return e}function ss(t,e,r,n,i,a,o){if(t){!o&&a&&function(t,e,r,n){var i=t;do{null===i.z&&(i.z=ms(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,r,n,i,a,o,s,l,c=1;do{for(r=t,t=null,a=null,o=0;r;){for(o++,n=r,s=0,e=0;e0||l>0&&n;)0!==s&&(0===l||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,l--),a?a.nextZ=i:t=i,i.prevZ=a,a=i;r=n}a.nextZ=null,c*=2}while(o>1)}(i)}(t,n,i,a);for(var s,l,c=t;t.prev!==t.next;)if(s=t.prev,l=t.next,a?cs(t,n,i,a):ls(t))e.push(s.i/r),e.push(t.i/r),e.push(l.i/r),Ss(t),t=l.next,c=l.next;else if((t=l)===c){o?1===o?ss(t=us(os(t),e,r),e,r,n,i,a,2):2===o&&hs(t,e,r,n,i,a):ss(os(t),e,r,n,i,a,1);break}}}function ls(t){var e=t.prev,r=t,n=t.next;if(xs(e,r,n)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(ys(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&xs(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function cs(t,e,r,n){var i=t.prev,a=t,o=t.next;if(xs(i,a,o)>=0)return!1;for(var s=i.xa.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,u=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,h=ms(s,l,e,r,n),p=ms(c,u,e,r,n),f=t.prevZ,d=t.nextZ;f&&f.z>=h&&d&&d.z<=p;){if(f!==t.prev&&f!==t.next&&ys(i.x,i.y,a.x,a.y,o.x,o.y,f.x,f.y)&&xs(f.prev,f,f.next)>=0||(f=f.prevZ,d!==t.prev&&d!==t.next&&ys(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&xs(d.prev,d,d.next)>=0))return!1;d=d.nextZ}for(;f&&f.z>=h;){if(f!==t.prev&&f!==t.next&&ys(i.x,i.y,a.x,a.y,o.x,o.y,f.x,f.y)&&xs(f.prev,f,f.next)>=0)return!1;f=f.prevZ}for(;d&&d.z<=p;){if(d!==t.prev&&d!==t.next&&ys(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&xs(d.prev,d,d.next)>=0)return!1;d=d.nextZ}return!0}function us(t,e,r){var n=t;do{var i=n.prev,a=n.next.next;!_s(i,a)&&bs(i,n,n.next,a)&&As(i,a)&&As(a,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(a.i/r),Ss(n),Ss(n.next),n=t=a),n=n.next}while(n!==t);return os(n)}function hs(t,e,r,n,i,a){var o=t;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&vs(o,s)){var l=ks(o,s);return o=os(o,o.next),l=os(l,l.next),ss(o,e,r,n,i,a),void ss(l,e,r,n,i,a)}s=s.next}o=o.next}while(o!==t)}function ps(t,e){return t.x-e.x}function fs(t,e){if(e=function(t,e){var r,n=e,i=t.x,a=t.y,o=-1/0;do{if(a<=n.y&&a>=n.next.y&&n.next.y!==n.y){var s=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>o){if(o=s,s===i){if(a===n.y)return n;if(a===n.next.y)return n.next}r=n.x=n.x&&n.x>=u&&i!==n.x&&ys(ar.x||n.x===r.x&&ds(r,n)))&&(r=n,p=l)),n=n.next}while(n!==c);return r}(t,e),e){var r=ks(e,t);os(e,e.next),os(r,r.next)}}function ds(t,e){return xs(t.prev,t,e.prev)<0&&xs(e.next,t,t.next)<0}function ms(t,e,r,n,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function gs(t){var e=t,r=t;do{(e.x=0&&(t-o)*(n-s)-(r-o)*(e-s)>=0&&(r-o)*(a-s)-(i-o)*(n-s)>=0}function vs(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&bs(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(As(t,e)&&As(e,t)&&function(t,e){var r=t,n=!1,i=(t.x+e.x)/2,a=(t.y+e.y)/2;do{r.y>a!=r.next.y>a&&r.next.y!==r.y&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}(t,e)&&(xs(t.prev,t,e.prev)||xs(t,e.prev,e))||_s(t,e)&&xs(t.prev,t,t.next)>0&&xs(e.prev,e,e.next)>0)}function xs(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function _s(t,e){return t.x===e.x&&t.y===e.y}function bs(t,e,r,n){var i=Ts(xs(t,e,r)),a=Ts(xs(t,e,n)),o=Ts(xs(r,n,t)),s=Ts(xs(r,n,e));return!!(i!==a&&o!==s||0===i&&ws(t,r,e)||0===a&&ws(t,n,e)||0===o&&ws(r,t,n)||0===s&&ws(r,e,n))}function ws(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function Ts(t){return t>0?1:t<0?-1:0}function As(t,e){return xs(t.prev,t,t.next)<0?xs(t,e,t.next)>=0&&xs(t,t.prev,e)>=0:xs(t,e,t.prev)<0||xs(t,t.next,e)<0}function ks(t,e){var r=new Es(t.i,t.x,t.y),n=new Es(e.i,e.x,e.y),i=t.next,a=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function Ms(t,e,r,n){var i=new Es(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function Ss(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Es(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Cs(t,e,r,n){for(var i=0,a=e,o=r-n;ar;){if(n-r>600){var a=n-r+1,o=e-r+1,s=Math.log(a),l=.5*Math.exp(2*s/3),c=.5*Math.sqrt(s*l*(a-l)/a)*(o-a/2<0?-1:1);Ls(t,e,Math.max(r,Math.floor(e-o*l/a+c)),Math.min(n,Math.floor(e+(a-o)*l/a+c)),i)}var u=t[e],h=r,p=n;for(Ps(t,r,e),i(t[n],u)>0&&Ps(t,r,n);h0;)p--}0===i(t[r],u)?Ps(t,r,p):Ps(t,++p,n),p<=e&&(r=p+1),e<=p&&(n=p-1)}}function Ps(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function zs(t,e){return te?1:0}function Ds(t,e){var r=t.length;if(r<=1)return[t];for(var n,i,a=[],o=0;o1)for(var l=0;l0&&(n+=t[i-1].length,r.holes.push(n))}return r},rs.default=ns;var Bs=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new ea,this.indexArray=new da,this.indexArray2=new _a,this.programConfigurations=new co(t.layers,t.zoom),this.segments=new Da,this.segments2=new Da,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};Bs.prototype.populate=function(t,e,r){this.hasPattern=Rs("fill",this.layers,e);for(var n=this.layers[0].layout.get("fill-sort-key"),i=[],a=0,o=t;a>3}if(i--,1===n||2===n)o+=t.readSVarint(),s+=t.readSVarint(),1===n&&(e&&l.push(e),e=[]),e.push(new a(o,s));else{if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone())}}return e&&l.push(e),l},Hs.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,n=0,i=0,a=0,o=1/0,s=-1/0,l=1/0,c=-1/0;t.pos>3}if(n--,1===r||2===r)(i+=t.readSVarint())s&&(s=i),(a+=t.readSVarint())c&&(c=a);else if(7!==r)throw new Error("unknown command "+r)}return[o,l,s,c]},Hs.prototype.toGeoJSON=function(t,e,r){var n,i,a=this.extent*Math.pow(2,r),o=this.extent*t,s=this.extent*e,l=this.loadGeometry(),c=Hs.types[this.type];function u(t){for(var e=0;e>3;e=1===n?t.readString():2===n?t.readFloat():3===n?t.readDouble():4===n?t.readVarint64():5===n?t.readVarint():6===n?t.readSVarint():7===n?t.readBoolean():null}return e}(r))}Ys.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new qs(this._pbf,e,this.extent,this._keys,this._values)};function $s(t,e,r){if(3===t){var n=new Zs(r,r.readVarint()+r.pos);n.length&&(e[n.name]=n)}}var Ks={VectorTile:function(t,e){this.layers=t.readFields($s,{},e)},VectorTileFeature:qs,VectorTileLayer:Zs},Js=Ks.VectorTileFeature.types,Qs=Math.pow(2,13);function tl(t,e,r,n,i,a,o,s){t.emplaceBack(e,r,2*Math.floor(n*Qs)+o,i*Qs*2,a*Qs*2,Math.round(s))}var el=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new na,this.indexArray=new da,this.programConfigurations=new co(t.layers,t.zoom),this.segments=new Da,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function rl(t,e){return t.x===e.x&&(t.x<0||t.x>po)||t.y===e.y&&(t.y<0||t.y>po)}function nl(t){return t.every((function(t){return t.x<0}))||t.every((function(t){return t.x>po}))||t.every((function(t){return t.y<0}))||t.every((function(t){return t.y>po}))}el.prototype.populate=function(t,e,r){this.features=[],this.hasPattern=Rs("fill-extrusion",this.layers,e);for(var n=0,i=t;n=1){var v=d[g-1];if(!rl(y,v)){h.vertexLength+4>Da.MAX_VERTEX_ARRAY_LENGTH&&(h=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var x=y.sub(v)._perp()._unit(),_=v.dist(y);m+_>32768&&(m=0),tl(this.layoutVertexArray,y.x,y.y,x.x,x.y,0,0,m),tl(this.layoutVertexArray,y.x,y.y,x.x,x.y,0,1,m),m+=_,tl(this.layoutVertexArray,v.x,v.y,x.x,x.y,0,0,m),tl(this.layoutVertexArray,v.x,v.y,x.x,x.y,0,1,m);var b=h.vertexLength;this.indexArray.emplaceBack(b,b+2,b+1),this.indexArray.emplaceBack(b+1,b+2,b+3),h.vertexLength+=4,h.primitiveLength+=2}}}}if(h.vertexLength+l>Da.MAX_VERTEX_ARRAY_LENGTH&&(h=this.segments.prepareSegment(l,this.layoutVertexArray,this.indexArray)),"Polygon"===Js[t.type]){for(var w=[],T=[],A=h.vertexLength,k=0,M=s;k=2&&t[l-1].equals(t[l-2]);)l--;for(var c=0;c0;if(T&&y>c){var k=u.dist(f);if(k>2*h){var M=u.sub(u.sub(f)._mult(h/k)._round());this.updateDistance(f,M),this.addCurrentVertex(M,m,0,0,p),f=M}}var S=f&&d,E=S?r:s?"butt":n;if(S&&"round"===E&&(bi&&(E="bevel"),"bevel"===E&&(b>2&&(E="flipbevel"),b100)v=g.mult(-1);else{var C=b*m.add(g).mag()/m.sub(g).mag();v._perp()._mult(C*(A?-1:1))}this.addCurrentVertex(u,v,0,0,p),this.addCurrentVertex(u,v.mult(-1),0,0,p)}else if("bevel"===E||"fakeround"===E){var I=-Math.sqrt(b*b-1),L=A?I:0,P=A?0:I;if(f&&this.addCurrentVertex(u,m,L,P,p),"fakeround"===E)for(var z=Math.round(180*w/Math.PI/20),D=1;D2*h){var N=u.add(d.sub(u)._mult(h/j)._round());this.updateDistance(u,N),this.addCurrentVertex(N,g,0,0,p),u=N}}}}},fl.prototype.addCurrentVertex=function(t,e,r,n,i,a){void 0===a&&(a=!1);var o=e.x+e.y*r,s=e.y-e.x*r,l=-e.x+e.y*n,c=-e.y-e.x*n;this.addHalfVertex(t,o,s,a,!1,r,i),this.addHalfVertex(t,l,c,a,!0,-n,i),this.distance>pl/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(t,e,r,n,i,a))},fl.prototype.addHalfVertex=function(t,e,r,n,i,a,o){var s=t.x,l=t.y,c=.5*(this.lineClips?this.scaledDistance*(pl-1):this.scaledDistance);if(this.layoutVertexArray.emplaceBack((s<<1)+(n?1:0),(l<<1)+(i?1:0),Math.round(63*e)+128,Math.round(63*r)+128,1+(0===a?0:a<0?-1:1)|(63&c)<<2,c>>6),this.lineClips){var u=(this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start);this.layoutVertexArray2.emplaceBack(u,this.lineClipsArray.length)}var h=o.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,h),o.primitiveLength++),i?this.e2=h:this.e1=h},fl.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},fl.prototype.updateDistance=function(t,e){this.distance+=t.dist(e),this.updateScaledDistance()},ii("LineBucket",fl,{omit:["layers","patternFeatures"]});var dl=new Zi({"line-cap":new Vi(Ot.layout_line["line-cap"]),"line-join":new qi(Ot.layout_line["line-join"]),"line-miter-limit":new Vi(Ot.layout_line["line-miter-limit"]),"line-round-limit":new Vi(Ot.layout_line["line-round-limit"]),"line-sort-key":new qi(Ot.layout_line["line-sort-key"])}),ml={paint:new Zi({"line-opacity":new qi(Ot.paint_line["line-opacity"]),"line-color":new qi(Ot.paint_line["line-color"]),"line-translate":new Vi(Ot.paint_line["line-translate"]),"line-translate-anchor":new Vi(Ot.paint_line["line-translate-anchor"]),"line-width":new qi(Ot.paint_line["line-width"]),"line-gap-width":new qi(Ot.paint_line["line-gap-width"]),"line-offset":new qi(Ot.paint_line["line-offset"]),"line-blur":new qi(Ot.paint_line["line-blur"]),"line-dasharray":new Gi(Ot.paint_line["line-dasharray"]),"line-pattern":new Hi(Ot.paint_line["line-pattern"]),"line-gradient":new Wi(Ot.paint_line["line-gradient"])}),layout:dl},gl=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.possiblyEvaluate=function(e,r){return r=new zi(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),t.prototype.possiblyEvaluate.call(this,e,r)},e.prototype.evaluate=function(e,r,n,i){return r=f({},r,{zoom:Math.floor(r.zoom)}),t.prototype.evaluate.call(this,e,r,n,i)},e}(qi),yl=new gl(ml.paint.properties["line-width"].specification);yl.useIntegerZoom=!0;var vl=function(t){function e(e){t.call(this,e,ml),this.gradientVersion=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._handleSpecialPaintPropertyUpdate=function(t){if("line-gradient"===t){var e=this._transitionablePaint._values["line-gradient"].value.expression;this.stepInterpolant=e._styleExpression.expression instanceof Qe,this.gradientVersion=(this.gradientVersion+1)%l}},e.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},e.prototype.recalculate=function(e,r){t.prototype.recalculate.call(this,e,r),this.paint._values["line-floorwidth"]=yl.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)},e.prototype.createBucket=function(t){return new fl(t)},e.prototype.queryRadius=function(t){var e=t,r=xl(Lo("line-width",this,e),Lo("line-gap-width",this,e)),n=Lo("line-offset",this,e);return r/2+Math.abs(n)+Po(this.paint.get("line-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,o,s){var l=zo(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),o.angle,s),c=s/2*xl(this.paint.get("line-width").evaluate(e,r),this.paint.get("line-gap-width").evaluate(e,r)),u=this.paint.get("line-offset").evaluate(e,r);return u&&(n=function(t,e){for(var r=[],n=new a(0,0),i=0;i=3)for(var a=0;a0?e+2*t:t}var _l=Qi([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),bl=Qi([{name:"a_projected_pos",components:3,type:"Float32"}],4),wl=(Qi([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),Qi([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),Tl=(Qi([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]),Qi([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),Al=Qi([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function kl(t,e,r){return t.sections.forEach((function(t){t.text=function(t,e,r){var n=e.layout.get("text-transform").evaluate(r,{});return"uppercase"===n?t=t.toLocaleUpperCase():"lowercase"===n&&(t=t.toLocaleLowerCase()),Pi.applyArabicShaping&&(t=Pi.applyArabicShaping(t)),t}(t.text,e,r)})),t}Qi([{name:"triangle",components:3,type:"Uint16"}]),Qi([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),Qi([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),Qi([{type:"Float32",name:"offsetX"}]),Qi([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var Ml={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"},Sl=24,El=function(t,e,r,n,i){var a,o,s=8*i-n-1,l=(1<>1,u=-7,h=r?i-1:0,p=r?-1:1,f=t[e+h];for(h+=p,a=f&(1<<-u)-1,f>>=-u,u+=s;u>0;a=256*a+t[e+h],h+=p,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=n;u>0;o=256*o+t[e+h],h+=p,u-=8);if(0===a)a=1-c;else{if(a===l)return o?NaN:1/0*(f?-1:1);o+=Math.pow(2,n),a-=c}return(f?-1:1)*o*Math.pow(2,a-n)},Cl=function(t,e,r,n,i,a){var o,s,l,c=8*a-i-1,u=(1<>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:a-1,d=n?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=u):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),(e+=o+h>=1?p/l:p*Math.pow(2,1-h))*l>=2&&(o++,l/=2),o+h>=u?(s=0,o=u):o+h>=1?(s=(e*l-1)*Math.pow(2,i),o+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;t[r+f]=255&s,f+=d,s/=256,i-=8);for(o=o<0;t[r+f]=255&o,f+=d,o/=256,c-=8);t[r+f-d]|=128*m},Il=Ll;function Ll(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}Ll.Varint=0,Ll.Fixed64=1,Ll.Bytes=2,Ll.Fixed32=5;var Pl=4294967296,zl=1/Pl,Dl=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function Ol(t){return t.type===Ll.Bytes?t.readVarint()+t.pos:t.pos+1}function Rl(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i]}function Fl(t,e){for(var r=0;r>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function Yl(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}function Xl(t,e,r){1===t&&r.readMessage($l,e)}function $l(t,e,r){if(3===t){var n=r.readMessage(Kl,{}),i=n.id,a=n.bitmap,o=n.width,s=n.height,l=n.left,c=n.top,u=n.advance;e.push({id:i,bitmap:new Yo({width:o+6,height:s+6},a),metrics:{width:o,height:s,left:l,top:c,advance:u}})}}function Kl(t,e,r){1===t?e.id=r.readVarint():2===t?e.bitmap=r.readBytes():3===t?e.width=r.readVarint():4===t?e.height=r.readVarint():5===t?e.left=r.readSVarint():6===t?e.top=r.readSVarint():7===t&&(e.advance=r.readVarint())}function Jl(t){for(var e=0,r=0,n=0,i=t;n=0;p--){var f=o[p];if(!(h.w>f.w||h.h>f.h)){if(h.x=f.x,h.y=f.y,l=Math.max(l,h.y+h.h),s=Math.max(s,h.x+h.w),h.w===f.w&&h.h===f.h){var d=o.pop();p>3,a=this.pos;this.type=7&n,t(i,e,this),this.pos===a&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=Wl(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=Yl(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=Wl(this.buf,this.pos)+Wl(this.buf,this.pos+4)*Pl;return this.pos+=8,t},readSFixed64:function(){var t=Wl(this.buf,this.pos)+Yl(this.buf,this.pos+4)*Pl;return this.pos+=8,t},readFloat:function(){var t=El(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=El(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,r,n=this.buf;return e=127&(r=n[this.pos++]),r<128||(e|=(127&(r=n[this.pos++]))<<7,r<128)||(e|=(127&(r=n[this.pos++]))<<14,r<128)||(e|=(127&(r=n[this.pos++]))<<21,r<128)?e:function(t,e,r){var n,i,a=r.buf;if(n=(112&(i=a[r.pos++]))>>4,i<128||(n|=(127&(i=a[r.pos++]))<<3,i<128)||(n|=(127&(i=a[r.pos++]))<<10,i<128)||(n|=(127&(i=a[r.pos++]))<<17,i<128)||(n|=(127&(i=a[r.pos++]))<<24,i<128)||(n|=(1&(i=a[r.pos++]))<<31,i<128))return function(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}(t,n,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=n[this.pos]))<<28,t,this)},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&Dl?function(t,e,r){return Dl.decode(t.subarray(e,r))}(this.buf,e,t):function(t,e,r){for(var n="",i=e;i239?4:l>223?3:l>191?2:1;if(i+u>r)break;1===u?l<128&&(c=l):2===u?128==(192&(a=t[i+1]))&&(c=(31&l)<<6|63&a)<=127&&(c=null):3===u?(a=t[i+1],o=t[i+2],128==(192&a)&&128==(192&o)&&((c=(15&l)<<12|(63&a)<<6|63&o)<=2047||c>=55296&&c<=57343)&&(c=null)):4===u&&(a=t[i+1],o=t[i+2],s=t[i+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&((c=(15&l)<<18|(63&a)<<12|(63&o)<<6|63&s)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,u=1):c>65535&&(c-=65536,n+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),n+=String.fromCharCode(c),i+=u}return n}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==Ll.Bytes)return t.push(this.readVarint(e));var r=Ol(this);for(t=t||[];this.pos127;);else if(e===Ll.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Ll.Fixed32)this.pos+=4;else{if(e!==Ll.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e268435455||t<0?function(t,e){var r,n;if(t>=0?(r=t%4294967296|0,n=t/4294967296|0):(n=~(-t/4294967296),4294967295^(r=~(-t%4294967296))?r=r+1|0:(r=0,n=n+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,r){r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos]=127&t}(r,0,e),function(t,e){var r=(7&t)<<4;e.buf[e.pos++]|=r|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t)))))}(n,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(!!t)},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,r){for(var n,i,a=0;a55295&&n<57344){if(!i){n>56319||a+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):i=n;continue}if(n<56320){t[r++]=239,t[r++]=191,t[r++]=189,i=n;continue}n=i-55296<<10|n-56320|65536,i=null}else i&&(t[r++]=239,t[r++]=191,t[r++]=189,i=null);n<128?t[r++]=n:(n<2048?t[r++]=n>>6|192:(n<65536?t[r++]=n>>12|224:(t[r++]=n>>18|240,t[r++]=n>>12&63|128),t[r++]=n>>6&63|128),t[r++]=63&n|128)}return r}(this.buf,t,this.pos);var r=this.pos-e;r>=128&&Rl(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),Cl(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),Cl(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r=128&&Rl(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,Ll.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,Fl,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,Bl,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,Ul,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,jl,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,Nl,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,Vl,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,ql,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,Hl,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,Gl,e)},writeBytesField:function(t,e){this.writeTag(t,Ll.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,Ll.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,Ll.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,Ll.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,Ll.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,Ll.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,Ll.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,Ll.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,Ll.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,Ll.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,!!e)}};var Ql=function(t,e){var r=e.pixelRatio,n=e.version,i=e.stretchX,a=e.stretchY,o=e.content;this.paddedRect=t,this.pixelRatio=r,this.stretchX=i,this.stretchY=a,this.content=o,this.version=n},tc={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};tc.tl.get=function(){return[this.paddedRect.x+1,this.paddedRect.y+1]},tc.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},tc.tlbr.get=function(){return this.tl.concat(this.br)},tc.displaySize.get=function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(Ql.prototype,tc);var ec=function(t,e){var r={},n={};this.haveRenderCallbacks=[];var i=[];this.addImages(t,r,i),this.addImages(e,n,i);var a=Jl(i),o=a.w,s=a.h,l=new Xo({width:o||1,height:s||1});for(var c in t){var u=t[c],h=r[c].paddedRect;Xo.copy(u.data,l,{x:0,y:0},{x:h.x+1,y:h.y+1},u.data)}for(var p in e){var f=e[p],d=n[p].paddedRect,m=d.x+1,g=d.y+1,y=f.data.width,v=f.data.height;Xo.copy(f.data,l,{x:0,y:0},{x:m,y:g},f.data),Xo.copy(f.data,l,{x:0,y:v-1},{x:m,y:g-1},{width:y,height:1}),Xo.copy(f.data,l,{x:0,y:0},{x:m,y:g+v},{width:y,height:1}),Xo.copy(f.data,l,{x:y-1,y:0},{x:m-1,y:g},{width:1,height:v}),Xo.copy(f.data,l,{x:0,y:0},{x:m+y,y:g},{width:1,height:v})}this.image=l,this.iconPositions=r,this.patternPositions=n};ec.prototype.addImages=function(t,e,r){for(var n in t){var i=t[n],a={x:0,y:0,w:i.data.width+2,h:i.data.height+2};r.push(a),e[n]=new Ql(a,i),i.hasRenderCallback&&this.haveRenderCallbacks.push(n)}},ec.prototype.patchUpdatedImages=function(t,e){for(var r in t.dispatchRenderCallbacks(this.haveRenderCallbacks),t.updatedImages)this.patchUpdatedImage(this.iconPositions[r],t.getImage(r),e),this.patchUpdatedImage(this.patternPositions[r],t.getImage(r),e)},ec.prototype.patchUpdatedImage=function(t,e,r){if(t&&e&&t.version!==e.version){t.version=e.version;var n=t.tl,i=n[0],a=n[1];r.update(e.data,void 0,{x:i,y:a})}},ii("ImagePosition",Ql),ii("ImageAtlas",ec);var rc={horizontal:1,vertical:2,horizontalOnly:3},nc=-17,ic=function(){this.scale=1,this.fontStack="",this.imageName=null};ic.forText=function(t,e){var r=new ic;return r.scale=t||1,r.fontStack=e,r},ic.forImage=function(t){var e=new ic;return e.imageName=t,e};var ac=function(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null};function oc(t,e,r,n,i,a,o,s,l,c,u,h,p,f,d,m){var g=ac.fromFeature(t,i);h===rc.vertical&&g.verticalizePunctuation();var y,v=Pi.processBidirectionalText,x=Pi.processStyledBidirectionalText;if(v&&1===g.sections.length){y=[];for(var _=0,b=v(g.toString(),dc(g,c,a,e,n,f,d));_0&&B>k&&(k=B)}else{var j=r[S.fontStack],N=j&&j[C];if(N&&N.rect)P=N.rect,L=N.metrics;else{var U=e[S.fontStack],V=U&&U[C];if(!V)continue;L=V.metrics}I=(b-S.scale)*Sl}O?(t.verticalizable=!0,A.push({glyph:C,imageName:z,x:p,y:f+I,vertical:O,scale:S.scale,fontStack:S.fontStack,sectionIndex:E,metrics:L,rect:P}),p+=D*S.scale+c):(A.push({glyph:C,imageName:z,x:p,y:f+I,vertical:O,scale:S.scale,fontStack:S.fontStack,sectionIndex:E,metrics:L,rect:P}),p+=L.advance*S.scale+c)}if(0!==A.length){var q=p-c;d=Math.max(q,d),gc(A,0,A.length-1,g,k)}p=0;var H=a*b+k;T.lineOffset=Math.max(k,w),f+=H,m=Math.max(H,m),++y}else f+=a,++y}var G=f-nc,W=mc(o),Z=W.horizontalAlign,Y=W.verticalAlign;(function(t,e,r,n,i,a,o,s,l){var c,u=(e-r)*i;c=a!==o?-s*n-nc:(-n*l+.5)*o;for(var h=0,p=t;h=0&&n>=t&&sc[this.text.charCodeAt(n)];n--)r--;this.text=this.text.substring(t,r),this.sectionIndex=this.sectionIndex.slice(t,r)},ac.prototype.substring=function(t,e){var r=new ac;return r.text=this.text.substring(t,e),r.sectionIndex=this.sectionIndex.slice(t,e),r.sections=this.sections,r},ac.prototype.toString=function(){return this.text},ac.prototype.getMaxScale=function(){var t=this;return this.sectionIndex.reduce((function(e,r){return Math.max(e,t.sections[r].scale)}),0)},ac.prototype.addTextSection=function(t,e){this.text+=t.text,this.sections.push(ic.forText(t.scale,t.fontStack||e));for(var r=this.sections.length-1,n=0;n=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)};var sc={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},lc={};function cc(t,e,r,n,i,a){if(e.imageName){var o=n[e.imageName];return o?o.displaySize[0]*e.scale*Sl/a+i:0}var s=r[e.fontStack],l=s&&s[t];return l?l.metrics.advance*e.scale+i:0}function uc(t,e,r,n){var i=Math.pow(t-e,2);return n?t=0,u=0,h=0;h-r/2;){if(--o<0)return!1;s-=t[o].dist(a),a=t[o]}s+=t[o].dist(t[o+1]),o++;for(var l=[],c=0;sn;)c-=l.shift().angleDelta;if(c>i)return!1;o++,s+=h.dist(p)}return!0}function kc(t){for(var e=0,r=0;rc){var d=(c-l)/f,m=tr(h.x,p.x,d),g=tr(h.y,p.y,d),y=new vc(m,g,p.angleTo(h),u);return y._round(),!o||Ac(t,y,s,o,e)?y:void 0}l+=f}}function Cc(t,e,r,n,i,a,o,s,l){var c=Mc(n,a,o),u=Sc(n,i),h=u*o,p=0===t[0].x||t[0].x===l||0===t[0].y||t[0].y===l;return e-h=0&&_=0&&b=0&&p+c<=u){var w=new vc(_,b,v,d);w._round(),(!n||Ac(t,w,a,n,i))&&f.push(w)}}h+=y}return!s&&!f.length&&!o&&(f=Ic(t,h/2,r,n,i,a,o,!0,l)),f}function Lc(t,e,r,n,i){for(var o=[],s=0;s=n&&p.x>=n)&&(h.x>=n?h=new a(n,h.y+(p.y-h.y)*((n-h.x)/(p.x-h.x)))._round():p.x>=n&&(p=new a(n,h.y+(p.y-h.y)*((n-h.x)/(p.x-h.x)))._round()),!(h.y>=i&&p.y>=i)&&(h.y>=i?h=new a(h.x+(p.x-h.x)*((i-h.y)/(p.y-h.y)),i)._round():p.y>=i&&(p=new a(h.x+(p.x-h.x)*((i-h.y)/(p.y-h.y)),i)._round()),(!c||!h.equals(c[c.length-1]))&&(c=[h],o.push(c)),c.push(p)))))}return o}function Pc(t,e,r,n){var i=[],o=t.image,s=o.pixelRatio,l=o.paddedRect.w-2,c=o.paddedRect.h-2,u=t.right-t.left,h=t.bottom-t.top,p=o.stretchX||[[0,l]],f=o.stretchY||[[0,c]],d=function(t,e){return t+e[1]-e[0]},m=p.reduce(d,0),g=f.reduce(d,0),y=l-m,v=c-g,x=0,_=m,b=0,w=g,T=0,A=y,k=0,M=v;if(o.content&&n){var S=o.content;x=zc(p,0,S[0]),b=zc(f,0,S[1]),_=zc(p,S[0],S[2]),w=zc(f,S[1],S[3]),T=S[0]-x,k=S[1]-b,A=S[2]-S[0]-_,M=S[3]-S[1]-w}var E=function(n,i,l,c){var p=Oc(n.stretch-x,_,u,t.left),f=Rc(n.fixed-T,A,n.stretch,m),d=Oc(i.stretch-b,w,h,t.top),y=Rc(i.fixed-k,M,i.stretch,g),v=Oc(l.stretch-x,_,u,t.left),S=Rc(l.fixed-T,A,l.stretch,m),E=Oc(c.stretch-b,w,h,t.top),C=Rc(c.fixed-k,M,c.stretch,g),I=new a(p,d),L=new a(v,d),P=new a(v,E),z=new a(p,E),D=new a(f/s,y/s),O=new a(S/s,C/s),R=e*Math.PI/180;if(R){var F=Math.sin(R),B=Math.cos(R),j=[B,-F,F,B];I._matMult(j),L._matMult(j),z._matMult(j),P._matMult(j)}var N=n.stretch+n.fixed,U=l.stretch+l.fixed,V=i.stretch+i.fixed,q=c.stretch+c.fixed;return{tl:I,tr:L,bl:z,br:P,tex:{x:o.paddedRect.x+1+N,y:o.paddedRect.y+1+V,w:U-N,h:q-V},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:D,pixelOffsetBR:O,minFontScaleX:A/s/u,minFontScaleY:M/s/h,isSDF:r}};if(n&&(o.stretchX||o.stretchY))for(var C=Dc(p,y,m),I=Dc(f,v,g),L=0;L0&&(d=Math.max(10,d),this.circleDiameter=d)}else{var m=o.top*s-l,g=o.bottom*s+l,y=o.left*s-l,v=o.right*s+l,x=o.collisionPadding;if(x&&(y-=x[0]*s,m-=x[1]*s,v+=x[2]*s,g+=x[3]*s),u){var _=new a(y,m),b=new a(v,m),w=new a(y,g),T=new a(v,g),A=u*Math.PI/180;_._rotate(A),b._rotate(A),w._rotate(A),T._rotate(A),y=Math.min(_.x,b.x,w.x,T.x),v=Math.max(_.x,b.x,w.x,T.x),m=Math.min(_.y,b.y,w.y,T.y),g=Math.max(_.y,b.y,w.y,T.y)}t.emplaceBack(e.x,e.y,y,m,v,g,r,n,i)}this.boxEndIndex=t.length},Bc=function(t,e){if(void 0===t&&(t=[]),void 0===e&&(e=jc),this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(var r=(this.length>>1)-1;r>=0;r--)this._down(r)};function jc(t,e){return te?1:0}function Nc(t,e,r){void 0===e&&(e=1),void 0===r&&(r=!1);for(var n=1/0,i=1/0,o=-1/0,s=-1/0,l=t[0],c=0;co)&&(o=u.x),(!c||u.y>s)&&(s=u.y)}var h=o-n,p=s-i,f=Math.min(h,p),d=f/2,m=new Bc([],Uc);if(0===f)return new a(n,i);for(var g=n;gv.d||!v.d)&&(v=_,r&&console.log("found best %d after %d probes",Math.round(1e4*_.d)/1e4,x)),!(_.max-v.d<=e)&&(d=_.h/2,m.push(new Vc(_.p.x-d,_.p.y-d,d,t)),m.push(new Vc(_.p.x+d,_.p.y-d,d,t)),m.push(new Vc(_.p.x-d,_.p.y+d,d,t)),m.push(new Vc(_.p.x+d,_.p.y+d,d,t)),x+=4)}return r&&(console.log("num probes: "+x),console.log("best distance: "+v.d)),v.p}function Uc(t,e){return e.max-t.max}function Vc(t,e,r,n){this.p=new a(t,e),this.h=r,this.d=function(t,e){for(var r=!1,n=1/0,i=0;it.y!=u.y>t.y&&t.x<(u.x-c.x)*(t.y-c.y)/(u.y-c.y)+c.x&&(r=!r),n=Math.min(n,So(t,c,u))}return(r?1:-1)*Math.sqrt(n)}(this.p,n),this.max=this.d+this.h*Math.SQRT2}Bc.prototype.push=function(t){this.data.push(t),this.length++,this._up(this.length-1)},Bc.prototype.pop=function(){if(0!==this.length){var t=this.data[0],e=this.data.pop();return this.length--,this.length>0&&(this.data[0]=e,this._down(0)),t}},Bc.prototype.peek=function(){return this.data[0]},Bc.prototype._up=function(t){for(var e=this.data,r=this.compare,n=e[t];t>0;){var i=t-1>>1,a=e[i];if(r(n,a)>=0)break;e[t]=a,t=i}e[t]=n},Bc.prototype._down=function(t){for(var e=this.data,r=this.compare,n=this.length>>1,i=e[t];t=0)break;e[t]=o,t=a}e[t]=i};var qc=Number.POSITIVE_INFINITY;function Hc(t,e){return e[1]!==qc?function(t,e,r){var n=0,i=0;switch(e=Math.abs(e),r=Math.abs(r),t){case"top-right":case"top-left":case"top":i=r-7;break;case"bottom-right":case"bottom-left":case"bottom":i=7-r}switch(t){case"top-right":case"bottom-right":case"right":n=-e;break;case"top-left":case"bottom-left":case"left":n=e}return[n,i]}(t,e[0],e[1]):function(t,e){var r=0,n=0;e<0&&(e=0);var i=e/Math.sqrt(2);switch(t){case"top-right":case"top-left":n=i-7;break;case"bottom-right":case"bottom-left":n=7-i;break;case"bottom":n=7-e;break;case"top":n=e-7}switch(t){case"top-right":case"bottom-right":r=-i;break;case"top-left":case"bottom-left":r=i;break;case"left":r=e;break;case"right":r=-e}return[r,n]}(t,e[0])}function Gc(t){switch(t){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}var Wc=255,Zc=32640;function Yc(t,e,r,n,i,o,s,l,c,u,h,p,f,d,m){var g=function(t,e,r,n,i,o,s,l){for(var c=n.layout.get("text-rotate").evaluate(o,{})*Math.PI/180,u=[],h=0,p=e.positionedLines;hZc&&A(t.layerIds[0]+': Value for "text-size" is >= '+Wc+'. Reduce your "text-size".'):"composite"===y.kind&&((v=[xc*d.compositeTextSizes[0].evaluate(s,{},m),xc*d.compositeTextSizes[1].evaluate(s,{},m)])[0]>Zc||v[1]>Zc)&&A(t.layerIds[0]+': Value for "text-size" is >= '+Wc+'. Reduce your "text-size".'),t.addSymbols(t.text,g,v,l,o,s,u,e,c.lineStartIndex,c.lineLength,f,m);for(var x=0,_=h;x<_.length;x+=1)p[_[x]]=t.text.placedSymbolArray.length-1;return 4*g.length}function Xc(t){for(var e in t)return t[e];return null}function $c(t,e,r,n){var i=t.compareText;if(e in i){for(var a=i[e],o=a.length-1;o>=0;o--)if(n.dist(a[o])0)&&("constant"!==a.value.kind||a.value.value.length>0),c="constant"!==s.value.kind||!!s.value.value||Object.keys(s.parameters).length>0,u=i.get("symbol-sort-key");if(this.features=[],l||c){for(var h=e.iconDependencies,p=e.glyphDependencies,f=e.availableImages,d=new zi(this.zoom),m=0,g=t;m=0;for(var z=0,D=A.sections;z=0;s--)a[s]={x:e[s].x,y:e[s].y,tileUnitDistanceFromAnchor:i},s>0&&(i+=e[s-1].dist(e[s]));for(var l=0;l0},iu.prototype.hasIconData=function(){return this.icon.segments.get().length>0},iu.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},iu.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},iu.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},iu.prototype.addIndicesForPlacedSymbol=function(t,e){for(var r=t.placedSymbolArray.get(e),n=r.vertexStartIndex+4*r.numGlyphs,i=r.vertexStartIndex;i1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var r=0,n=this.symbolInstanceIndexes;r=0&&n.indexOf(t)===r&&e.addIndicesForPlacedSymbol(e.text,t)})),a.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,a.verticalPlacedTextSymbolIndex),a.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,a.placedIconSymbolIndex),a.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,a.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},ii("SymbolBucket",iu,{omit:["layers","collisionBoxArray","features","compareText"]}),iu.MAX_GLYPHS=65535,iu.addDynamicAttributes=tu;var au=new Zi({"symbol-placement":new Vi(Ot.layout_symbol["symbol-placement"]),"symbol-spacing":new Vi(Ot.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Vi(Ot.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new qi(Ot.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Vi(Ot.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Vi(Ot.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new Vi(Ot.layout_symbol["icon-ignore-placement"]),"icon-optional":new Vi(Ot.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Vi(Ot.layout_symbol["icon-rotation-alignment"]),"icon-size":new qi(Ot.layout_symbol["icon-size"]),"icon-text-fit":new Vi(Ot.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Vi(Ot.layout_symbol["icon-text-fit-padding"]),"icon-image":new qi(Ot.layout_symbol["icon-image"]),"icon-rotate":new qi(Ot.layout_symbol["icon-rotate"]),"icon-padding":new Vi(Ot.layout_symbol["icon-padding"]),"icon-keep-upright":new Vi(Ot.layout_symbol["icon-keep-upright"]),"icon-offset":new qi(Ot.layout_symbol["icon-offset"]),"icon-anchor":new qi(Ot.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Vi(Ot.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Vi(Ot.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Vi(Ot.layout_symbol["text-rotation-alignment"]),"text-field":new qi(Ot.layout_symbol["text-field"]),"text-font":new qi(Ot.layout_symbol["text-font"]),"text-size":new qi(Ot.layout_symbol["text-size"]),"text-max-width":new qi(Ot.layout_symbol["text-max-width"]),"text-line-height":new Vi(Ot.layout_symbol["text-line-height"]),"text-letter-spacing":new qi(Ot.layout_symbol["text-letter-spacing"]),"text-justify":new qi(Ot.layout_symbol["text-justify"]),"text-radial-offset":new qi(Ot.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Vi(Ot.layout_symbol["text-variable-anchor"]),"text-anchor":new qi(Ot.layout_symbol["text-anchor"]),"text-max-angle":new Vi(Ot.layout_symbol["text-max-angle"]),"text-writing-mode":new Vi(Ot.layout_symbol["text-writing-mode"]),"text-rotate":new qi(Ot.layout_symbol["text-rotate"]),"text-padding":new Vi(Ot.layout_symbol["text-padding"]),"text-keep-upright":new Vi(Ot.layout_symbol["text-keep-upright"]),"text-transform":new qi(Ot.layout_symbol["text-transform"]),"text-offset":new qi(Ot.layout_symbol["text-offset"]),"text-allow-overlap":new Vi(Ot.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new Vi(Ot.layout_symbol["text-ignore-placement"]),"text-optional":new Vi(Ot.layout_symbol["text-optional"])}),ou=new Zi({"icon-opacity":new qi(Ot.paint_symbol["icon-opacity"]),"icon-color":new qi(Ot.paint_symbol["icon-color"]),"icon-halo-color":new qi(Ot.paint_symbol["icon-halo-color"]),"icon-halo-width":new qi(Ot.paint_symbol["icon-halo-width"]),"icon-halo-blur":new qi(Ot.paint_symbol["icon-halo-blur"]),"icon-translate":new Vi(Ot.paint_symbol["icon-translate"]),"icon-translate-anchor":new Vi(Ot.paint_symbol["icon-translate-anchor"]),"text-opacity":new qi(Ot.paint_symbol["text-opacity"]),"text-color":new qi(Ot.paint_symbol["text-color"],{runtimeType:Zt,getOverride:function(t){return t.textColor},hasOverride:function(t){return!!t.textColor}}),"text-halo-color":new qi(Ot.paint_symbol["text-halo-color"]),"text-halo-width":new qi(Ot.paint_symbol["text-halo-width"]),"text-halo-blur":new qi(Ot.paint_symbol["text-halo-blur"]),"text-translate":new Vi(Ot.paint_symbol["text-translate"]),"text-translate-anchor":new Vi(Ot.paint_symbol["text-translate-anchor"])}),su={paint:ou,layout:au},lu=function(t){this.type=t.property.overrides?t.property.overrides.runtimeType:qt,this.defaultValue=t};lu.prototype.evaluate=function(t){if(t.formattedSection){var e=this.defaultValue.property.overrides;if(e&&e.hasOverride(t.formattedSection))return e.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default},lu.prototype.eachChild=function(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)},lu.prototype.outputDefined=function(){return!1},lu.prototype.serialize=function(){return null},ii("FormatSectionOverride",lu,{omit:["defaultValue"]});var cu=function(t){function e(e){t.call(this,e,su)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.recalculate=function(e,r){if(t.prototype.recalculate.call(this,e,r),"auto"===this.layout.get("icon-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["icon-rotation-alignment"]="map":this.layout._values["icon-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["text-rotation-alignment"]="map":this.layout._values["text-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),"point"===this.layout.get("symbol-placement")){var n=this.layout.get("text-writing-mode");if(n){for(var i=[],a=0,o=n;a",targetMapId:n,sourceMapId:a.mapId})}}},Tu.prototype.receive=function(t){var e=t.data,r=e.id;if(r&&(!e.targetMapId||this.mapId===e.targetMapId))if(""===e.type){delete this.tasks[r];var n=this.cancelCallbacks[r];delete this.cancelCallbacks[r],n&&n()}else S()||e.mustQueue?(this.tasks[r]=e,this.taskQueue.push(r),this.invoker.trigger()):this.processTask(r,e)},Tu.prototype.process=function(){if(this.taskQueue.length){var t=this.taskQueue.shift(),e=this.tasks[t];delete this.tasks[t],this.taskQueue.length&&this.invoker.trigger(),e&&this.processTask(t,e)}},Tu.prototype.processTask=function(t,e){var r=this;if(""===e.type){var n=this.callbacks[t];delete this.callbacks[t],n&&(e.error?n(ci(e.error)):n(null,ci(e.data)))}else{var i=!1,a=I(this.globalScope)?void 0:[],o=e.hasCallback?function(e,n){i=!0,delete r.cancelCallbacks[t],r.target.postMessage({id:t,type:"",sourceMapId:r.mapId,error:e?li(e):null,data:li(n,a)},a)}:function(t){i=!0},s=null,l=ci(e.data);if(this.parent[e.type])s=this.parent[e.type](e.sourceMapId,l,o);else if(this.parent.getWorkerSource){var c=e.type.split(".");s=this.parent.getWorkerSource(e.sourceMapId,c[0],l.source)[c[1]](l,o)}else o(new Error("Could not find function "+e.type));!i&&s&&s.cancel&&(this.cancelCallbacks[t]=s.cancel)}},Tu.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var ku=function(t,e){t&&(e?this.setSouthWest(t).setNorthEast(e):4===t.length?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1]))};ku.prototype.setNorthEast=function(t){return this._ne=t instanceof Su?new Su(t.lng,t.lat):Su.convert(t),this},ku.prototype.setSouthWest=function(t){return this._sw=t instanceof Su?new Su(t.lng,t.lat):Su.convert(t),this},ku.prototype.extend=function(t){var e,r,n=this._sw,i=this._ne;if(t instanceof Su)e=t,r=t;else{if(!(t instanceof ku)){if(Array.isArray(t)){if(4===t.length||t.every(Array.isArray)){var a=t;return this.extend(ku.convert(a))}var o=t;return this.extend(Su.convert(o))}return this}if(e=t._sw,r=t._ne,!e||!r)return this}return n||i?(n.lng=Math.min(e.lng,n.lng),n.lat=Math.min(e.lat,n.lat),i.lng=Math.max(r.lng,i.lng),i.lat=Math.max(r.lat,i.lat)):(this._sw=new Su(e.lng,e.lat),this._ne=new Su(r.lng,r.lat)),this},ku.prototype.getCenter=function(){return new Su((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},ku.prototype.getSouthWest=function(){return this._sw},ku.prototype.getNorthEast=function(){return this._ne},ku.prototype.getNorthWest=function(){return new Su(this.getWest(),this.getNorth())},ku.prototype.getSouthEast=function(){return new Su(this.getEast(),this.getSouth())},ku.prototype.getWest=function(){return this._sw.lng},ku.prototype.getSouth=function(){return this._sw.lat},ku.prototype.getEast=function(){return this._ne.lng},ku.prototype.getNorth=function(){return this._ne.lat},ku.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},ku.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},ku.prototype.isEmpty=function(){return!(this._sw&&this._ne)},ku.prototype.contains=function(t){var e=Su.convert(t),r=e.lng,n=e.lat,i=this._sw.lat<=n&&n<=this._ne.lat,a=this._sw.lng<=r&&r<=this._ne.lng;return this._sw.lng>this._ne.lng&&(a=this._sw.lng>=r&&r>=this._ne.lng),i&&a},ku.convert=function(t){return!t||t instanceof ku?t:new ku(t)};var Mu=6371008.8,Su=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid LngLat object: ("+t+", "+e+")");if(this.lng=+t,this.lat=+e,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};Su.prototype.wrap=function(){return new Su(p(this.lng,-180,180),this.lat)},Su.prototype.toArray=function(){return[this.lng,this.lat]},Su.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},Su.prototype.distanceTo=function(t){var e=Math.PI/180,r=this.lat*e,n=t.lat*e,i=Math.sin(r)*Math.sin(n)+Math.cos(r)*Math.cos(n)*Math.cos((t.lng-this.lng)*e);return Mu*Math.acos(Math.min(i,1))},Su.prototype.toBounds=function(t){void 0===t&&(t=0);var e=360*t/40075017,r=e/Math.cos(Math.PI/180*this.lat);return new ku(new Su(this.lng-r,this.lat-e),new Su(this.lng+r,this.lat+e))},Su.convert=function(t){if(t instanceof Su)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new Su(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new Su(Number("lng"in t?t.lng:t.lon),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")};var Eu=2*Math.PI*Mu;function Cu(t){return Eu*Math.cos(t*Math.PI/180)}function Iu(t){return(180+t)/360}function Lu(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function Pu(t,e){return t/Cu(e)}function zu(t){var e=180-360*t;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90}var Du=function(t,e,r){void 0===r&&(r=0),this.x=+t,this.y=+e,this.z=+r};Du.fromLngLat=function(t,e){void 0===e&&(e=0);var r=Su.convert(t);return new Du(Iu(r.lng),Lu(r.lat),Pu(e,r.lat))},Du.prototype.toLngLat=function(){return new Su(function(t){return 360*t-180}(this.x),zu(this.y))},Du.prototype.toAltitude=function(){return function(t,e){return t*Cu(zu(e))}(this.z,this.y)},Du.prototype.meterInMercatorCoordinateUnits=function(){return 1/Eu*function(t){return 1/Math.cos(t*Math.PI/180)}(zu(this.y))};var Ou=function(t,e,r){this.z=t,this.x=e,this.y=r,this.key=Bu(0,t,t,e,r)};Ou.prototype.equals=function(t){return this.z===t.z&&this.x===t.x&&this.y===t.y},Ou.prototype.url=function(t,e){var r=function(t,e,r){var n=Au(256*t,256*(e=Math.pow(2,r)-e-1),r),i=Au(256*(t+1),256*(e+1),r);return n[0]+","+n[1]+","+i[0]+","+i[1]}(this.x,this.y,this.z),n=function(t,e,r){for(var n,i="",a=t;a>0;a--)i+=(e&(n=1<this.canonical.z?new Fu(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Fu(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)},Fu.prototype.calculateScaledKey=function(t,e){var r=this.canonical.z-t;return t>this.canonical.z?Bu(this.wrap*+e,t,this.canonical.z,this.canonical.x,this.canonical.y):Bu(this.wrap*+e,t,t,this.canonical.x>>r,this.canonical.y>>r)},Fu.prototype.isChildOf=function(t){if(t.wrap!==this.wrap)return!1;var e=this.canonical.z-t.canonical.z;return 0===t.overscaledZ||t.overscaledZ>e&&t.canonical.y===this.canonical.y>>e},Fu.prototype.children=function(t){if(this.overscaledZ>=t)return[new Fu(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var e=this.canonical.z+1,r=2*this.canonical.x,n=2*this.canonical.y;return[new Fu(e,this.wrap,e,r,n),new Fu(e,this.wrap,e,r+1,n),new Fu(e,this.wrap,e,r,n+1),new Fu(e,this.wrap,e,r+1,n+1)]},Fu.prototype.isLessThan=function(t){return this.wrapt.wrap)&&(this.overscaledZt.overscaledZ)&&(this.canonical.xt.canonical.x)&&this.canonical.y=this.dim+1||e<-1||e>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(e+1)*this.stride+(t+1)},ju.prototype._unpackMapbox=function(t,e,r){return(256*t*256+256*e+r)/10-1e4},ju.prototype._unpackTerrarium=function(t,e,r){return 256*t+e+r/256-32768},ju.prototype.getPixels=function(){return new Xo({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},ju.prototype.backfillBorder=function(t,e,r){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");var n=e*this.dim,i=e*this.dim+this.dim,a=r*this.dim,o=r*this.dim+this.dim;switch(e){case-1:n=i-1;break;case 1:i=n+1}switch(r){case-1:a=o-1;break;case 1:o=a+1}for(var s=-e*this.dim,l=-r*this.dim,c=a;c=0&&u[3]>=0&&s.insert(o,u[0],u[1],u[2],u[3])}},Hu.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new Ks.VectorTile(new Il(this.rawTileData)).layers,this.sourceLayerCoder=new Nu(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},Hu.prototype.query=function(t,e,r,n){var i=this;this.loadVTLayers();for(var o=t.params||{},s=po/t.tileSize/t.scale,l=Tn(o.filter),c=t.queryGeometry,u=t.queryPadding*s,h=Wu(c),p=this.grid.query(h.minX-u,h.minY-u,h.maxX+u,h.maxY+u),f=Wu(t.cameraQueryGeometry),d=this.grid3D.query(f.minX-u,f.minY-u,f.maxX+u,f.maxY+u,(function(e,r,n,i){return function(t,e,r,n,i){for(var o=0,s=t;o=l.x&&i>=l.y)return!0}var c=[new a(e,r),new a(e,i),new a(n,i),new a(n,r)];if(t.length>2)for(var u=0,h=c;u=0)return!0;return!1}(a,h)){var p=this.sourceLayerCoder.decode(r),d=this.vtLayers[p].feature(n);if(i.needGeometry){var m=yo(d,!0);if(!i.filter(new zi(this.tileID.overscaledZ),m,this.tileID.canonical))return}else if(!i.filter(new zi(this.tileID.overscaledZ),d))return;for(var g=this.getId(d,p),y=0;yn)i=!1;else if(e)if(this.expirationTimept&&(t.getActor().send("enforceCacheSizeLimit",ht),gt=0)},t.clamp=h,t.clearTileCache=function(t){var e=s.caches.delete(ut);t&&e.catch(t).then((function(){return t()}))},t.clipLine=Lc,t.clone=function(t){var e=new Ro(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},t.clone$1=w,t.clone$2=function(t){var e=new Ro(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},t.collisionCircleLayout=Al,t.config=N,t.create=function(){var t=new Ro(16);return Ro!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},t.create$1=function(){var t=new Ro(9);return Ro!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t},t.create$2=function(){var t=new Ro(4);return Ro!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t},t.createCommonjsModule=e,t.createExpression=cn,t.createLayout=Qi,t.createStyleLayer=function(t){return"custom"===t.type?new du(t):new mu[t.type](t)},t.cross=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2];return t[0]=i*l-a*s,t[1]=a*o-n*l,t[2]=n*s-i*o,t},t.deepEqual=function t(e,r){if(Array.isArray(e)){if(!Array.isArray(r)||e.length!==r.length)return!1;for(var n=0;n0&&(a=1/Math.sqrt(a)),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a,t},t.number=tr,t.offscreenCanvasSupported=yt,t.ortho=function(t,e,r,n,i,a,o){var s=1/(e-r),l=1/(n-i),c=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*l,t[14]=(o+a)*c,t[15]=1,t},t.parseGlyphPBF=function(t){return new Il(t).readFields(Xl,[])},t.pbf=Il,t.performSymbolLayout=function(t,e,r,n,i,a,o){t.createArrays();var s=512*t.overscaling;t.tilePixelRatio=po/s,t.compareText={},t.iconsNeedLinear=!1;var l=t.layers[0].layout,c=t.layers[0]._unevaluatedLayout._values,u={};if("composite"===t.textSizeData.kind){var h=t.textSizeData,p=h.minZoom,f=h.maxZoom;u.compositeTextSizes=[c["text-size"].possiblyEvaluate(new zi(p),o),c["text-size"].possiblyEvaluate(new zi(f),o)]}if("composite"===t.iconSizeData.kind){var d=t.iconSizeData,m=d.minZoom,g=d.maxZoom;u.compositeIconSizes=[c["icon-size"].possiblyEvaluate(new zi(m),o),c["icon-size"].possiblyEvaluate(new zi(g),o)]}u.layoutTextSize=c["text-size"].possiblyEvaluate(new zi(t.zoom+1),o),u.layoutIconSize=c["icon-size"].possiblyEvaluate(new zi(t.zoom+1),o),u.textMaxSize=c["text-size"].possiblyEvaluate(new zi(18));for(var y=l.get("text-line-height")*Sl,v="map"===l.get("text-rotation-alignment")&&"point"!==l.get("symbol-placement"),x=l.get("text-keep-upright"),_=l.get("text-size"),b=function(){var a=T[w],s=l.get("text-font").evaluate(a,{},o).join(","),c=_.evaluate(a,{},o),h=u.layoutTextSize.evaluate(a,{},o),p=u.layoutIconSize.evaluate(a,{},o),f={horizontal:{},vertical:void 0},d=a.text,m=[0,0];if(d){var g=d.toString(),b=l.get("text-letter-spacing").evaluate(a,{},o)*Sl,k=function(t){for(var e=0,r=t;e=po||h.y<0||h.y>=po||function(t,e,r,n,i,a,o,s,l,c,u,h,p,f,d,m,g,y,v,x,_,b,w,T,k){var M,S,E,C,I,L=t.addToLineVertexArray(e,r),P=0,z=0,D=0,O=0,R=-1,F=-1,B={},j=ja(""),N=0,U=0;if(void 0===s._unevaluatedLayout.getValue("text-radial-offset")?(N=(M=s.layout.get("text-offset").evaluate(_,{},T).map((function(t){return t*Sl})))[0],U=M[1]):(N=s.layout.get("text-radial-offset").evaluate(_,{},T)*Sl,U=qc),t.allowVerticalPlacement&&n.vertical){var V=s.layout.get("text-rotate").evaluate(_,{},T)+90,q=n.vertical;C=new Fc(l,e,c,u,h,q,p,f,d,V),o&&(I=new Fc(l,e,c,u,h,o,g,y,d,V))}if(i){var H=s.layout.get("icon-rotate").evaluate(_,{}),G="none"!==s.layout.get("icon-text-fit"),W=Pc(i,H,w,G),Z=o?Pc(o,H,w,G):void 0;E=new Fc(l,e,c,u,h,i,g,y,!1,H),P=4*W.length;var Y=t.iconSizeData,X=null;"source"===Y.kind?(X=[xc*s.layout.get("icon-size").evaluate(_,{})])[0]>Zc&&A(t.layerIds[0]+': Value for "icon-size" is >= '+Wc+'. Reduce your "icon-size".'):"composite"===Y.kind&&((X=[xc*b.compositeIconSizes[0].evaluate(_,{},T),xc*b.compositeIconSizes[1].evaluate(_,{},T)])[0]>Zc||X[1]>Zc)&&A(t.layerIds[0]+': Value for "icon-size" is >= '+Wc+'. Reduce your "icon-size".'),t.addSymbols(t.icon,W,X,x,v,_,!1,e,L.lineStartIndex,L.lineLength,-1,T),R=t.icon.placedSymbolArray.length-1,Z&&(z=4*Z.length,t.addSymbols(t.icon,Z,X,x,v,_,rc.vertical,e,L.lineStartIndex,L.lineLength,-1,T),F=t.icon.placedSymbolArray.length-1)}for(var $ in n.horizontal){var K=n.horizontal[$];if(!S){j=ja(K.text);var J=s.layout.get("text-rotate").evaluate(_,{},T);S=new Fc(l,e,c,u,h,K,p,f,d,J)}var Q=1===K.positionedLines.length;if(D+=Yc(t,e,K,a,s,d,_,m,L,n.vertical?rc.horizontal:rc.horizontalOnly,Q?Object.keys(n.horizontal):[$],B,R,b,T),Q)break}n.vertical&&(O+=Yc(t,e,n.vertical,a,s,d,_,m,L,rc.vertical,["vertical"],B,F,b,T));var tt=S?S.boxStartIndex:t.collisionBoxArray.length,et=S?S.boxEndIndex:t.collisionBoxArray.length,rt=C?C.boxStartIndex:t.collisionBoxArray.length,nt=C?C.boxEndIndex:t.collisionBoxArray.length,it=E?E.boxStartIndex:t.collisionBoxArray.length,at=E?E.boxEndIndex:t.collisionBoxArray.length,ot=I?I.boxStartIndex:t.collisionBoxArray.length,st=I?I.boxEndIndex:t.collisionBoxArray.length,lt=-1,ct=function(t,e){return t&&t.circleDiameter?Math.max(t.circleDiameter,e):e};lt=ct(S,lt),lt=ct(C,lt),lt=ct(E,lt);var ut=(lt=ct(I,lt))>-1?1:0;ut&&(lt*=k/Sl),t.glyphOffsetArray.length>=iu.MAX_GLYPHS&&A("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==_.sortKey&&t.addToSortKeyRanges(t.symbolInstances.length,_.sortKey),t.symbolInstances.emplaceBack(e.x,e.y,B.right>=0?B.right:-1,B.center>=0?B.center:-1,B.left>=0?B.left:-1,B.vertical||-1,R,F,j,tt,et,rt,nt,it,at,ot,st,c,D,O,P,z,ut,0,p,N,U,lt)}(t,h,s,r,n,i,p,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,y,b,k,l,x,w,M,d,e,a,c,u,o)};if("line"===S)for(var L=0,P=Lc(e.geometry,0,0,po,po);L1){var N=Ec(j,T,r.vertical||m,n,24,v);N&&I(j,N)}}else if("Polygon"===e.type)for(var U=0,V=Ds(e.geometry,0);U=A.maxzoom||"none"===A.visibility||(o(T,this.zoom,n),(h[A.id]=A.createBucket({index:u.bucketLayerIDs.length,layers:T,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:g,sourceID:this.source})).populate(y,p,this.tileID.canonical),u.bucketLayerIDs.push(T.map((function(t){return t.id}))))}}}var k,M,S,E,C=t.mapObject(p.glyphDependencies,(function(t){return Object.keys(t).map(Number)}));Object.keys(C).length?a.send("getGlyphs",{uid:this.uid,stacks:C},(function(t,e){k||(k=t,M=e,P.call(l))})):M={};var I=Object.keys(p.iconDependencies);I.length?a.send("getImages",{icons:I,source:this.source,tileID:this.tileID,type:"icons"},(function(t,e){k||(k=t,S=e,P.call(l))})):S={};var L=Object.keys(p.patternDependencies);function P(){if(k)return s(k);if(M&&S&&E){var e=new i(M),r=new t.ImageAtlas(S,E);for(var a in h){var l=h[a];l instanceof t.SymbolBucket?(o(l.layers,this.zoom,n),t.performSymbolLayout(l,M,e.positions,S,r.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):l.hasPattern&&(l instanceof t.LineBucket||l instanceof t.FillBucket||l instanceof t.FillExtrusionBucket)&&(o(l.layers,this.zoom,n),l.addFeatures(p,this.tileID.canonical,r.patternPositions))}this.status="done",s(null,{buckets:t.values(h).filter((function(t){return!t.isEmpty()})),featureIndex:u,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:e.image,imageAtlas:r,glyphMap:this.returnDependencies?M:null,iconMap:this.returnDependencies?S:null,glyphPositions:this.returnDependencies?e.positions:null})}}L.length?a.send("getImages",{icons:L,source:this.source,tileID:this.tileID,type:"patterns"},(function(t,e){k||(k=t,E=e,P.call(l))})):E={},P.call(this)};var l=function(t,e,r,n){this.actor=t,this.layerIndex=e,this.availableImages=r,this.loadVectorData=n||s,this.loading={},this.loaded={}};l.prototype.loadTile=function(e,r){var n=this,i=e.uid;this.loading||(this.loading={});var o=!!(e&&e.request&&e.request.collectResourceTiming)&&new t.RequestPerformance(e.request),s=this.loading[i]=new a(e);s.abort=this.loadVectorData(e,(function(e,a){if(delete n.loading[i],e||!a)return s.status="done",n.loaded[i]=s,r(e);var l=a.rawData,c={};a.expires&&(c.expires=a.expires),a.cacheControl&&(c.cacheControl=a.cacheControl);var u={};if(o){var h=o.finish();h&&(u.resourceTiming=JSON.parse(JSON.stringify(h)))}s.vectorTile=a.vectorTile,s.parse(a.vectorTile,n.layerIndex,n.availableImages,n.actor,(function(e,n){if(e||!n)return r(e);r(null,t.extend({rawTileData:l.slice(0)},n,c,u))})),n.loaded=n.loaded||{},n.loaded[i]=s}))},l.prototype.reloadTile=function(t,e){var r=this,n=this.loaded,i=t.uid,a=this;if(n&&n[i]){var o=n[i];o.showCollisionBoxes=t.showCollisionBoxes;var s=function(t,n){var i=o.reloadCallback;i&&(delete o.reloadCallback,o.parse(o.vectorTile,a.layerIndex,r.availableImages,a.actor,i)),e(t,n)};"parsing"===o.status?o.reloadCallback=s:"done"===o.status&&(o.vectorTile?o.parse(o.vectorTile,this.layerIndex,this.availableImages,this.actor,s):s())}},l.prototype.abortTile=function(t,e){var r=this.loading,n=t.uid;r&&r[n]&&r[n].abort&&(r[n].abort(),delete r[n]),e()},l.prototype.removeTile=function(t,e){var r=this.loaded,n=t.uid;r&&r[n]&&delete r[n],e()};var c=t.window.ImageBitmap,u=function(){this.loaded={}};u.prototype.loadTile=function(e,r){var n=e.uid,i=e.encoding,a=e.rawImageData,o=c&&a instanceof c?this.getImageData(a):a,s=new t.DEMData(n,o,i);this.loaded=this.loaded||{},this.loaded[n]=s,r(null,s)},u.prototype.getImageData=function(e){(!this.offscreenCanvas||!this.offscreenCanvasContext)&&(this.offscreenCanvas=new OffscreenCanvas(e.width,e.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=e.width,this.offscreenCanvas.height=e.height,this.offscreenCanvasContext.drawImage(e,0,0,e.width,e.height);var r=this.offscreenCanvasContext.getImageData(-1,-1,e.width+2,e.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new t.RGBAImage({width:r.width,height:r.height},r.data)},u.prototype.removeTile=function(t){var e=this.loaded,r=t.uid;e&&e[r]&&delete e[r]};var h=function t(e,r){var n,i=e&&e.type;if("FeatureCollection"===i)for(n=0;n=0!=!!e&&t.reverse()}var d=t.vectorTile.VectorTileFeature.prototype.toGeoJSON,m=function(e){this._feature=e,this.extent=t.EXTENT,this.type=e.type,this.properties=e.tags,"id"in e&&!isNaN(e.id)&&(this.id=parseInt(e.id,10))};m.prototype.loadGeometry=function(){if(1===this._feature.type){for(var e=[],r=0,n=this._feature.geometry;r"u"&&(n.push(s),l=n.length-1,a[s]=l),e.writeVarint(l);var c=r.properties[s],u=typeof c;"string"!==u&&"boolean"!==u&&"number"!==u&&(c=JSON.stringify(c));var h=u+":"+c,p=o[h];typeof p>"u"&&(i.push(c),p=i.length-1,o[h]=p),e.writeVarint(p)}}function E(t,e){return(e<<3)+(7&t)}function C(t){return t<<1^t>>31}function I(t,e){for(var r=t.loadGeometry(),n=t.type,i=0,a=0,o=r.length,s=0;s>1;z(t,e,o,n,i,a%2),P(t,e,r,n,o-1,a+1),P(t,e,r,o+1,i,a+1)}}function z(t,e,r,n,i,a){for(;i>n;){if(i-n>600){var o=i-n+1,s=r-n+1,l=Math.log(o),c=.5*Math.exp(2*l/3),u=.5*Math.sqrt(l*c*(o-c)/o)*(s-o/2<0?-1:1);z(t,e,r,Math.max(n,Math.floor(r-s*c/o+u)),Math.min(i,Math.floor(r+(o-s)*c/o+u)),a)}var h=e[2*r+a],p=n,f=i;for(D(t,e,n,r),e[2*i+a]>h&&D(t,e,n,i);ph;)f--}e[2*n+a]===h?D(t,e,n,f):D(t,e,++f,i),f<=r&&(n=f+1),r<=f&&(i=f-1)}}function D(t,e,r,n){O(t,r,n),O(e,2*r,2*n),O(e,2*r+1,2*n+1)}function O(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function R(t,e,r,n){var i=t-r,a=e-n;return i*i+a*a}b.fromVectorTileJs=w,b.fromGeojsonVt=function(t,e){e=e||{};var r={};for(var n in t)r[n]=new v(t[n].features,e),r[n].name=n,r[n].version=e.version,r[n].extent=e.extent;return A({layers:r})},b.GeoJSONWrapper=T;var F=function(t){return t[0]},B=function(t){return t[1]},j=function(t,e,r,n,i){void 0===e&&(e=F),void 0===r&&(r=B),void 0===n&&(n=64),void 0===i&&(i=Float64Array),this.nodeSize=n,this.points=t;for(var a=t.length<65536?Uint16Array:Uint32Array,o=this.ids=new a(t.length),s=this.coords=new i(2*t.length),l=0;l=r&&s<=i&&l>=n&&l<=a&&u.push(t[d]);else{var m=Math.floor((f+p)/2);s=e[2*m],l=e[2*m+1],s>=r&&s<=i&&l>=n&&l<=a&&u.push(t[m]);var g=(h+1)%2;(0===h?r<=s:n<=l)&&(c.push(f),c.push(m-1),c.push(g)),(0===h?i>=s:a>=l)&&(c.push(m+1),c.push(p),c.push(g))}}return u}(this.ids,this.coords,t,e,r,n,this.nodeSize)},j.prototype.within=function(t,e,r){return function(t,e,r,n,i,a){for(var o=[0,t.length-1,0],s=[],l=i*i;o.length;){var c=o.pop(),u=o.pop(),h=o.pop();if(u-h<=a)for(var p=h;p<=u;p++)R(e[2*p],e[2*p+1],r,n)<=l&&s.push(t[p]);else{var f=Math.floor((h+u)/2),d=e[2*f],m=e[2*f+1];R(d,m,r,n)<=l&&s.push(t[f]);var g=(c+1)%2;(0===c?r-i<=d:n-i<=m)&&(o.push(h),o.push(f-1),o.push(g)),(0===c?r+i>=d:n+i>=m)&&(o.push(f+1),o.push(u),o.push(g))}}return s}(this.ids,this.coords,t,e,r,this.nodeSize)};var N={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(t){return t}},U=function(t){this.options=$(Object.create(N),t),this.trees=new Array(this.options.maxZoom+1)};function V(t,e,r,n,i){return{x:t,y:e,zoom:1/0,id:r,parentId:-1,numPoints:n,properties:i}}function q(t,e){var r=t.geometry.coordinates,n=r[0],i=r[1];return{x:W(n),y:Z(i),zoom:1/0,index:e,parentId:-1}}function H(t){return{type:"Feature",id:t.id,properties:G(t),geometry:{type:"Point",coordinates:[Y(t.x),X(t.y)]}}}function G(t){var e=t.numPoints,r=e>=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return $($({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:r})}function W(t){return t/360+.5}function Z(t){var e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function Y(t){return 360*(t-.5)}function X(t){var e=(180-360*t)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}function $(t,e){for(var r in e)t[r]=e[r];return t}function K(t){return t.x}function J(t){return t.y}function Q(t,e,r,n){for(var i,a=n,o=r-e>>1,s=r-e,l=t[e],c=t[e+1],u=t[r],h=t[r+1],p=e+3;pa)i=p,a=f;else if(f===a){var d=Math.abs(p-o);dn&&(i-e>3&&Q(t,e,i,n),t[i+2]=a,r-i>3&&Q(t,i,r,n))}function tt(t,e,r,n,i,a){var o=i-r,s=a-n;if(0!==o||0!==s){var l=((t-r)*o+(e-n)*s)/(o*o+s*s);l>1?(r=i,n=a):l>0&&(r+=o*l,n+=s*l)}return(o=t-r)*o+(s=e-n)*s}function et(t,e,r,n){var i={id:typeof t>"u"?null:t,type:e,geometry:r,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(t){var e=t.geometry,r=t.type;if("Point"===r||"MultiPoint"===r||"LineString"===r)rt(t,e);else if("Polygon"===r||"MultiLineString"===r)for(var n=0;n0&&(o+=n?(i*c-l*a)/2:Math.sqrt(Math.pow(l-i,2)+Math.pow(c-a,2))),i=l,a=c}var u=e.length-3;e[2]=1,Q(e,0,u,r),e[u+2]=1,e.size=Math.abs(o),e.start=0,e.end=e.size}function ot(t,e,r,n){for(var i=0;i1?1:r}function ct(t,e,r,n,i,a,o,s){if(n/=e,a>=(r/=e)&&o=n)return null;for(var l=[],c=0;c=r&&d=n)){var m=[];if("Point"===p||"MultiPoint"===p)ut(h,m,r,n,i);else if("LineString"===p)ht(h,m,r,n,i,!1,s.lineMetrics);else if("MultiLineString"===p)ft(h,m,r,n,i,!1);else if("Polygon"===p)ft(h,m,r,n,i,!0);else if("MultiPolygon"===p)for(var g=0;g=r&&o<=n&&(e.push(t[a]),e.push(t[a+1]),e.push(t[a+2]))}}function ht(t,e,r,n,i,a,o){for(var s,l,c=pt(t),u=0===i?mt:gt,h=t.start,p=0;pr&&(l=u(c,f,d,g,y,r),o&&(c.start=h+s*l)):v>n?x=r&&(l=u(c,f,d,g,y,r),_=!0),x>n&&v<=n&&(l=u(c,f,d,g,y,n),_=!0),!a&&_&&(o&&(c.end=h+s*l),e.push(c),c=pt(t)),o&&(h+=s)}var b=t.length-3;f=t[b],d=t[b+1],m=t[b+2],(v=0===i?f:d)>=r&&v<=n&&dt(c,f,d,m),b=c.length-3,a&&b>=3&&(c[b]!==c[0]||c[b+1]!==c[1])&&dt(c,c[0],c[1],c[2]),c.length&&e.push(c)}function pt(t){var e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function ft(t,e,r,n,i,a){for(var o=0;oo.maxX&&(o.maxX=u),h>o.maxY&&(o.maxY=h)}return o}function wt(t,e,r,n){var i=e.geometry,a=e.type,o=[];if("Point"===a||"MultiPoint"===a)for(var s=0;s0&&e.size<(i?o:n))r.numPoints+=e.length/3;else{for(var s=[],l=0;lo)&&(r.numSimplified++,s.push(e[l]),s.push(e[l+1])),r.numPoints++;i&&function(t,e){for(var r=0,n=0,i=t.length,a=i-2;n0===e)for(n=0,i=t.length;n24)throw new Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw new Error("promoteId and generateId cannot be used together.");var n=function(t,e){var r=[];if("FeatureCollection"===t.type)for(var n=0;n=n;c--){var u=+Date.now();s=this._cluster(s,c),this.trees[c]=new j(s,K,J,a,Float32Array),r&&console.log("z%d: %d clusters in %dms",c,s.length,+Date.now()-u)}return r&&console.timeEnd("total time"),this},U.prototype.getClusters=function(t,e){var r=((t[0]+180)%360+360)%360-180,n=Math.max(-90,Math.min(90,t[1])),i=180===t[2]?180:((t[2]+180)%360+360)%360-180,a=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)r=-180,i=180;else if(r>i){var o=this.getClusters([r,n,180,a],e),s=this.getClusters([-180,n,i,a],e);return o.concat(s)}for(var l=this.trees[this._limitZoom(e)],c=[],u=0,h=l.range(W(r),Z(a),W(i),Z(n));ue&&(d+=v.numPoints||1)}if(d>=s){for(var x=u.x*f,_=u.y*f,b=o&&f>1?this._map(u,!0):null,w=(c<<5)+(e+1)+this.points.length,T=0,A=p;T1)for(var E=0,C=p;E>5},U.prototype._getOriginZoom=function(t){return(t-this.points.length)%32},U.prototype._map=function(t,e){if(t.numPoints)return e?$({},t.properties):t.properties;var r=this.points[t.index].properties,n=this.options.map(r);return e&&n===r?$({},n):n},At.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},At.prototype.splitTile=function(t,e,r,n,i,a,o){for(var s=[t,e,r,n],l=this.options,c=l.debug;s.length;){n=s.pop(),r=s.pop(),e=s.pop(),t=s.pop();var u=1<1&&console.time("creation"),p=this.tiles[h]=bt(t,e,r,n,l),this.tileCoords.push({z:e,x:r,y:n}),c)){c>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,r,n,p.numFeatures,p.numPoints,p.numSimplified),console.timeEnd("creation"));var f="z"+e;this.stats[f]=(this.stats[f]||0)+1,this.total++}if(p.source=t,i){if(e===l.maxZoom||e===i)continue;var d=1<1&&console.time("clipping");var m,g,y,v,x,_,b=.5*l.buffer/l.extent,w=.5-b,T=.5+b,A=1+b;m=g=y=v=null,x=ct(t,u,r-b,r+T,0,p.minX,p.maxX,l),_=ct(t,u,r+w,r+A,0,p.minX,p.maxX,l),t=null,x&&(m=ct(x,u,n-b,n+T,1,p.minY,p.maxY,l),g=ct(x,u,n+w,n+A,1,p.minY,p.maxY,l),x=null),_&&(y=ct(_,u,n-b,n+T,1,p.minY,p.maxY,l),v=ct(_,u,n+w,n+A,1,p.minY,p.maxY,l),_=null),c>1&&console.timeEnd("clipping"),s.push(m||[],e+1,2*r,2*n),s.push(g||[],e+1,2*r,2*n+1),s.push(y||[],e+1,2*r+1,2*n),s.push(v||[],e+1,2*r+1,2*n+1)}}},At.prototype.getTile=function(t,e,r){var n=this.options,i=n.extent,a=n.debug;if(t<0||t>24)return null;var o=1<1&&console.log("drilling down to z%d-%d-%d",t,e,r);for(var l,c=t,u=e,h=r;!l&&c>0;)c--,u=Math.floor(u/2),h=Math.floor(h/2),l=this.tiles[kt(c,u,h)];return l&&l.source?(a>1&&console.log("found parent tile z%d-%d-%d",c,u,h),a>1&&console.time("drilling down"),this.splitTile(l.source,c,u,h,t,e,r),a>1&&console.timeEnd("drilling down"),this.tiles[s]?xt(this.tiles[s],i):null):null};var St=function(e){function r(t,r,n,i){e.call(this,t,r,n,Mt),i&&(this.loadGeoJSON=i)}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.loadData=function(t,e){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=e,this._pendingLoadDataParams=t,this._state&&"Idle"!==this._state?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},r.prototype._loadData=function(){var e=this;if(this._pendingCallback&&this._pendingLoadDataParams){var r=this._pendingCallback,n=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var i=!!(n&&n.request&&n.request.collectResourceTiming)&&new t.RequestPerformance(n.request);this.loadGeoJSON(n,(function(a,o){if(a||!o)return r(a);if("object"!=typeof o)return r(new Error("Input data given to '"+n.source+"' is not a valid GeoJSON object."));h(o,!0);try{if(n.filter){var s=t.createExpression(n.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if("error"===s.result)throw new Error(s.value.map((function(t){return t.key+": "+t.message})).join(", "));var l=o.features.filter((function(t){return s.value.evaluate({zoom:0},t)}));o={type:"FeatureCollection",features:l}}e._geoJSONIndex=n.cluster?new U(function(e){var r=e.superclusterOptions,n=e.clusterProperties;if(!n||!r)return r;for(var i={},a={},o={accumulated:null,zoom:0},s={properties:null},l=Object.keys(n),c=0,u=l;c=0?0:e.button},r.remove=function(t){t.parentNode&&t.parentNode.removeChild(t)};var p=function(e){function r(){e.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new t.RGBAImage({width:1,height:1}),this.dirty=!0}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.isLoaded=function(){return this.loaded},r.prototype.setLoaded=function(t){if(this.loaded!==t&&(this.loaded=t,t)){for(var e=0,r=this.requestors;e=0?1.2:1))}function y(t,e,r,n,i,a,o){for(var s=0;s65535)e(new Error("glyphs > 65535 not supported"));else if(a.ranges[s])e(null,{stack:r,id:i,glyph:o});else{var l=a.requests[s];l||(l=a.requests[s]=[],x.loadGlyphRange(r,s,n.url,n.requestManager,(function(t,e){if(e){for(var r in e)n._doesCharSupportLocalGlyph(+r)||(a.glyphs[+r]=e[+r]);a.ranges[s]=!0}for(var i=0,o=l;i1&&(l=t[++s]);var u=Math.abs(c-l.left),h=Math.abs(c-l.right),p=Math.min(u,h),f=void 0,d=i/r*(n+1);if(l.isDash){var m=n-Math.abs(d);f=Math.sqrt(p*p+m*m)}else f=n-Math.sqrt(p*p+d*d);this.data[o+c]=Math.max(0,Math.min(255,f+128))}},T.prototype.addRegularDash=function(t){for(var e=t.length-1;e>=0;--e){var r=t[e],n=t[e+1];r.zeroLength?t.splice(e,1):n&&n.isDash===r.isDash&&(n.left=r.left,t.splice(e,1))}var i=t[0],a=t[t.length-1];i.isDash===a.isDash&&(i.left=a.left-this.width,a.right=i.right+this.width);for(var o=this.width*this.nextRow,s=0,l=t[s],c=0;c1&&(l=t[++s]);var u=Math.abs(c-l.left),h=Math.abs(c-l.right),p=Math.min(u,h),f=l.isDash?p:-p;this.data[o+c]=Math.max(0,Math.min(255,f+128))}},T.prototype.addDash=function(e,r){var n=r?7:0,i=2*n+1;if(this.nextRow+i>this.height)return t.warnOnce("LineAtlas out of space"),null;for(var a=0,o=0;o=n&&e.x=i&&e.y0&&(l[new t.OverscaledTileID(e.overscaledZ,a,r.z,i,r.y-1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,e.wrap,r.z,r.x,r.y-1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,s,r.z,o,r.y-1).key]={backfilled:!1}),r.y+10&&(n.resourceTiming=e._resourceTiming,e._resourceTiming=[]),e.fire(new t.Event("data",n))}}))},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.setData=function(e){var r=this;return this._data=e,this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(e){if(e)r.fire(new t.ErrorEvent(e));else{var n={dataType:"source",sourceDataType:"content"};r._collectResourceTiming&&r._resourceTiming&&r._resourceTiming.length>0&&(n.resourceTiming=r._resourceTiming,r._resourceTiming=[]),r.fire(new t.Event("data",n))}})),this},r.prototype.getClusterExpansionZoom=function(t,e){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:t,source:this.id},e),this},r.prototype.getClusterChildren=function(t,e){return this.actor.send("geojson.getClusterChildren",{clusterId:t,source:this.id},e),this},r.prototype.getClusterLeaves=function(t,e,r,n){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:t,limit:e,offset:r},n),this},r.prototype._updateWorkerData=function(e){var r=this;this._loaded=!1;var n=t.extend({},this.workerOptions),i=this._data;"string"==typeof i?(n.request=this.map._requestManager.transformRequest(t.browser.resolveURL(i),t.ResourceType.Source),n.request.collectResourceTiming=this._collectResourceTiming):n.data=JSON.stringify(i),this.actor.send(this.type+".loadData",n,(function(t,i){r._removed||i&&i.abandoned||(r._loaded=!0,i&&i.resourceTiming&&i.resourceTiming[r.id]&&(r._resourceTiming=i.resourceTiming[r.id].slice(0)),r.actor.send(r.type+".coalesce",{source:n.source},null),e(t))}))},r.prototype.loaded=function(){return this._loaded},r.prototype.loadTile=function(e,r){var n=this,i=e.actor?"reloadTile":"loadTile";e.actor=this.actor;var a={type:this.type,uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:t.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};e.request=this.actor.send(i,a,(function(t,a){return delete e.request,e.unloadVectorData(),e.aborted?r(null):t?r(t):(e.loadVectorData(a,n.map.painter,"reloadTile"===i),r(null))}))},r.prototype.abortTile=function(t){t.request&&(t.request.cancel(),delete t.request),t.aborted=!0},r.prototype.unloadTile=function(t){t.unloadVectorData(),this.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id})},r.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},r.prototype.serialize=function(){return t.extend({},this._options,{type:this.type,data:this._data})},r.prototype.hasTransition=function(){return!1},r}(t.Evented),L=t.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),P=function(e){function r(t,r,n,i){e.call(this),this.id=t,this.dispatcher=n,this.coordinates=r.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(i),this.options=r}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.load=function(e,r){var n=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this.url=this.options.url,t.getImage(this.map._requestManager.transformRequest(this.url,t.ResourceType.Image),(function(i,a){n._loaded=!0,i?n.fire(new t.ErrorEvent(i)):a&&(n.image=a,e&&(n.coordinates=e),r&&r(),n._finishLoading())}))},r.prototype.loaded=function(){return this._loaded},r.prototype.updateImage=function(t){var e=this;return this.image&&t.url?(this.options.url=t.url,this.load(t.coordinates,(function(){e.texture=null})),this):this},r.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})))},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.setCoordinates=function(e){var r=this;this.coordinates=e;var n=e.map(t.MercatorCoordinate.fromLngLat);this.tileID=function(e){for(var r=1/0,n=1/0,i=-1/0,a=-1/0,o=0,s=e;or.end(0)?this.fire(new t.ErrorEvent(new t.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+r.start(0)+" and "+r.end(0)+"-second mark."))):this.video.currentTime=e}},r.prototype.getVideo=function(){return this.video},r.prototype.onAdd=function(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},r.prototype.prepare=function(){if(!(0===Object.keys(this.tiles).length||this.video.readyState<2)){var e=this.map.painter.context,r=e.gl;for(var n in this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,L.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE),r.texSubImage2D(r.TEXTURE_2D,0,0,0,r.RGBA,r.UNSIGNED_BYTE,this.video)):(this.texture=new t.Texture(e,this.video,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE)),this.tiles){var i=this.tiles[n];"loaded"!==i.state&&(i.state="loaded",i.texture=this.texture)}}},r.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},r.prototype.hasTransition=function(){return this.video&&!this.video.paused},r}(P),D=function(e){function r(r,n,i,a){e.call(this,r,n,i,a),n.coordinates?(!Array.isArray(n.coordinates)||4!==n.coordinates.length||n.coordinates.some((function(t){return!Array.isArray(t)||2!==t.length||t.some((function(t){return"number"!=typeof t}))})))&&this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'missing required property "coordinates"'))),n.animate&&"boolean"!=typeof n.animate&&this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'optional "animate" property must be a boolean value'))),n.canvas?"string"!=typeof n.canvas&&!(n.canvas instanceof t.window.HTMLCanvasElement)&&this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'missing required property "canvas"'))),this.options=n,this.animate=void 0===n.animate||n.animate}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.load=function(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof t.window.HTMLCanvasElement?this.options.canvas:t.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new t.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())},r.prototype.getCanvas=function(){return this.canvas},r.prototype.onAdd=function(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()},r.prototype.onRemove=function(){this.pause()},r.prototype.prepare=function(){var e=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,e=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,e=!0),!this._hasInvalidDimensions()&&0!==Object.keys(this.tiles).length){var r=this.map.painter.context,n=r.gl;for(var i in this.boundsBuffer||(this.boundsBuffer=r.createVertexBuffer(this._boundsArray,L.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(e||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new t.Texture(r,this.canvas,n.RGBA,{premultiply:!0}),this.tiles){var a=this.tiles[i];"loaded"!==a.state&&(a.state="loaded",a.texture=this.texture)}}},r.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},r.prototype.hasTransition=function(){return this._playing},r.prototype._hasInvalidDimensions=function(){for(var t=0,e=[this.canvas.width,this.canvas.height];tthis.max){var o=this._getAndRemoveByKey(this.order[0]);o&&this.onRemove(o)}return this},j.prototype.has=function(t){return t.wrapped().key in this.data},j.prototype.getAndRemove=function(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null},j.prototype._getAndRemoveByKey=function(t){var e=this.data[t].shift();return e.timeout&&clearTimeout(e.timeout),0===this.data[t].length&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),e.value},j.prototype.getByKey=function(t){var e=this.data[t];return e?e[0].value:null},j.prototype.get=function(t){return this.has(t)?this.data[t.wrapped().key][0].value:null},j.prototype.remove=function(t,e){if(!this.has(t))return this;var r=t.wrapped().key,n=void 0===e?0:this.data[r].indexOf(e),i=this.data[r][n];return this.data[r].splice(n,1),i.timeout&&clearTimeout(i.timeout),0===this.data[r].length&&delete this.data[r],this.onRemove(i.value),this.order.splice(this.order.indexOf(r),1),this},j.prototype.setMaxSize=function(t){for(this.max=t;this.order.length>this.max;){var e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this},j.prototype.filter=function(t){var e=[];for(var r in this.data)for(var n=0,i=this.data[r];n1||(Math.abs(r)>1&&(1===Math.abs(r+i)?r+=i:1===Math.abs(r-i)&&(r-=i)),e.dem&&t.dem&&(t.dem.backfillBorder(e.dem,r,n),t.neighboringTiles&&t.neighboringTiles[a]&&(t.neighboringTiles[a].backfilled=!0)))}},r.prototype.getTile=function(t){return this.getTileByID(t.key)},r.prototype.getTileByID=function(t){return this._tiles[t]},r.prototype._retainLoadedChildren=function(t,e,r,n){for(var i in this._tiles){var a=this._tiles[i];if(!(n[i]||!a.hasData()||a.tileID.overscaledZ<=e||a.tileID.overscaledZ>r)){for(var o=a.tileID;a&&a.tileID.overscaledZ>e+1;){var s=a.tileID.scaledTo(a.tileID.overscaledZ-1);(a=this._tiles[s.key])&&a.hasData()&&(o=s)}for(var l=o;l.overscaledZ>e;)if(t[(l=l.scaledTo(l.overscaledZ-1)).key]){n[o.key]=o;break}}}},r.prototype.findLoadedParent=function(t,e){if(t.key in this._loadedParentTiles){var r=this._loadedParentTiles[t.key];return r&&r.tileID.overscaledZ>=e?r:null}for(var n=t.overscaledZ-1;n>=e;n--){var i=t.scaledTo(n),a=this._getLoadedTile(i);if(a)return a}},r.prototype._getLoadedTile=function(t){var e=this._tiles[t.key];return e&&e.hasData()?e:this._cache.getByKey(t.wrapped().key)},r.prototype.updateCacheSize=function(t){var e=(Math.ceil(t.width/this._source.tileSize)+1)*(Math.ceil(t.height/this._source.tileSize)+1),r=Math.floor(5*e),n="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,r):r;this._cache.setMaxSize(n)},r.prototype.handleWrapJump=function(t){var e=(t-(void 0===this._prevLng?t:this._prevLng))/360,r=Math.round(e);if(this._prevLng=t,r){var n={};for(var i in this._tiles){var a=this._tiles[i];a.tileID=a.tileID.unwrapTo(a.tileID.wrap+r),n[a.tileID.key]=a}for(var o in this._tiles=n,this._timers)clearTimeout(this._timers[o]),delete this._timers[o];for(var s in this._tiles){var l=this._tiles[s];this._setTileReloadTimer(s,l)}}},r.prototype.update=function(e){var n=this;if(this.transform=e,this._sourceLoaded&&!this._paused){var i;this.updateCacheSize(e),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?i=e.getVisibleUnwrappedCoordinates(this._source.tileID).map((function(e){return new t.OverscaledTileID(e.canonical.z,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y)})):(i=e.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(i=i.filter((function(t){return n._source.hasTile(t)})))):i=[];var a=e.coveringZoomLevel(this._source),o=Math.max(a-r.maxOverzooming,this._source.minzoom),s=Math.max(a+r.maxUnderzooming,this._source.minzoom),l=this._updateRetainedTiles(i,a);if(zt(this._source.type)){for(var c={},u={},h=0,p=Object.keys(l);hthis._source.maxzoom){var g=d.children(this._source.maxzoom)[0],y=this.getTile(g);if(y&&y.hasData()){n[g.key]=g;continue}}else{var v=d.children(this._source.maxzoom);if(n[v[0].key]&&n[v[1].key]&&n[v[2].key]&&n[v[3].key])continue}for(var x=m.wasRequested(),_=d.overscaledZ-1;_>=a;--_){var b=d.scaledTo(_);if(i[b.key]||(i[b.key]=!0,!(m=this.getTile(b))&&x&&(m=this._addTile(b)),m&&(n[b.key]=b,x=m.wasRequested(),m.hasData())))break}}}return n},r.prototype._updateLoadedParentTileCache=function(){for(var t in this._loadedParentTiles={},this._tiles){for(var e=[],r=void 0,n=this._tiles[t].tileID;n.overscaledZ>0;){if(n.key in this._loadedParentTiles){r=this._loadedParentTiles[n.key];break}e.push(n.key);var i=n.scaledTo(n.overscaledZ-1);if(r=this._getLoadedTile(i))break;n=i}for(var a=0,o=e;a0)&&(e.hasData()&&"reloading"!==e.state?this._cache.add(e.tileID,e,e.getExpiryTimeout()):(e.aborted=!0,this._abortTile(e),this._unloadTile(e))))},r.prototype.clearTiles=function(){for(var t in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(t);this._cache.reset()},r.prototype.tilesIn=function(e,r,n){var i=this,a=[],o=this.transform;if(!o)return a;for(var s=n?o.getCameraQueryGeometry(e):e,l=e.map((function(t){return o.pointCoordinate(t)})),c=s.map((function(t){return o.pointCoordinate(t)})),u=this.getIds(),h=1/0,p=1/0,f=-1/0,d=-1/0,m=0,g=c;m=0&&y[1].y+g>=0){var v=l.map((function(t){return s.getTilePoint(t)})),x=c.map((function(t){return s.getTilePoint(t)}));a.push({tile:n,tileID:s,queryGeometry:v,cameraQueryGeometry:x,scale:m})}}},x=0;x=t.browser.now())return!0}return!1},r.prototype.setFeatureState=function(t,e,r){t=t||"_geojsonTileLayer",this._state.updateState(t,e,r)},r.prototype.removeFeatureState=function(t,e,r){t=t||"_geojsonTileLayer",this._state.removeFeatureState(t,e,r)},r.prototype.getFeatureState=function(t,e){return t=t||"_geojsonTileLayer",this._state.getState(t,e)},r.prototype.setDependencies=function(t,e,r){var n=this._tiles[t];n&&n.setDependencies(e,r)},r.prototype.reloadTilesForDependencies=function(t,e){for(var r in this._tiles)this._tiles[r].hasDependency(t,e)&&this._reloadTile(r,"reloading");this._cache.filter((function(r){return!r.hasDependency(t,e)}))},r}(t.Evented);function Pt(t,e){var r=Math.abs(2*t.wrap)-+(t.wrap<0),n=Math.abs(2*e.wrap)-+(e.wrap<0);return t.overscaledZ-e.overscaledZ||n-r||e.canonical.y-t.canonical.y||e.canonical.x-t.canonical.x}function zt(t){return"raster"===t||"image"===t||"video"===t}function Dt(){return new t.window.Worker(na.workerUrl)}Lt.maxOverzooming=10,Lt.maxUnderzooming=3;var Ot="mapboxgl_preloaded_worker_pool",Rt=function(){this.active={}};Rt.prototype.acquire=function(t){if(!this.workers)for(this.workers=[];this.workers.length0?(i-o)/s:0;return this.points[a].mult(1-l).add(this.points[r].mult(l))};var Kt=function(t,e,r){var n=this.boxCells=[],i=this.circleCells=[];this.xCellCount=Math.ceil(t/r),this.yCellCount=Math.ceil(e/r);for(var a=0;a=-e[0]&&r<=e[0]&&n>=-e[1]&&n<=e[1]}function ne(e,r,n,i,a,o,s,l){var c=i?e.textSizeData:e.iconSizeData,u=t.evaluateSizeForZoom(c,n.transform.zoom),h=[256/n.width*2+1,256/n.height*2+1],p=i?e.text.dynamicLayoutVertexArray:e.icon.dynamicLayoutVertexArray;p.clear();for(var f=e.lineVertexArray,d=i?e.text.placedSymbolArray:e.icon.placedSymbolArray,m=n.transform.width/n.transform.height,g=!1,y=0;yMath.abs(n.x-r.x)*i?{useVertical:!0}:(e===t.WritingMode.vertical?r.yn.x)?{needsFlipping:!0}:null}function oe(e,r,n,i,a,o,s,l,c,u,h,p,f,d){var m,g=r/24,y=e.lineOffsetX*g,v=e.lineOffsetY*g;if(e.numGlyphs>1){var x=e.glyphStartIndex+e.numGlyphs,_=e.lineStartIndex,b=e.lineStartIndex+e.lineLength,w=ie(g,l,y,v,n,h,p,e,c,o,f);if(!w)return{notEnoughRoom:!0};var T=te(w.first.point,s).point,A=te(w.last.point,s).point;if(i&&!n){var k=ae(e.writingMode,T,A,d);if(k)return k}m=[w.first];for(var M=e.glyphStartIndex+1;M0?I.point:se(p,C,S,1,a),P=ae(e.writingMode,S,L,d);if(P)return P}var z=le(g*l.getoffsetX(e.glyphStartIndex),y,v,n,h,p,e.segment,e.lineStartIndex,e.lineStartIndex+e.lineLength,c,o,f);if(!z)return{notEnoughRoom:!0};m=[z]}for(var D=0,O=m;D0?1:-1,m=0;i&&(d*=-1,m=Math.PI),d<0&&(m+=Math.PI);for(var g=d>0?l+s:l+s+1,y=a,v=a,x=0,_=0,b=Math.abs(f),w=[];x+_<=b;){if((g+=d)=c)return null;if(v=y,w.push(y),void 0===(y=p[g])){var T=new t.Point(u.getx(g),u.gety(g)),A=te(T,h);if(A.signedDistanceFromCamera>0)y=p[g]=A.point;else{var k=g-d;y=se(0===x?o:new t.Point(u.getx(k),u.gety(k)),T,v,b-x+1,h)}}x+=_,_=v.dist(y)}var M=(b-x)/_,S=y.sub(v),E=S.mult(M)._add(v);E._add(S._unit()._perp()._mult(n*d));var C=m+Math.atan2(y.y-v.y,y.x-v.x);return w.push(E),{point:E,angle:C,path:w}}Kt.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},Kt.prototype.insert=function(t,e,r,n,i){this._forEachCell(e,r,n,i,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(e),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(i)},Kt.prototype.insertCircle=function(t,e,r,n){this._forEachCell(e-n,r-n,e+n,r+n,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(e),this.circles.push(r),this.circles.push(n)},Kt.prototype._insertBoxCell=function(t,e,r,n,i,a){this.boxCells[i].push(a)},Kt.prototype._insertCircleCell=function(t,e,r,n,i,a){this.circleCells[i].push(a)},Kt.prototype._query=function(t,e,r,n,i,a){if(r<0||t>this.width||n<0||e>this.height)return!i&&[];var o=[];if(t<=0&&e<=0&&this.width<=r&&this.height<=n){if(i)return!0;for(var s=0;s0:o},Kt.prototype._queryCircle=function(t,e,r,n,i){var a=t-r,o=t+r,s=e-r,l=e+r;if(o<0||a>this.width||l<0||s>this.height)return!n&&[];var c=[],u={hitTest:n,circle:{x:t,y:e,radius:r},seenUids:{box:{},circle:{}}};return this._forEachCell(a,s,o,l,this._queryCellCircle,c,u,i),n?c.length>0:c},Kt.prototype.query=function(t,e,r,n,i){return this._query(t,e,r,n,!1,i)},Kt.prototype.hitTest=function(t,e,r,n,i){return this._query(t,e,r,n,!0,i)},Kt.prototype.hitTestCircle=function(t,e,r,n){return this._queryCircle(t,e,r,!0,n)},Kt.prototype._queryCell=function(t,e,r,n,i,a,o,s){var l=o.seenUids,c=this.boxCells[i];if(null!==c)for(var u=this.bboxes,h=0,p=c;h=u[d+0]&&n>=u[d+1]&&(!s||s(this.boxKeys[f]))){if(o.hitTest)return a.push(!0),!0;a.push({key:this.boxKeys[f],x1:u[d],y1:u[d+1],x2:u[d+2],y2:u[d+3]})}}}var m=this.circleCells[i];if(null!==m)for(var g=this.circles,y=0,v=m;yo*o+s*s},Kt.prototype._circleAndRectCollide=function(t,e,r,n,i,a,o){var s=(a-n)/2,l=Math.abs(t-(n+s));if(l>s+r)return!1;var c=(o-i)/2,u=Math.abs(e-(i+c));if(u>c+r)return!1;if(l<=s||u<=c)return!0;var h=l-s,p=u-c;return h*h+p*p<=r*r};var ce=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function ue(t,e){for(var r=0;r=1;L--)I.push(E.path[L]);for(var P=1;P0){for(var R=I[0].clone(),F=I[0].clone(),B=1;B=k.x&&F.x<=M.x&&R.y>=k.y&&F.y<=M.y?[I]:F.xM.x||F.yM.y?[]:t.clipLine([I],k.x,k.y,M.x,M.y)}for(var j=0,N=O;j=this.screenRightBoundary||nthis.screenBottomBoundary},fe.prototype.isInsideGrid=function(t,e,r,n){return r>=0&&t=0&&e0?(this.prevPlacement&&this.prevPlacement.variableOffsets[h.crossTileID]&&this.prevPlacement.placements[h.crossTileID]&&this.prevPlacement.placements[h.crossTileID].text&&(m=this.prevPlacement.variableOffsets[h.crossTileID].anchor),this.variableOffsets[h.crossTileID]={textOffset:g,width:r,height:n,anchor:t,textBoxScale:i,prevAnchor:m},this.markUsedJustification(p,t,h,f),p.allowVerticalPlacement&&(this.markUsedOrientation(p,f,h),this.placedOrientations[h.crossTileID]=f),{shift:y,placedGlyphBoxes:v}):void 0},Te.prototype.placeLayerBucketPart=function(e,r,n){var i=this,a=e.parameters,o=a.bucket,s=a.layout,l=a.posMatrix,c=a.textLabelPlaneMatrix,u=a.labelToScreenMatrix,h=a.textPixelRatio,p=a.holdingForFade,f=a.collisionBoxArray,d=a.partiallyEvaluatedTextSize,m=a.collisionGroup,g=s.get("text-optional"),y=s.get("icon-optional"),v=s.get("text-allow-overlap"),x=s.get("icon-allow-overlap"),_="map"===s.get("text-rotation-alignment"),b="map"===s.get("text-pitch-alignment"),w="none"!==s.get("icon-text-fit"),T="viewport-y"===s.get("symbol-z-order"),A=v&&(x||!o.hasIconData()||y),k=x&&(v||!o.hasTextData()||g);!o.collisionArrays&&f&&o.deserializeCollisionBoxes(f);var M=function(e,a){if(!r[e.crossTileID]){if(p)return void(i.placements[e.crossTileID]=new ye(!1,!1,!1));var f,T=!1,M=!1,S=!0,E=null,C={box:null,offscreen:null},I={box:null,offscreen:null},L=null,P=null,z=0,D=0,O=0;a.textFeatureIndex?z=a.textFeatureIndex:e.useRuntimeCollisionCircles&&(z=e.featureIndex),a.verticalTextFeatureIndex&&(D=a.verticalTextFeatureIndex);var R=a.textBox;if(R){var F=function(r){var n=t.WritingMode.horizontal;if(o.allowVerticalPlacement&&!r&&i.prevPlacement){var a=i.prevPlacement.placedOrientations[e.crossTileID];a&&(i.placedOrientations[e.crossTileID]=a,n=a,i.markUsedOrientation(o,n,e))}return n},B=function(r,n){if(o.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&a.verticalTextBox)for(var i=0,s=o.writingModes;i0&&(j=j.filter((function(t){return t!==N.anchor}))).unshift(N.anchor)}var U=function(t,r,n){for(var a=t.x2-t.x1,s=t.y2-t.y1,c=e.textBoxScale,u=w&&!x?r:null,p={box:[],offscreen:!1},f=v?2*j.length:j.length,d=0;d=j.length,A=i.attemptAnchorPlacement(g,t,a,s,c,_,b,h,l,m,y,e,o,n,u);if(A&&(p=A.placedGlyphBoxes)&&p.box&&p.box.length){T=!0,E=A.shift;break}}return p};B((function(){return U(R,a.iconBox,t.WritingMode.horizontal)}),(function(){var r=a.verticalTextBox,n=C&&C.box&&C.box.length;return o.allowVerticalPlacement&&!n&&e.numVerticalGlyphVertices>0&&r?U(r,a.verticalIconBox,t.WritingMode.vertical):{box:null,offscreen:null}})),C&&(T=C.box,S=C.offscreen);var V=F(C&&C.box);if(!T&&i.prevPlacement){var q=i.prevPlacement.variableOffsets[e.crossTileID];q&&(i.variableOffsets[e.crossTileID]=q,i.markUsedJustification(o,q.anchor,e,V))}}else{var H=function(t,r){var n=i.collisionIndex.placeCollisionBox(t,v,h,l,m.predicate);return n&&n.box&&n.box.length&&(i.markUsedOrientation(o,r,e),i.placedOrientations[e.crossTileID]=r),n};B((function(){return H(R,t.WritingMode.horizontal)}),(function(){var r=a.verticalTextBox;return o.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&r?H(r,t.WritingMode.vertical):{box:null,offscreen:null}})),F(C&&C.box&&C.box.length)}}if(T=(f=C)&&f.box&&f.box.length>0,S=f&&f.offscreen,e.useRuntimeCollisionCircles){var G=o.text.placedSymbolArray.get(e.centerJustifiedTextSymbolIndex),W=t.evaluateSizeForFeature(o.textSizeData,d,G),Z=s.get("text-padding"),Y=e.collisionCircleDiameter;L=i.collisionIndex.placeCollisionCircles(v,G,o.lineVertexArray,o.glyphOffsetArray,W,l,c,u,n,b,m.predicate,Y,Z),T=v||L.circles.length>0&&!L.collisionDetected,S=S&&L.offscreen}if(a.iconFeatureIndex&&(O=a.iconFeatureIndex),a.iconBox){var X=function(t){var e=w&&E?we(t,E.x,E.y,_,b,i.transform.angle):t;return i.collisionIndex.placeCollisionBox(e,x,h,l,m.predicate)};M=I&&I.box&&I.box.length&&a.verticalIconBox?(P=X(a.verticalIconBox)).box.length>0:(P=X(a.iconBox)).box.length>0,S=S&&P.offscreen}var $=g||0===e.numHorizontalGlyphVertices&&0===e.numVerticalGlyphVertices,K=y||0===e.numIconVertices;if($||K?K?$||(M=M&&T):T=M&&T:M=T=M&&T,T&&f&&f.box&&(I&&I.box&&D?i.collisionIndex.insertCollisionBox(f.box,s.get("text-ignore-placement"),o.bucketInstanceId,D,m.ID):i.collisionIndex.insertCollisionBox(f.box,s.get("text-ignore-placement"),o.bucketInstanceId,z,m.ID)),M&&P&&i.collisionIndex.insertCollisionBox(P.box,s.get("icon-ignore-placement"),o.bucketInstanceId,O,m.ID),L&&(T&&i.collisionIndex.insertCollisionCircles(L.circles,s.get("text-ignore-placement"),o.bucketInstanceId,z,m.ID),n)){var J=o.bucketInstanceId,Q=i.collisionCircleArrays[J];void 0===Q&&(Q=i.collisionCircleArrays[J]=new ve);for(var tt=0;tt=0;--E){var C=S[E];M(o.symbolInstances.get(C),o.collisionArrays[C])}else for(var I=e.symbolInstanceStart;I=0&&(e.text.placedSymbolArray.get(c).crossTileID=a>=0&&c!==a?0:n.crossTileID)}},Te.prototype.markUsedOrientation=function(e,r,n){for(var i=r===t.WritingMode.horizontal||r===t.WritingMode.horizontalOnly?r:0,a=r===t.WritingMode.vertical?r:0,o=0,s=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex];o0||l>0,x=a.numIconVertices>0,_=i.placedOrientations[a.crossTileID],b=_===t.WritingMode.vertical,w=_===t.WritingMode.horizontal||_===t.WritingMode.horizontalOnly;if(v){var T=Pe(y.text),A=b?ze:T;d(e.text,s,A);var k=w?ze:T;d(e.text,l,k);var M=y.text.isHidden();[a.rightJustifiedTextSymbolIndex,a.centerJustifiedTextSymbolIndex,a.leftJustifiedTextSymbolIndex].forEach((function(t){t>=0&&(e.text.placedSymbolArray.get(t).hidden=M||b?1:0)})),a.verticalPlacedTextSymbolIndex>=0&&(e.text.placedSymbolArray.get(a.verticalPlacedTextSymbolIndex).hidden=M||w?1:0);var S=i.variableOffsets[a.crossTileID];S&&i.markUsedJustification(e,S.anchor,a,_);var E=i.placedOrientations[a.crossTileID];E&&(i.markUsedJustification(e,"left",a,E),i.markUsedOrientation(e,E,a))}if(x){var C=Pe(y.icon),I=!(p&&a.verticalPlacedIconSymbolIndex&&b);if(a.placedIconSymbolIndex>=0){var L=I?C:ze;d(e.icon,a.numIconVertices,L),e.icon.placedSymbolArray.get(a.placedIconSymbolIndex).hidden=y.icon.isHidden()}if(a.verticalPlacedIconSymbolIndex>=0){var P=I?ze:C;d(e.icon,a.numVerticalIconVertices,P),e.icon.placedSymbolArray.get(a.verticalPlacedIconSymbolIndex).hidden=y.icon.isHidden()}}if(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData()){var z=e.collisionArrays[n];if(z){var D=new t.Point(0,0);if(z.textBox||z.verticalTextBox){var O=!0;if(c){var R=i.variableOffsets[m];R?(D=be(R.anchor,R.width,R.height,R.textOffset,R.textBoxScale),u&&D._rotate(h?i.transform.angle:-i.transform.angle)):O=!1}z.textBox&&Ae(e.textCollisionBox.collisionVertexArray,y.text.placed,!O||b,D.x,D.y),z.verticalTextBox&&Ae(e.textCollisionBox.collisionVertexArray,y.text.placed,!O||w,D.x,D.y)}var F=!(w||!z.verticalIconBox);z.iconBox&&Ae(e.iconCollisionBox.collisionVertexArray,y.icon.placed,F,p?D.x:0,p?D.y:0),z.verticalIconBox&&Ae(e.iconCollisionBox.collisionVertexArray,y.icon.placed,!F,p?D.x:0,p?D.y:0)}}},g=0;gt},Te.prototype.setStale=function(){this.stale=!0};var ke=Math.pow(2,25),Me=Math.pow(2,24),Se=Math.pow(2,17),Ee=Math.pow(2,16),Ce=Math.pow(2,9),Ie=Math.pow(2,8),Le=Math.pow(2,1);function Pe(t){if(0===t.opacity&&!t.placed)return 0;if(1===t.opacity&&t.placed)return 4294967295;var e=t.placed?1:0,r=Math.floor(127*t.opacity);return r*ke+e*Me+r*Se+e*Ee+r*Ce+e*Ie+r*Le+e}var ze=0,De=function(t){this._sortAcrossTiles="viewport-y"!==t.layout.get("symbol-z-order")&&void 0!==t.layout.get("symbol-sort-key").constantOr(1),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};De.prototype.continuePlacement=function(t,e,r,n,i){for(var a=this._bucketParts;this._currentTileIndex2};this._currentPlacementIndex>=0;){var s=r[e[this._currentPlacementIndex]],l=this.placement.collisionIndex.transform.zoom;if("symbol"===s.type&&(!s.minzoom||s.minzoom<=l)&&(!s.maxzoom||s.maxzoom>l)){if(this._inProgressLayer||(this._inProgressLayer=new De(s)),this._inProgressLayer.continuePlacement(n[s.source],this.placement,this._showCollisionBoxes,s,o))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},Oe.prototype.commit=function(t){return this.placement.commit(t),this.placement};var Re=512/t.EXTENT/2,Fe=function(t,e,r){this.tileID=t,this.indexedSymbolInstances={},this.bucketInstanceId=r;for(var n=0;nt.overscaledZ)for(var s in o){var l=o[s];l.tileID.isChildOf(t)&&l.findMatches(e.symbolInstances,t,i)}else{var c=o[t.scaledTo(Number(a)).key];c&&c.findMatches(e.symbolInstances,t,i)}}for(var u=0;u1?"@2x":"",l=t.getJSON(r.transformRequest(r.normalizeSpriteURL(e,s,".json"),t.ResourceType.SpriteJSON),(function(t,e){l=null,o||(o=t,i=e,u())})),c=t.getImage(r.transformRequest(r.normalizeSpriteURL(e,s,".png"),t.ResourceType.SpriteImage),(function(t,e){c=null,o||(o=t,a=e,u())}));function u(){if(o)n(o);else if(i&&a){var e=t.browser.getImageData(a),r={};for(var s in i){var l=i[s],c=l.width,u=l.height,h=l.x,p=l.y,f=l.sdf,d=l.pixelRatio,m=l.stretchX,g=l.stretchY,y=l.content,v=new t.RGBAImage({width:c,height:u});t.RGBAImage.copy(e,v,{x:h,y:p},{x:0,y:0},{width:c,height:u}),r[s]={data:v,pixelRatio:d,sdf:f,stretchX:m,stretchY:g,content:y}}n(null,r)}}return{cancel:function(){l&&(l.cancel(),l=null),c&&(c.cancel(),c=null)}}}(e,this.map._requestManager,(function(e,n){if(r._spriteRequest=null,e)r.fire(new t.ErrorEvent(e));else if(n)for(var i in n)r.imageManager.addImage(i,n[i]);r.imageManager.setLoaded(!0),r._availableImages=r.imageManager.listImages(),r.dispatcher.broadcast("setImages",r._availableImages),r.fire(new t.Event("data",{dataType:"style"}))}))},r.prototype._validateLayer=function(e){var r=this.sourceCaches[e.source];if(r){var n=e.sourceLayer;if(n){var i=r.getSource();("geojson"===i.type||i.vectorLayerIds&&-1===i.vectorLayerIds.indexOf(n))&&this.fire(new t.ErrorEvent(new Error('Source layer "'+n+'" does not exist on source "'+i.id+'" as specified by style layer "'+e.id+'"')))}}},r.prototype.loaded=function(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(var t in this.sourceCaches)if(!this.sourceCaches[t].loaded())return!1;return!!this.imageManager.isLoaded()},r.prototype._serializeLayers=function(t){for(var e=[],r=0,n=t;r0)throw new Error("Unimplemented: "+i.map((function(t){return t.command})).join(", ")+".");return n.forEach((function(t){"setTransition"!==t.command&&r[t.command].apply(r,t.args)})),this.stylesheet=e,!0},r.prototype.addImage=function(e,r){if(this.getImage(e))return this.fire(new t.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(e,r),this._afterImageUpdated(e)},r.prototype.updateImage=function(t,e){this.imageManager.updateImage(t,e)},r.prototype.getImage=function(t){return this.imageManager.getImage(t)},r.prototype.removeImage=function(e){if(!this.getImage(e))return this.fire(new t.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(e),this._afterImageUpdated(e)},r.prototype._afterImageUpdated=function(e){this._availableImages=this.imageManager.listImages(),this._changedImages[e]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new t.Event("data",{dataType:"style"}))},r.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},r.prototype.addSource=function(e,r,n){var i=this;if(void 0===n&&(n={}),this._checkLoaded(),void 0!==this.sourceCaches[e])throw new Error("There is already a source with this ID");if(!r.type)throw new Error("The type property must be defined, but only the following properties were given: "+Object.keys(r).join(", ")+".");if(!(["vector","raster","geojson","video","image"].indexOf(r.type)>=0&&this._validate(t.validateStyle.source,"sources."+e,r,null,n))){this.map&&this.map._collectResourceTiming&&(r.collectResourceTiming=!0);var a=this.sourceCaches[e]=new Lt(e,r,this.dispatcher);a.style=this,a.setEventedParent(this,(function(){return{isSourceLoaded:i.loaded(),source:a.serialize(),sourceId:e}})),a.onAdd(this.map),this._changed=!0}},r.prototype.removeSource=function(e){if(this._checkLoaded(),void 0===this.sourceCaches[e])throw new Error("There is no source with this ID");for(var r in this._layers)if(this._layers[r].source===e)return this.fire(new t.ErrorEvent(new Error('Source "'+e+'" cannot be removed while layer "'+r+'" is using it.')));var n=this.sourceCaches[e];delete this.sourceCaches[e],delete this._updatedSources[e],n.fire(new t.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:e})),n.setEventedParent(null),n.clearTiles(),n.onRemove&&n.onRemove(this.map),this._changed=!0},r.prototype.setGeoJSONSourceData=function(t,e){this._checkLoaded(),this.sourceCaches[t].getSource().setData(e),this._changed=!0},r.prototype.getSource=function(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()},r.prototype.addLayer=function(e,r,n){void 0===n&&(n={}),this._checkLoaded();var i=e.id;if(this.getLayer(i))this.fire(new t.ErrorEvent(new Error('Layer with id "'+i+'" already exists on this map')));else{var a;if("custom"===e.type){if(Ue(this,t.validateCustomStyleLayer(e)))return;a=t.createStyleLayer(e)}else{if("object"==typeof e.source&&(this.addSource(i,e.source),e=t.clone$1(e),e=t.extend(e,{source:i})),this._validate(t.validateStyle.layer,"layers."+i,e,{arrayIndex:-1},n))return;a=t.createStyleLayer(e),this._validateLayer(a),a.setEventedParent(this,{layer:{id:i}}),this._serializedLayers[a.id]=a.serialize()}var o=r?this._order.indexOf(r):this._order.length;if(r&&-1===o)this.fire(new t.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.')));else{if(this._order.splice(o,0,i),this._layerOrderChanged=!0,this._layers[i]=a,this._removedLayers[i]&&a.source&&"custom"!==a.type){var s=this._removedLayers[i];delete this._removedLayers[i],s.type!==a.type?this._updatedSources[a.source]="clear":(this._updatedSources[a.source]="reload",this.sourceCaches[a.source].pause())}this._updateLayer(a),a.onAdd&&a.onAdd(this.map)}}},r.prototype.moveLayer=function(e,r){if(this._checkLoaded(),this._changed=!0,this._layers[e]){if(e!==r){var n=this._order.indexOf(e);this._order.splice(n,1);var i=r?this._order.indexOf(r):this._order.length;if(r&&-1===i)return void this.fire(new t.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.')));this._order.splice(i,0,e),this._layerOrderChanged=!0}}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be moved.")))},r.prototype.removeLayer=function(e){this._checkLoaded();var r=this._layers[e];if(r){r.setEventedParent(null);var n=this._order.indexOf(e);this._order.splice(n,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=r,delete this._layers[e],delete this._serializedLayers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e],r.onRemove&&r.onRemove(this.map)}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be removed.")))},r.prototype.getLayer=function(t){return this._layers[t]},r.prototype.hasLayer=function(t){return t in this._layers},r.prototype.setLayerZoomRange=function(e,r,n){this._checkLoaded();var i=this.getLayer(e);i?i.minzoom===r&&i.maxzoom===n||(null!=r&&(i.minzoom=r),null!=n&&(i.maxzoom=n),this._updateLayer(i)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot have zoom extent.")))},r.prototype.setFilter=function(e,r,n){void 0===n&&(n={}),this._checkLoaded();var i=this.getLayer(e);if(i){if(!t.deepEqual(i.filter,r)){if(null==r)return i.filter=void 0,void this._updateLayer(i);this._validate(t.validateStyle.filter,"layers."+i.id+".filter",r,null,n)||(i.filter=t.clone$1(r),this._updateLayer(i))}}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be filtered.")))},r.prototype.getFilter=function(e){return t.clone$1(this.getLayer(e).filter)},r.prototype.setLayoutProperty=function(e,r,n,i){void 0===i&&(i={}),this._checkLoaded();var a=this.getLayer(e);a?t.deepEqual(a.getLayoutProperty(r),n)||(a.setLayoutProperty(r,n,i),this._updateLayer(a)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")))},r.prototype.getLayoutProperty=function(e,r){var n=this.getLayer(e);if(n)return n.getLayoutProperty(r);this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style.")))},r.prototype.setPaintProperty=function(e,r,n,i){void 0===i&&(i={}),this._checkLoaded();var a=this.getLayer(e);a?t.deepEqual(a.getPaintProperty(r),n)||(a.setPaintProperty(r,n,i)&&this._updateLayer(a),this._changed=!0,this._updatedPaintProps[e]=!0):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")))},r.prototype.getPaintProperty=function(t,e){return this.getLayer(t).getPaintProperty(e)},r.prototype.setFeatureState=function(e,r){this._checkLoaded();var n=e.source,i=e.sourceLayer,a=this.sourceCaches[n];if(void 0!==a){var o=a.getSource().type;"geojson"===o&&i?this.fire(new t.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==o||i?(void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),a.setFeatureState(i,e.id,r)):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")))},r.prototype.removeFeatureState=function(e,r){this._checkLoaded();var n=e.source,i=this.sourceCaches[n];if(void 0!==i){var a=i.getSource().type,o="vector"===a?e.sourceLayer:void 0;"vector"!==a||o?r&&"string"!=typeof e.id&&"number"!=typeof e.id?this.fire(new t.ErrorEvent(new Error("A feature id is required to remove its specific state property."))):i.removeFeatureState(o,e.id,r):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")))},r.prototype.getFeatureState=function(e){this._checkLoaded();var r=e.source,n=e.sourceLayer,i=this.sourceCaches[r];if(void 0!==i){if("vector"!==i.getSource().type||n)return void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),i.getFeatureState(n,e.id);this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+r+"' does not exist in the map's style.")))},r.prototype.getTransition=function(){return t.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},r.prototype.serialize=function(){return t.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:t.mapObject(this.sourceCaches,(function(t){return t.serialize()})),layers:this._serializeLayers(this._order)},(function(t){return void 0!==t}))},r.prototype._updateLayer=function(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&"raster"!==this.sourceCaches[t.source].getSource().type&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._changed=!0},r.prototype._flattenAndSortRenderedFeatures=function(t){for(var e=this,r=function(t){return"fill-extrusion"===e._layers[t].type},n={},i=[],a=this._order.length-1;a>=0;a--){var o=this._order[a];if(r(o)){n[o]=a;for(var s=0,l=t;s=0;d--){var m=this._order[d];if(r(m))for(var g=i.length-1;g>=0;g--){var y=i[g].feature;if(n[y.layer.id] 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,0.0,1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),er=xr("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),rr=xr("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,0,1);}"),nr=xr("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_FragColor=color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);}"),ir=xr("varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),ar=xr("uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),or=xr("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}"),sr=xr("varying vec4 v_color;void main() {gl_FragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 normal=a_normal_ed.xyz;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}"),lr=xr("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0\n? a_pos\n: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}"),cr=xr("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),ur=xr("uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;\n#define PI 3.141592653589793\nvoid main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),hr=xr("uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}"),pr=xr("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}"),fr=xr("uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}"),dr=xr("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}"),mr=xr("uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),gr=xr("uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),0.0,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));}"),yr=xr("#define SDF_PX 8.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}"),vr=xr("#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}");function xr(t,e){var r=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,n=e.match(/attribute ([\w]+) ([\w]+)/g),i=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),a=e.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),o=a?a.concat(i):i,s={};return{fragmentSource:t=t.replace(r,(function(t,e,r,n,i){return s[i]=!0,"define"===e?"\n#ifndef HAS_UNIFORM_u_"+i+"\nvarying "+r+" "+n+" "+i+";\n#else\nuniform "+r+" "+n+" u_"+i+";\n#endif\n":"\n#ifdef HAS_UNIFORM_u_"+i+"\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n"})),vertexSource:e=e.replace(r,(function(t,e,r,n,i){var a="float"===n?"vec2":"vec4",o=i.match(/color/)?"color":a;return s[i]?"define"===e?"\n#ifndef HAS_UNIFORM_u_"+i+"\nuniform lowp float u_"+i+"_t;\nattribute "+r+" "+a+" a_"+i+";\nvarying "+r+" "+n+" "+i+";\n#else\nuniform "+r+" "+n+" u_"+i+";\n#endif\n":"vec4"===o?"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+i+" = a_"+i+";\n#else\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+i+" = unpack_mix_"+o+"(a_"+i+", u_"+i+"_t);\n#else\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n":"define"===e?"\n#ifndef HAS_UNIFORM_u_"+i+"\nuniform lowp float u_"+i+"_t;\nattribute "+r+" "+a+" a_"+i+";\n#else\nuniform "+r+" "+n+" u_"+i+";\n#endif\n":"vec4"===o?"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+r+" "+n+" "+i+" = a_"+i+";\n#else\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+r+" "+n+" "+i+" = unpack_mix_"+o+"(a_"+i+", u_"+i+"_t);\n#else\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n"})),staticAttributes:n,staticUniforms:o}}var _r=Object.freeze({__proto__:null,prelude:Ze,background:Ye,backgroundPattern:Xe,circle:$e,clippingMask:Ke,heatmap:Je,heatmapTexture:Qe,collisionBox:tr,collisionCircle:er,debug:rr,fill:nr,fillOutline:ir,fillOutlinePattern:ar,fillPattern:or,fillExtrusion:sr,fillExtrusionPattern:lr,hillshadePrepare:cr,hillshade:ur,line:hr,lineGradient:pr,linePattern:fr,lineSDF:dr,raster:mr,symbolIcon:gr,symbolSDF:yr,symbolTextAndIcon:vr}),br=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};function wr(t){for(var e=[],r=0;r>16,s>>16],u_pixel_coord_lower:[65535&o,65535&s]}}Tr.prototype.draw=function(t,e,r,n,i,a,o,s,l,c,u,h,p,f,d,m){var g,y=t.gl;if(!this.failedToCreate){for(var v in t.program.set(this.program),t.setDepthMode(r),t.setStencilMode(n),t.setColorMode(i),t.setCullFace(a),this.fixedUniforms)this.fixedUniforms[v].set(o[v]);f&&f.setUniforms(t,this.binderUniforms,h,{zoom:p});for(var x=(g={},g[y.LINES]=2,g[y.TRIANGLES]=3,g[y.LINE_STRIP]=1,g)[e],_=0,b=u.get();_0?1/(1-t):1+t}function Zr(t){return t>0?1-1/(1.001-t):-t}var Yr,Xr=function(t,e,r,n,i,a,o,s,l,c){var u=i.transform;return{u_is_size_zoom_constant:+("constant"===t||"source"===t),u_is_size_feature_constant:+("constant"===t||"camera"===t),u_size_t:e?e.uSizeT:0,u_size:e?e.uSize:0,u_camera_to_center_distance:u.cameraToCenterDistance,u_pitch:u.pitch/360*2*Math.PI,u_rotate_symbol:+r,u_aspect_ratio:u.width/u.height,u_fade_change:i.options.fadeDuration?i.symbolFadeChange:1,u_matrix:a,u_label_plane_matrix:o,u_coord_matrix:s,u_is_text:+l,u_pitch_with_map:+n,u_texsize:c,u_texture:0}},$r=function(e,r,n,i,a,o,s,l,c,u,h){var p=a.transform;return t.extend(Xr(e,r,n,i,a,o,s,l,c,u),{u_gamma_scale:i?Math.cos(p._pitch)*p.cameraToCenterDistance:1,u_device_pixel_ratio:t.browser.devicePixelRatio,u_is_halo:+h})},Kr=function(e,r,n,i,a,o,s,l,c,u){return t.extend($r(e,r,n,i,a,o,s,l,!0,c,!0),{u_texsize_icon:u,u_texture_icon:1})},Jr=function(t,e,r){return{u_matrix:t,u_opacity:e,u_color:r}},Qr=function(e,r,n,i,a,o){return t.extend(function(t,e,r,n){var i=r.imageManager.getPattern(t.from.toString()),a=r.imageManager.getPattern(t.to.toString()),o=r.imageManager.getPixelSize(),s=o.width,l=o.height,c=Math.pow(2,n.tileID.overscaledZ),u=n.tileSize*Math.pow(2,r.transform.tileZoom)/c,h=u*(n.tileID.canonical.x+n.tileID.wrap*c),p=u*n.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:i.tl,u_pattern_br_a:i.br,u_pattern_tl_b:a.tl,u_pattern_br_b:a.br,u_texsize:[s,l],u_mix:e.t,u_pattern_size_a:i.displaySize,u_pattern_size_b:a.displaySize,u_scale_a:e.fromScale,u_scale_b:e.toScale,u_tile_units_to_pixels:1/de(n,1,r.transform.tileZoom),u_pixel_coord_upper:[h>>16,p>>16],u_pixel_coord_lower:[65535&h,65535&p]}}(i,o,n,a),{u_matrix:e,u_opacity:r})},tn={fillExtrusion:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_lightpos:new t.Uniform3f(e,r.u_lightpos),u_lightintensity:new t.Uniform1f(e,r.u_lightintensity),u_lightcolor:new t.Uniform3f(e,r.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,r.u_vertical_gradient),u_opacity:new t.Uniform1f(e,r.u_opacity)}},fillExtrusionPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_lightpos:new t.Uniform3f(e,r.u_lightpos),u_lightintensity:new t.Uniform1f(e,r.u_lightintensity),u_lightcolor:new t.Uniform3f(e,r.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,r.u_vertical_gradient),u_height_factor:new t.Uniform1f(e,r.u_height_factor),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade),u_opacity:new t.Uniform1f(e,r.u_opacity)}},fill:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},fillPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},fillOutline:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world)}},fillOutlinePattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},circle:function(e,r){return{u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_scale_with_map:new t.Uniform1i(e,r.u_scale_with_map),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_extrude_scale:new t.Uniform2f(e,r.u_extrude_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},collisionBox:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pixels_to_tile_units:new t.Uniform1f(e,r.u_pixels_to_tile_units),u_extrude_scale:new t.Uniform2f(e,r.u_extrude_scale),u_overscale_factor:new t.Uniform1f(e,r.u_overscale_factor)}},collisionCircle:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_inv_matrix:new t.UniformMatrix4f(e,r.u_inv_matrix),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_viewport_size:new t.Uniform2f(e,r.u_viewport_size)}},debug:function(e,r){return{u_color:new t.UniformColor(e,r.u_color),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_overlay:new t.Uniform1i(e,r.u_overlay),u_overlay_scale:new t.Uniform1f(e,r.u_overlay_scale)}},clippingMask:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},heatmap:function(e,r){return{u_extrude_scale:new t.Uniform1f(e,r.u_extrude_scale),u_intensity:new t.Uniform1f(e,r.u_intensity),u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},heatmapTexture:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world),u_image:new t.Uniform1i(e,r.u_image),u_color_ramp:new t.Uniform1i(e,r.u_color_ramp),u_opacity:new t.Uniform1f(e,r.u_opacity)}},hillshade:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_latrange:new t.Uniform2f(e,r.u_latrange),u_light:new t.Uniform2f(e,r.u_light),u_shadow:new t.UniformColor(e,r.u_shadow),u_highlight:new t.UniformColor(e,r.u_highlight),u_accent:new t.UniformColor(e,r.u_accent)}},hillshadePrepare:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_dimension:new t.Uniform2f(e,r.u_dimension),u_zoom:new t.Uniform1f(e,r.u_zoom),u_unpack:new t.Uniform4f(e,r.u_unpack)}},line:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels)}},lineGradient:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_image:new t.Uniform1i(e,r.u_image),u_image_height:new t.Uniform1f(e,r.u_image_height)}},linePattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_texsize:new t.Uniform2f(e,r.u_texsize),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_image:new t.Uniform1i(e,r.u_image),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},lineSDF:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_patternscale_a:new t.Uniform2f(e,r.u_patternscale_a),u_patternscale_b:new t.Uniform2f(e,r.u_patternscale_b),u_sdfgamma:new t.Uniform1f(e,r.u_sdfgamma),u_image:new t.Uniform1i(e,r.u_image),u_tex_y_a:new t.Uniform1f(e,r.u_tex_y_a),u_tex_y_b:new t.Uniform1f(e,r.u_tex_y_b),u_mix:new t.Uniform1f(e,r.u_mix)}},raster:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_tl_parent:new t.Uniform2f(e,r.u_tl_parent),u_scale_parent:new t.Uniform1f(e,r.u_scale_parent),u_buffer_scale:new t.Uniform1f(e,r.u_buffer_scale),u_fade_t:new t.Uniform1f(e,r.u_fade_t),u_opacity:new t.Uniform1f(e,r.u_opacity),u_image0:new t.Uniform1i(e,r.u_image0),u_image1:new t.Uniform1i(e,r.u_image1),u_brightness_low:new t.Uniform1f(e,r.u_brightness_low),u_brightness_high:new t.Uniform1f(e,r.u_brightness_high),u_saturation_factor:new t.Uniform1f(e,r.u_saturation_factor),u_contrast_factor:new t.Uniform1f(e,r.u_contrast_factor),u_spin_weights:new t.Uniform3f(e,r.u_spin_weights)}},symbolIcon:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texture:new t.Uniform1i(e,r.u_texture)}},symbolSDF:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texture:new t.Uniform1i(e,r.u_texture),u_gamma_scale:new t.Uniform1f(e,r.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,r.u_is_halo)}},symbolTextAndIcon:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texsize_icon:new t.Uniform2f(e,r.u_texsize_icon),u_texture:new t.Uniform1i(e,r.u_texture),u_texture_icon:new t.Uniform1i(e,r.u_texture_icon),u_gamma_scale:new t.Uniform1f(e,r.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,r.u_is_halo)}},background:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_opacity:new t.Uniform1f(e,r.u_opacity),u_color:new t.UniformColor(e,r.u_color)}},backgroundPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_opacity:new t.Uniform1f(e,r.u_opacity),u_image:new t.Uniform1i(e,r.u_image),u_pattern_tl_a:new t.Uniform2f(e,r.u_pattern_tl_a),u_pattern_br_a:new t.Uniform2f(e,r.u_pattern_br_a),u_pattern_tl_b:new t.Uniform2f(e,r.u_pattern_tl_b),u_pattern_br_b:new t.Uniform2f(e,r.u_pattern_br_b),u_texsize:new t.Uniform2f(e,r.u_texsize),u_mix:new t.Uniform1f(e,r.u_mix),u_pattern_size_a:new t.Uniform2f(e,r.u_pattern_size_a),u_pattern_size_b:new t.Uniform2f(e,r.u_pattern_size_b),u_scale_a:new t.Uniform1f(e,r.u_scale_a),u_scale_b:new t.Uniform1f(e,r.u_scale_b),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_tile_units_to_pixels:new t.Uniform1f(e,r.u_tile_units_to_pixels)}}};function en(e,r,n,i,a,o,s){for(var l=e.context,c=l.gl,u=e.useProgram("collisionBox"),h=[],p=0,f=0,d=0;d0){var b=t.create(),w=v;t.mul(b,y.placementInvProjMatrix,e.transform.glCoordMatrix),t.mul(b,b,y.placementViewportMatrix),h.push({circleArray:_,circleOffset:f,transform:w,invTransform:b}),f=p+=_.length/4}x&&u.draw(l,c.LINES,kt.disabled,St.disabled,e.colorModeForRenderPass(),Ct.disabled,Pr(v,e.transform,g),n.id,x.layoutVertexBuffer,x.indexBuffer,x.segments,null,e.transform.zoom,null,null,x.collisionVertexBuffer)}}if(s&&h.length){var T=e.useProgram("collisionCircle"),A=new t.StructArrayLayout2f1f2i16;A.resize(4*p),A._trim();for(var k=0,M=0,S=h;M=0&&(m[y.associatedIconIndex]={shiftedAnchor:S,angle:E})}else ue(y.numGlyphs,f)}if(h){d.clear();for(var I=e.icon.placedSymbolArray,L=0;L0){var s=t.browser.now(),l=(s-e.timeAdded)/o,c=r?(s-r.timeAdded)/o:-1,u=n.getSource(),h=a.coveringZoomLevel({tileSize:u.tileSize,roundZoom:u.roundZoom}),p=!r||Math.abs(r.tileID.overscaledZ-h)>Math.abs(e.tileID.overscaledZ-h),f=p&&e.refreshedUponExpiration?1:t.clamp(p?l:1-c,0,1);return e.refreshedUponExpiration&&l>=1&&(e.refreshedUponExpiration=!1),r?{opacity:1,mix:1-f}:{opacity:f,mix:0}}return{opacity:1,mix:0}}var dn=new t.Color(1,0,0,1),mn=new t.Color(0,1,0,1),gn=new t.Color(0,0,1,1),yn=new t.Color(1,0,1,1),vn=new t.Color(0,1,1,1);function xn(t,e,r,n){bn(t,0,e+r/2,t.transform.width,r,n)}function _n(t,e,r,n){bn(t,e-r/2,0,r,t.transform.height,n)}function bn(e,r,n,i,a,o){var s=e.context,l=s.gl;l.enable(l.SCISSOR_TEST),l.scissor(r*t.browser.devicePixelRatio,n*t.browser.devicePixelRatio,i*t.browser.devicePixelRatio,a*t.browser.devicePixelRatio),s.clear({color:o}),l.disable(l.SCISSOR_TEST)}function wn(e,r,n){var i=e.context,a=i.gl,o=n.posMatrix,s=e.useProgram("debug"),l=kt.disabled,c=St.disabled,u=e.colorModeForRenderPass(),h="$debug";i.activeTexture.set(a.TEXTURE0),e.emptyTexture.bind(a.LINEAR,a.CLAMP_TO_EDGE),s.draw(i,a.LINE_STRIP,l,c,u,Ct.disabled,Dr(o,t.Color.red),h,e.debugBuffer,e.tileBorderIndexBuffer,e.debugSegments);var p=r.getTileByID(n.key).latestRawTileData,f=p&&p.byteLength||0,d=Math.floor(f/1024),m=r.getTile(n).tileSize,g=512/Math.min(m,512)*(n.overscaledZ/e.transform.zoom)*.5,y=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(y+=" => "+n.overscaledZ),function(t,e){t.initDebugOverlayCanvas();var r=t.debugOverlayCanvas,n=t.context.gl,i=t.debugOverlayCanvas.getContext("2d");i.clearRect(0,0,r.width,r.height),i.shadowColor="white",i.shadowBlur=2,i.lineWidth=1.5,i.strokeStyle="white",i.textBaseline="top",i.font="bold 36px Open Sans, sans-serif",i.fillText(e,5,5),i.strokeText(e,5,5),t.debugOverlayTexture.update(r),t.debugOverlayTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)}(e,y+" "+d+"kb"),s.draw(i,a.TRIANGLES,l,c,Et.alphaBlended,Ct.disabled,Dr(o,t.Color.transparent,g),h,e.debugBuffer,e.quadTriangleIndexBuffer,e.debugSegments)}var Tn={symbol:function(e,r,n,i,a){if("translucent"===e.renderPass){var o=St.disabled,s=e.colorModeForRenderPass();n.layout.get("text-variable-anchor")&&function(e,r,n,i,a,o,s){for(var l=r.transform,c="map"===a,u="map"===o,h=0,p=e;h256&&this.clearStencil(),r.setColorMode(Et.disabled),r.setDepthMode(kt.disabled);var i=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var a=0,o=e;a256&&this.clearStencil();var t=this.nextStencilID++,e=this.context.gl;return new St({func:e.NOTEQUAL,mask:255},t,255,e.KEEP,e.KEEP,e.REPLACE)},An.prototype.stencilModeForClipping=function(t){var e=this.context.gl;return new St({func:e.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,e.KEEP,e.KEEP,e.REPLACE)},An.prototype.stencilConfigForOverlap=function(t){var e,r=this.context.gl,n=t.sort((function(t,e){return e.overscaledZ-t.overscaledZ})),i=n[n.length-1].overscaledZ,a=n[0].overscaledZ-i+1;if(a>1){this.currentStencilSource=void 0,this.nextStencilID+a>256&&this.clearStencil();for(var o={},s=0;s=0;this.currentLayer--){var w=this.style._layers[i[this.currentLayer]],T=a[w.source],A=u[w.source];this._renderTileClippingMasks(w,A),this.renderLayer(this,T,w,A)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer0?e.pop():null},An.prototype.isPatternMissing=function(t){if(!t)return!1;if(!t.from||!t.to)return!0;var e=this.imageManager.getPattern(t.from.toString()),r=this.imageManager.getPattern(t.to.toString());return!e||!r},An.prototype.useProgram=function(t,e){this.cache=this.cache||{};var r=""+t+(e?e.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[r]||(this.cache[r]=new Tr(this.context,t,_r[t],e,tn[t],this._showOverdrawInspector)),this.cache[r]},An.prototype.setCustomLayerDefaults=function(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()},An.prototype.setBaseState=function(){var t=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(t.FUNC_ADD)},An.prototype.initDebugOverlayCanvas=function(){if(null==this.debugOverlayCanvas){this.debugOverlayCanvas=t.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512;var e=this.context.gl;this.debugOverlayTexture=new t.Texture(this.context,this.debugOverlayCanvas,e.RGBA)}},An.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var kn=function(t,e){this.points=t,this.planes=e};kn.fromInvProjectionMatrix=function(e,r,n){var i=Math.pow(2,n),a=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map((function(r){return t.transformMat4([],r,e)})).map((function(e){return t.scale$1([],e,1/e[3]/r*i)})),o=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((function(e){var r=t.sub([],a[e[0]],a[e[1]]),n=t.sub([],a[e[2]],a[e[1]]),i=t.normalize([],t.cross([],r,n)),o=-t.dot(i,a[e[1]]);return i.concat(o)}));return new kn(a,o)};var Mn=function(e,r){this.min=e,this.max=r,this.center=t.scale$2([],t.add([],this.min,this.max),.5)};Mn.prototype.quadrant=function(e){for(var r=[e%2==0,e<2],n=t.clone$2(this.min),i=t.clone$2(this.max),a=0;a=0;if(0===o)return 0;o!==r.length&&(n=!1)}if(n)return 2;for(var l=0;l<3;l++){for(var c=Number.MAX_VALUE,u=-Number.MAX_VALUE,h=0;hthis.max[l]-this.min[l])return 0}return 1};var Sn=function(t,e,r,n){if(void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),void 0===n&&(n=0),isNaN(t)||t<0||isNaN(e)||e<0||isNaN(r)||r<0||isNaN(n)||n<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=e,this.left=r,this.right=n};Sn.prototype.interpolate=function(e,r,n){return null!=r.top&&null!=e.top&&(this.top=t.number(e.top,r.top,n)),null!=r.bottom&&null!=e.bottom&&(this.bottom=t.number(e.bottom,r.bottom,n)),null!=r.left&&null!=e.left&&(this.left=t.number(e.left,r.left,n)),null!=r.right&&null!=e.right&&(this.right=t.number(e.right,r.right,n)),this},Sn.prototype.getCenter=function(e,r){var n=t.clamp((this.left+e-this.right)/2,0,e),i=t.clamp((this.top+r-this.bottom)/2,0,r);return new t.Point(n,i)},Sn.prototype.equals=function(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right},Sn.prototype.clone=function(){return new Sn(this.top,this.bottom,this.left,this.right)},Sn.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var En=function(e,r,n,i,a){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=void 0===a||a,this._minZoom=e||0,this._maxZoom=r||22,this._minPitch=n??0,this._maxPitch=i??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new t.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new Sn,this._posMatrixCache={},this._alignedPosMatrixCache={}},Cn={minZoom:{configurable:!0},maxZoom:{configurable:!0},minPitch:{configurable:!0},maxPitch:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerOffset:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},padding:{configurable:!0},centerPoint:{configurable:!0},unmodified:{configurable:!0},point:{configurable:!0}};En.prototype.clone=function(){var t=new En(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return t.tileSize=this.tileSize,t.latRange=this.latRange,t.width=this.width,t.height=this.height,t._center=this._center,t.zoom=this.zoom,t.angle=this.angle,t._fov=this._fov,t._pitch=this._pitch,t._unmodified=this._unmodified,t._edgeInsets=this._edgeInsets.clone(),t._calcMatrices(),t},Cn.minZoom.get=function(){return this._minZoom},Cn.minZoom.set=function(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},Cn.maxZoom.get=function(){return this._maxZoom},Cn.maxZoom.set=function(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},Cn.minPitch.get=function(){return this._minPitch},Cn.minPitch.set=function(t){this._minPitch!==t&&(this._minPitch=t,this.pitch=Math.max(this.pitch,t))},Cn.maxPitch.get=function(){return this._maxPitch},Cn.maxPitch.set=function(t){this._maxPitch!==t&&(this._maxPitch=t,this.pitch=Math.min(this.pitch,t))},Cn.renderWorldCopies.get=function(){return this._renderWorldCopies},Cn.renderWorldCopies.set=function(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t},Cn.worldSize.get=function(){return this.tileSize*this.scale},Cn.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},Cn.size.get=function(){return new t.Point(this.width,this.height)},Cn.bearing.get=function(){return-this.angle/Math.PI*180},Cn.bearing.set=function(e){var r=-t.wrap(e,-180,180)*Math.PI/180;this.angle!==r&&(this._unmodified=!1,this.angle=r,this._calcMatrices(),this.rotationMatrix=t.create$2(),t.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},Cn.pitch.get=function(){return this._pitch/Math.PI*180},Cn.pitch.set=function(e){var r=t.clamp(e,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==r&&(this._unmodified=!1,this._pitch=r,this._calcMatrices())},Cn.fov.get=function(){return this._fov/Math.PI*180},Cn.fov.set=function(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=t/180*Math.PI,this._calcMatrices())},Cn.zoom.get=function(){return this._zoom},Cn.zoom.set=function(t){var e=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==e&&(this._unmodified=!1,this._zoom=e,this.scale=this.zoomScale(e),this.tileZoom=Math.floor(e),this.zoomFraction=e-this.tileZoom,this._constrain(),this._calcMatrices())},Cn.center.get=function(){return this._center},Cn.center.set=function(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())},Cn.padding.get=function(){return this._edgeInsets.toJSON()},Cn.padding.set=function(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices())},Cn.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},En.prototype.isPaddingEqual=function(t){return this._edgeInsets.equals(t)},En.prototype.interpolatePadding=function(t,e,r){this._unmodified=!1,this._edgeInsets.interpolate(t,e,r),this._constrain(),this._calcMatrices()},En.prototype.coveringZoomLevel=function(t){var e=(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize));return Math.max(0,e)},En.prototype.getVisibleUnwrappedCoordinates=function(e){var r=[new t.UnwrappedTileID(0,e)];if(this._renderWorldCopies)for(var n=this.pointCoordinate(new t.Point(0,0)),i=this.pointCoordinate(new t.Point(this.width,0)),a=this.pointCoordinate(new t.Point(this.width,this.height)),o=this.pointCoordinate(new t.Point(0,this.height)),s=Math.floor(Math.min(n.x,i.x,a.x,o.x)),l=Math.floor(Math.max(n.x,i.x,a.x,o.x)),c=s-1;c<=l+1;c++)0!==c&&r.push(new t.UnwrappedTileID(c,e));return r},En.prototype.coveringTiles=function(e){var r=this.coveringZoomLevel(e),n=r;if(void 0!==e.minzoom&&re.maxzoom&&(r=e.maxzoom);var i=t.MercatorCoordinate.fromLngLat(this.center),a=Math.pow(2,r),o=[a*i.x,a*i.y,0],s=kn.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,r),l=e.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(l=r);var c=function(t){return{aabb:new Mn([t*a,0,0],[(t+1)*a,a,0]),zoom:0,x:0,y:0,wrap:t,fullyVisible:!1}},u=[],h=[],p=r,f=e.reparseOverscaled?n:r;if(this._renderWorldCopies)for(var d=1;d<=3;d++)u.push(c(-d)),u.push(c(d));for(u.push(c(0));u.length>0;){var m=u.pop(),g=m.x,y=m.y,v=m.fullyVisible;if(!v){var x=m.aabb.intersects(s);if(0===x)continue;v=2===x}var _=m.aabb.distanceX(o),b=m.aabb.distanceY(o),w=Math.max(Math.abs(_),Math.abs(b)),T=3+(1<T&&m.zoom>=l)h.push({tileID:new t.OverscaledTileID(m.zoom===p?f:m.zoom,m.wrap,m.zoom,g,y),distanceSq:t.sqrLen([o[0]-.5-g,o[1]-.5-y])});else for(var A=0;A<4;A++){var k=(g<<1)+A%2,M=(y<<1)+(A>>1);u.push({aabb:m.aabb.quadrant(A),zoom:m.zoom+1,x:k,y:M,wrap:m.wrap,fullyVisible:v})}}return h.sort((function(t,e){return t.distanceSq-e.distanceSq})).map((function(t){return t.tileID}))},En.prototype.resize=function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._constrain(),this._calcMatrices()},Cn.unmodified.get=function(){return this._unmodified},En.prototype.zoomScale=function(t){return Math.pow(2,t)},En.prototype.scaleZoom=function(t){return Math.log(t)/Math.LN2},En.prototype.project=function(e){var r=t.clamp(e.lat,-this.maxValidLatitude,this.maxValidLatitude);return new t.Point(t.mercatorXfromLng(e.lng)*this.worldSize,t.mercatorYfromLat(r)*this.worldSize)},En.prototype.unproject=function(e){return new t.MercatorCoordinate(e.x/this.worldSize,e.y/this.worldSize).toLngLat()},Cn.point.get=function(){return this.project(this.center)},En.prototype.setLocationAtPoint=function(e,r){var n=this.pointCoordinate(r),i=this.pointCoordinate(this.centerPoint),a=this.locationCoordinate(e),o=new t.MercatorCoordinate(a.x-(n.x-i.x),a.y-(n.y-i.y));this.center=this.coordinateLocation(o),this._renderWorldCopies&&(this.center=this.center.wrap())},En.prototype.locationPoint=function(t){return this.coordinatePoint(this.locationCoordinate(t))},En.prototype.pointLocation=function(t){return this.coordinateLocation(this.pointCoordinate(t))},En.prototype.locationCoordinate=function(e){return t.MercatorCoordinate.fromLngLat(e)},En.prototype.coordinateLocation=function(t){return t.toLngLat()},En.prototype.pointCoordinate=function(e){var r=[e.x,e.y,0,1],n=[e.x,e.y,1,1];t.transformMat4(r,r,this.pixelMatrixInverse),t.transformMat4(n,n,this.pixelMatrixInverse);var i=r[3],a=n[3],o=r[0]/i,s=n[0]/a,l=r[1]/i,c=n[1]/a,u=r[2]/i,h=n[2]/a,p=u===h?0:(0-u)/(h-u);return new t.MercatorCoordinate(t.number(o,s,p)/this.worldSize,t.number(l,c,p)/this.worldSize)},En.prototype.coordinatePoint=function(e){var r=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(r,r,this.pixelMatrix),new t.Point(r[0]/r[3],r[1]/r[3])},En.prototype.getBounds=function(){return(new t.LngLatBounds).extend(this.pointLocation(new t.Point(0,0))).extend(this.pointLocation(new t.Point(this.width,0))).extend(this.pointLocation(new t.Point(this.width,this.height))).extend(this.pointLocation(new t.Point(0,this.height)))},En.prototype.getMaxBounds=function(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new t.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},En.prototype.setMaxBounds=function(t){t?(this.lngRange=[t.getWest(),t.getEast()],this.latRange=[t.getSouth(),t.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},En.prototype.calculatePosMatrix=function(e,r){void 0===r&&(r=!1);var n=e.key,i=r?this._alignedPosMatrixCache:this._posMatrixCache;if(i[n])return i[n];var a=e.canonical,o=this.worldSize/this.zoomScale(a.z),s=a.x+Math.pow(2,a.z)*e.wrap,l=t.identity(new Float64Array(16));return t.translate(l,l,[s*o,a.y*o,0]),t.scale(l,l,[o/t.EXTENT,o/t.EXTENT,1]),t.multiply(l,r?this.alignedProjMatrix:this.projMatrix,l),i[n]=new Float32Array(l),i[n]},En.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},En.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var e,r,n,i,a=-90,o=90,s=-180,l=180,c=this.size,u=this._unmodified;if(this.latRange){var h=this.latRange;a=t.mercatorYfromLat(h[1])*this.worldSize,e=(o=t.mercatorYfromLat(h[0])*this.worldSize)-ao&&(i=o-g)}if(this.lngRange){var y=f.x,v=c.x/2;y-vl&&(n=l-v)}(void 0!==n||void 0!==i)&&(this.center=this.unproject(new t.Point(void 0!==n?n:f.x,void 0!==i?i:f.y))),this._unmodified=u,this._constraining=!1}},En.prototype._calcMatrices=function(){if(this.height){var e=this._fov/2,r=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(e)*this.height;var n=Math.PI/2+this._pitch,i=this._fov*(.5+r.y/this.height),a=Math.sin(i)*this.cameraToCenterDistance/Math.sin(t.clamp(Math.PI-n-i,.01,Math.PI-.01)),o=this.point,s=o.x,l=o.y,c=1.01*(Math.cos(Math.PI/2-this._pitch)*a+this.cameraToCenterDistance),u=this.height/50,h=new Float64Array(16);t.perspective(h,this._fov,this.width/this.height,u,c),h[8]=2*-r.x/this.width,h[9]=2*r.y/this.height,t.scale(h,h,[1,-1,1]),t.translate(h,h,[0,0,-this.cameraToCenterDistance]),t.rotateX(h,h,this._pitch),t.rotateZ(h,h,this.angle),t.translate(h,h,[-s,-l,0]),this.mercatorMatrix=t.scale([],h,[this.worldSize,this.worldSize,this.worldSize]),t.scale(h,h,[1,1,t.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=h,this.invProjMatrix=t.invert([],this.projMatrix);var p=this.width%2/2,f=this.height%2/2,d=Math.cos(this.angle),m=Math.sin(this.angle),g=s-Math.round(s)+d*p+m*f,y=l-Math.round(l)+d*f+m*p,v=new Float64Array(h);if(t.translate(v,v,[g>.5?g-1:g,y>.5?y-1:y,0]),this.alignedProjMatrix=v,h=t.create(),t.scale(h,h,[this.width/2,-this.height/2,1]),t.translate(h,h,[1,-1,0]),this.labelPlaneMatrix=h,h=t.create(),t.scale(h,h,[1,-1,1]),t.translate(h,h,[-1,-1,0]),t.scale(h,h,[2/this.width,2/this.height,1]),this.glCoordMatrix=h,this.pixelMatrix=t.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(h=t.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=h,this._posMatrixCache={},this._alignedPosMatrixCache={}}},En.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var e=this.pointCoordinate(new t.Point(0,0)),r=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(r,r,this.pixelMatrix)[3]/this.cameraToCenterDistance},En.prototype.getCameraPoint=function(){var e=this._pitch,r=Math.tan(e)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new t.Point(0,r))},En.prototype.getCameraQueryGeometry=function(e){var r=this.getCameraPoint();if(1===e.length)return[e[0],r];for(var n=r.x,i=r.y,a=r.x,o=r.y,s=0,l=e;s=3&&!t.some((function(t){return isNaN(t)}))){var e=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(t[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:e,pitch:+(t[4]||0)}),!0}return!1},In.prototype._updateHashUnthrottled=function(){var e=t.window.location.href.replace(/(#.+)?$/,this.getHashString());try{t.window.history.replaceState(t.window.history.state,null,e)}catch{}};var Ln={linearity:.3,easing:t.bezier(0,0,.3,1)},Pn=t.extend({deceleration:2500,maxSpeed:1400},Ln),zn=t.extend({deceleration:20,maxSpeed:1400},Ln),Dn=t.extend({deceleration:1e3,maxSpeed:360},Ln),On=t.extend({deceleration:1e3,maxSpeed:90},Ln),Rn=function(t){this._map=t,this.clear()};function Fn(t,e){(!t.duration||t.duration0&&r-e[0].time>160;)e.shift()},Rn.prototype._onMoveEnd=function(e){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var r={zoom:0,bearing:0,pitch:0,pan:new t.Point(0,0),pinchAround:void 0,around:void 0},n=0,i=this._inertiaBuffer;n=this._clickTolerance||this._map.fire(new jn(t.type,this._map,t))},Vn.prototype.dblclick=function(t){return this._firePreventable(new jn(t.type,this._map,t))},Vn.prototype.mouseover=function(t){this._map.fire(new jn(t.type,this._map,t))},Vn.prototype.mouseout=function(t){this._map.fire(new jn(t.type,this._map,t))},Vn.prototype.touchstart=function(t){return this._firePreventable(new Nn(t.type,this._map,t))},Vn.prototype.touchmove=function(t){this._map.fire(new Nn(t.type,this._map,t))},Vn.prototype.touchend=function(t){this._map.fire(new Nn(t.type,this._map,t))},Vn.prototype.touchcancel=function(t){this._map.fire(new Nn(t.type,this._map,t))},Vn.prototype._firePreventable=function(t){if(this._map.fire(t),t.defaultPrevented)return{}},Vn.prototype.isEnabled=function(){return!0},Vn.prototype.isActive=function(){return!1},Vn.prototype.enable=function(){},Vn.prototype.disable=function(){};var qn=function(t){this._map=t};qn.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},qn.prototype.mousemove=function(t){this._map.fire(new jn(t.type,this._map,t))},qn.prototype.mousedown=function(){this._delayContextMenu=!0},qn.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new jn("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},qn.prototype.contextmenu=function(t){this._delayContextMenu?this._contextMenuEvent=t:this._map.fire(new jn(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()},qn.prototype.isEnabled=function(){return!0},qn.prototype.isActive=function(){return!1},qn.prototype.enable=function(){},qn.prototype.disable=function(){};var Hn=function(t,e){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=e.clickTolerance||1};function Gn(t,e){for(var r={},n=0;nthis.numTouches)&&(this.aborted=!0),!this.aborted&&(void 0===this.startTime&&(this.startTime=e.timeStamp),n.length===this.numTouches&&(this.centroid=function(e){for(var r=new t.Point(0,0),n=0,i=e;n30)&&(this.aborted=!0)}}},Wn.prototype.touchend=function(t,e,r){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),0===r.length){var n=!this.aborted&&this.centroid;if(this.reset(),n)return n}};var Zn=function(t){this.singleTap=new Wn(t),this.numTaps=t.numTaps,this.reset()};Zn.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},Zn.prototype.touchstart=function(t,e,r){this.singleTap.touchstart(t,e,r)},Zn.prototype.touchmove=function(t,e,r){this.singleTap.touchmove(t,e,r)},Zn.prototype.touchend=function(t,e,r){var n=this.singleTap.touchend(t,e,r);if(n){var i=t.timeStamp-this.lastTime<500,a=!this.lastTap||this.lastTap.dist(n)<30;if((!i||!a)&&this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=n,this.count===this.numTaps)return this.reset(),n}};var Yn=function(){this._zoomIn=new Zn({numTouches:1,numTaps:2}),this._zoomOut=new Zn({numTouches:2,numTaps:1}),this.reset()};Yn.prototype.reset=function(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()},Yn.prototype.touchstart=function(t,e,r){this._zoomIn.touchstart(t,e,r),this._zoomOut.touchstart(t,e,r)},Yn.prototype.touchmove=function(t,e,r){this._zoomIn.touchmove(t,e,r),this._zoomOut.touchmove(t,e,r)},Yn.prototype.touchend=function(t,e,r){var n=this,i=this._zoomIn.touchend(t,e,r),a=this._zoomOut.touchend(t,e,r);return i?(this._active=!0,t.preventDefault(),setTimeout((function(){return n.reset()}),0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()+1,around:e.unproject(i)},{originalEvent:t})}}):a?(this._active=!0,t.preventDefault(),setTimeout((function(){return n.reset()}),0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()-1,around:e.unproject(a)},{originalEvent:t})}}):void 0},Yn.prototype.touchcancel=function(){this.reset()},Yn.prototype.enable=function(){this._enabled=!0},Yn.prototype.disable=function(){this._enabled=!1,this.reset()},Yn.prototype.isEnabled=function(){return this._enabled},Yn.prototype.isActive=function(){return this._active};var Xn={0:1,2:2},$n=function(t){this.reset(),this._clickTolerance=t.clickTolerance||1};$n.prototype.reset=function(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton},$n.prototype._correctButton=function(t,e){return!1},$n.prototype._move=function(t,e){return{}},$n.prototype.mousedown=function(t,e){if(!this._lastPoint){var n=r.mouseButton(t);this._correctButton(t,n)&&(this._lastPoint=e,this._eventButton=n)}},$n.prototype.mousemoveWindow=function(t,e){var r=this._lastPoint;if(r){if(t.preventDefault(),function(t,e){var r=Xn[e];return void 0===t.buttons||(t.buttons&r)!==r}(t,this._eventButton))return void this.reset();if(this._moved||!(e.dist(r)0&&(this._active=!0);var i=Gn(n,r),a=new t.Point(0,0),o=new t.Point(0,0),s=0;for(var l in i){var c=i[l],u=this._touches[l];u&&(a._add(c),o._add(c.sub(u)),s++,i[l]=c)}if(this._touches=i,!(sMath.abs(t.x)}var li=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.reset=function(){t.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},e.prototype._start=function(t){this._lastPoints=t,si(t[0].sub(t[1]))&&(this._valid=!1)},e.prototype._move=function(t,e,r){var n=t[0].sub(this._lastPoints[0]),i=t[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(n,i,r.timeStamp),this._valid)return this._lastPoints=t,this._active=!0,{pitchDelta:(n.y+i.y)/2*-.5}},e.prototype.gestureBeginsVertically=function(t,e,r){if(void 0!==this._valid)return this._valid;var n=t.mag()>=2,i=e.mag()>=2;if(n||i){if(!n||!i)return void 0===this._firstMove&&(this._firstMove=r),r-this._firstMove<100&&void 0;var a=t.y>0==e.y>0;return si(t)&&si(e)&&a}},e}(ei),ci={panStep:100,bearingStep:15,pitchStep:10},ui=function(){var t=ci;this._panStep=t.panStep,this._bearingStep=t.bearingStep,this._pitchStep=t.pitchStep,this._rotationDisabled=!1};function hi(t){return t*(2-t)}ui.prototype.reset=function(){this._active=!1},ui.prototype.keydown=function(t){var e=this;if(!(t.altKey||t.ctrlKey||t.metaKey)){var r=0,n=0,i=0,a=0,o=0;switch(t.keyCode){case 61:case 107:case 171:case 187:r=1;break;case 189:case 109:case 173:r=-1;break;case 37:t.shiftKey?n=-1:(t.preventDefault(),a=-1);break;case 39:t.shiftKey?n=1:(t.preventDefault(),a=1);break;case 38:t.shiftKey?i=1:(t.preventDefault(),o=-1);break;case 40:t.shiftKey?i=-1:(t.preventDefault(),o=1);break;default:return}return this._rotationDisabled&&(n=0,i=0),{cameraAnimation:function(s){var l=s.getZoom();s.easeTo({duration:300,easeId:"keyboardHandler",easing:hi,zoom:r?Math.round(l)+r*(t.shiftKey?2:1):l,bearing:s.getBearing()+n*e._bearingStep,pitch:s.getPitch()+i*e._pitchStep,offset:[-a*e._panStep,-o*e._panStep],center:s.getCenter()},{originalEvent:t})}}}},ui.prototype.enable=function(){this._enabled=!0},ui.prototype.disable=function(){this._enabled=!1,this.reset()},ui.prototype.isEnabled=function(){return this._enabled},ui.prototype.isActive=function(){return this._active},ui.prototype.disableRotation=function(){this._rotationDisabled=!0},ui.prototype.enableRotation=function(){this._rotationDisabled=!1};var pi=4.000244140625,fi=1/450,di=function(e,r){this._map=e,this._el=e.getCanvasContainer(),this._handler=r,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=fi,t.bindAll(["_onTimeout"],this)};di.prototype.setZoomRate=function(t){this._defaultZoomRate=t},di.prototype.setWheelZoomRate=function(t){this._wheelZoomRate=t},di.prototype.isEnabled=function(){return!!this._enabled},di.prototype.isActive=function(){return!!this._active||void 0!==this._finishTimeout},di.prototype.isZooming=function(){return!!this._zooming},di.prototype.enable=function(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=t&&"center"===t.around)},di.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},di.prototype.wheel=function(e){if(this.isEnabled()){var r=e.deltaMode===t.window.WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY,n=t.browser.now(),i=n-(this._lastWheelEventTime||0);this._lastWheelEventTime=n,0!==r&&r%pi==0?this._type="wheel":0!==r&&Math.abs(r)<4?this._type="trackpad":i>400?(this._type=null,this._lastValue=r,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(i*r)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,r+=this._lastValue)),e.shiftKey&&r&&(r/=4),this._type&&(this._lastWheelEvent=e,this._delta-=r,this._active||this._start(e)),e.preventDefault()}},di.prototype._onTimeout=function(t){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(t)},di.prototype._start=function(e){if(this._delta){this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);var n=r.mousePos(this._el,e);this._around=t.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(n)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},di.prototype.renderFrame=function(){var e=this;if(this._frameId&&(this._frameId=null,this.isActive())){var r=this._map.transform;if(0!==this._delta){var n="wheel"===this._type&&Math.abs(this._delta)>pi?this._wheelZoomRate:this._defaultZoomRate,i=2/(1+Math.exp(-Math.abs(this._delta*n)));this._delta<0&&0!==i&&(i=1/i);var a="number"==typeof this._targetZoom?r.zoomScale(this._targetZoom):r.scale;this._targetZoom=Math.min(r.maxZoom,Math.max(r.minZoom,r.scaleZoom(a*i))),"wheel"===this._type&&(this._startZoom=r.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var o,s="number"==typeof this._targetZoom?this._targetZoom:r.zoom,l=this._startZoom,c=this._easing,u=!1;if("wheel"===this._type&&l&&c){var h=Math.min((t.browser.now()-this._lastWheelEventTime)/200,1),p=c(h);o=t.number(l,s,p),h<1?this._frameId||(this._frameId=!0):u=!0}else o=s,u=!0;return this._active=!0,u&&(this._active=!1,this._finishTimeout=setTimeout((function(){e._zooming=!1,e._handler._triggerRenderFrame(),delete e._targetZoom,delete e._finishTimeout}),200)),{noInertia:!0,needsRenderFrame:!u,zoomDelta:o-r.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},di.prototype._smoothOutEasing=function(e){var r=t.ease;if(this._prevEase){var n=this._prevEase,i=(t.browser.now()-n.start)/n.duration,a=n.easing(i+.01)-n.easing(i),o=.27/Math.sqrt(a*a+1e-4)*.01,s=Math.sqrt(.0729-o*o);r=t.bezier(o,s,.25,1)}return this._prevEase={start:t.browser.now(),duration:e,easing:r},r},di.prototype.reset=function(){this._active=!1};var mi=function(t,e){this._clickZoom=t,this._tapZoom=e};mi.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},mi.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},mi.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},mi.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var gi=function(){this.reset()};gi.prototype.reset=function(){this._active=!1},gi.prototype.dblclick=function(t,e){return t.preventDefault(),{cameraAnimation:function(r){r.easeTo({duration:300,zoom:r.getZoom()+(t.shiftKey?-1:1),around:r.unproject(e)},{originalEvent:t})}}},gi.prototype.enable=function(){this._enabled=!0},gi.prototype.disable=function(){this._enabled=!1,this.reset()},gi.prototype.isEnabled=function(){return this._enabled},gi.prototype.isActive=function(){return this._active};var yi=function(){this._tap=new Zn({numTouches:1,numTaps:1}),this.reset()};yi.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},yi.prototype.touchstart=function(t,e,r){this._swipePoint||(this._tapTime&&t.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?r.length>0&&(this._swipePoint=e[0],this._swipeTouch=r[0].identifier):this._tap.touchstart(t,e,r))},yi.prototype.touchmove=function(t,e,r){if(this._tapTime){if(this._swipePoint){if(r[0].identifier!==this._swipeTouch)return;var n=e[0],i=n.y-this._swipePoint.y;return this._swipePoint=n,t.preventDefault(),this._active=!0,{zoomDelta:i/128}}}else this._tap.touchmove(t,e,r)},yi.prototype.touchend=function(t,e,r){this._tapTime?this._swipePoint&&0===r.length&&this.reset():this._tap.touchend(t,e,r)&&(this._tapTime=t.timeStamp)},yi.prototype.touchcancel=function(){this.reset()},yi.prototype.enable=function(){this._enabled=!0},yi.prototype.disable=function(){this._enabled=!1,this.reset()},yi.prototype.isEnabled=function(){return this._enabled},yi.prototype.isActive=function(){return this._active};var vi=function(t,e,r){this._el=t,this._mousePan=e,this._touchPan=r};vi.prototype.enable=function(t){this._inertiaOptions=t||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},vi.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},vi.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},vi.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var xi=function(t,e,r){this._pitchWithRotate=t.pitchWithRotate,this._mouseRotate=e,this._mousePitch=r};xi.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},xi.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},xi.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},xi.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var _i=function(t,e,r,n){this._el=t,this._touchZoom=e,this._touchRotate=r,this._tapDragZoom=n,this._rotationDisabled=!1,this._enabled=!0};_i.prototype.enable=function(t){this._touchZoom.enable(t),this._rotationDisabled||this._touchRotate.enable(t),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")},_i.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},_i.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},_i.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},_i.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},_i.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var bi=function(t){return t.zoom||t.drag||t.pitch||t.rotate},wi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(t.Event);function Ti(t){return t.panDelta&&t.panDelta.mag()||t.zoomDelta||t.bearingDelta||t.pitchDelta}var Ai=function(e,n){this._map=e,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Rn(e),this._bearingSnap=n.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(n),t.bindAll(["handleEvent","handleWindowEvent"],this);var i=this._el;this._listeners=[[i,"touchstart",{passive:!0}],[i,"touchmove",{passive:!1}],[i,"touchend",void 0],[i,"touchcancel",void 0],[i,"mousedown",void 0],[i,"mousemove",void 0],[i,"mouseup",void 0],[t.window.document,"mousemove",{capture:!0}],[t.window.document,"mouseup",void 0],[i,"mouseover",void 0],[i,"mouseout",void 0],[i,"dblclick",void 0],[i,"click",void 0],[i,"keydown",{capture:!1}],[i,"keyup",void 0],[i,"wheel",{passive:!1}],[i,"contextmenu",void 0],[t.window,"blur",void 0]];for(var a=0,o=this._listeners;aa?Math.min(2,b):Math.max(.5,b),w=Math.pow(g,1-e),T=i.unproject(x.add(_.mult(e*w)).mult(m));i.setLocationAtPoint(i.renderWorldCopies?T.wrap():T,d)}n._fireMoveEvents(r)}),(function(t){n._afterEase(r,t)}),e),this},r.prototype._prepareEase=function(e,r,n){void 0===n&&(n={}),this._moving=!0,!r&&!n.moving&&this.fire(new t.Event("movestart",e)),this._zooming&&!n.zooming&&this.fire(new t.Event("zoomstart",e)),this._rotating&&!n.rotating&&this.fire(new t.Event("rotatestart",e)),this._pitching&&!n.pitching&&this.fire(new t.Event("pitchstart",e))},r.prototype._fireMoveEvents=function(e){this.fire(new t.Event("move",e)),this._zooming&&this.fire(new t.Event("zoom",e)),this._rotating&&this.fire(new t.Event("rotate",e)),this._pitching&&this.fire(new t.Event("pitch",e))},r.prototype._afterEase=function(e,r){if(!this._easeId||!r||this._easeId!==r){delete this._easeId;var n=this._zooming,i=this._rotating,a=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,n&&this.fire(new t.Event("zoomend",e)),i&&this.fire(new t.Event("rotateend",e)),a&&this.fire(new t.Event("pitchend",e)),this.fire(new t.Event("moveend",e))}},r.prototype.flyTo=function(e,r){var n=this;if(!e.essential&&t.browser.prefersReducedMotion){var i=t.pick(e,["center","zoom","bearing","pitch","around"]);return this.jumpTo(i,r)}this.stop(),e=t.extend({offset:[0,0],speed:1.2,curve:1.42,easing:t.ease},e);var a=this.transform,o=this.getZoom(),s=this.getBearing(),l=this.getPitch(),c=this.getPadding(),u="zoom"in e?t.clamp(+e.zoom,a.minZoom,a.maxZoom):o,h="bearing"in e?this._normalizeBearing(e.bearing,s):s,p="pitch"in e?+e.pitch:l,f="padding"in e?e.padding:a.padding,d=a.zoomScale(u-o),m=t.Point.convert(e.offset),g=a.centerPoint.add(m),y=a.pointLocation(g),v=t.LngLat.convert(e.center||y);this._normalizeCenter(v);var x=a.project(y),_=a.project(v).sub(x),b=e.curve,w=Math.max(a.width,a.height),T=w/d,A=_.mag();if("minZoom"in e){var k=t.clamp(Math.min(e.minZoom,o,u),a.minZoom,a.maxZoom),M=w/a.zoomScale(k-o);b=Math.sqrt(M/A*2)}var S=b*b;function E(t){var e=(T*T-w*w+(t?-1:1)*S*S*A*A)/(2*(t?T:w)*S*A);return Math.log(Math.sqrt(e*e+1)-e)}function C(t){return(Math.exp(t)-Math.exp(-t))/2}function I(t){return(Math.exp(t)+Math.exp(-t))/2}var L=E(0),P=function(t){return I(L)/I(L+b*t)},z=function(t){return w*((I(L)*function(t){return C(t)/I(t)}(L+b*t)-C(L))/S)/A},D=(E(1)-L)/b;if(Math.abs(A)<1e-6||!isFinite(D)){if(Math.abs(w-T)<1e-6)return this.easeTo(e,r);var O=Te.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=s!==h,this._pitching=p!==l,this._padding=!a.isPaddingEqual(f),this._prepareEase(r,!1),this._ease((function(e){var i=e*D,d=1/P(i);a.zoom=1===e?u:o+a.scaleZoom(d),n._rotating&&(a.bearing=t.number(s,h,e)),n._pitching&&(a.pitch=t.number(l,p,e)),n._padding&&(a.interpolatePadding(c,f,e),g=a.centerPoint.add(m));var y=1===e?v:a.unproject(x.add(_.mult(z(i))).mult(d));a.setLocationAtPoint(a.renderWorldCopies?y.wrap():y,g),n._fireMoveEvents(r)}),(function(){return n._afterEase(r)}),e),this},r.prototype.isEasing=function(){return!!this._easeFrameId},r.prototype.stop=function(){return this._stop()},r.prototype._stop=function(t,e){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var r=this._onEaseEnd;delete this._onEaseEnd,r.call(this,e)}if(!t){var n=this.handlers;n&&n.stop(!1)}return this},r.prototype._ease=function(e,r,n){!1===n.animate||0===n.duration?(e(1),r()):(this._easeStart=t.browser.now(),this._easeOptions=n,this._onEaseFrame=e,this._onEaseEnd=r,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},r.prototype._renderFrameCallback=function(){var e=Math.min((t.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(e)),e<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},r.prototype._normalizeBearing=function(e,r){e=t.wrap(e,-180,180);var n=Math.abs(e-r);return Math.abs(e-360-r)180?-360:r<-180?360:0}},r}(t.Evented),Mi=function(e){void 0===e&&(e={}),this.options=e,t.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)};Mi.prototype.getDefaultPosition=function(){return"bottom-right"},Mi.prototype.onAdd=function(t){var e=this.options&&this.options.compact;return this._map=t,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=r.create("button","mapboxgl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=r.create("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),e&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),void 0===e&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},Mi.prototype.onRemove=function(){r.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0},Mi.prototype._setElementTitle=function(t,e){var r=this._map._getUIString("AttributionControl."+e);t.title=r,t.setAttribute("aria-label",r)},Mi.prototype._toggleAttribution=function(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","true"))},Mi.prototype._updateEditLink=function(){var e=this._editLink;e||(e=this._editLink=this._container.querySelector(".mapbox-improve-map"));var r=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||t.config.ACCESS_TOKEN}];if(e){var n=r.reduce((function(t,e,n){return e.value&&(t+=e.key+"="+e.value+(n=0)return!1;return!0}))).join(" | ");o!==this._attribHTML&&(this._attribHTML=o,t.length?(this._innerContainer.innerHTML=o,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},Mi.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")};var Si=function(){t.bindAll(["_updateLogo"],this),t.bindAll(["_updateCompact"],this)};Si.prototype.onAdd=function(t){this._map=t,this._container=r.create("div","mapboxgl-ctrl");var e=r.create("a","mapboxgl-ctrl-logo");return e.target="_blank",e.rel="noopener nofollow",e.href="https://www.mapbox.com/",e.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),e.setAttribute("rel","noopener nofollow"),this._container.appendChild(e),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},Si.prototype.onRemove=function(){r.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},Si.prototype.getDefaultPosition=function(){return"bottom-left"},Si.prototype._updateLogo=function(t){(!t||"metadata"===t.sourceDataType)&&(this._container.style.display=this._logoRequired()?"block":"none")},Si.prototype._logoRequired=function(){if(this._map.style){var t=this._map.style.sourceCaches;for(var e in t)if(t[e].getSource().mapbox_logo)return!0;return!1}},Si.prototype._updateCompact=function(){var t=this._container.children;if(t.length){var e=t[0];this._map.getCanvasContainer().offsetWidth<250?e.classList.add("mapboxgl-compact"):e.classList.remove("mapboxgl-compact")}};var Ei=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};Ei.prototype.add=function(t){var e=++this._id;return this._queue.push({callback:t,id:e,cancelled:!1}),e},Ei.prototype.remove=function(t){for(var e=this._currentlyRunning,r=0,n=e?this._queue.concat(e):this._queue;re.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=e.minPitch&&null!=e.maxPitch&&e.minPitch>e.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=e.minPitch&&e.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=e.maxPitch&&e.maxPitch>60)throw new Error("maxPitch must be less than or equal to 60");var i=new En(e.minZoom,e.maxZoom,e.minPitch,e.maxPitch,e.renderWorldCopies);if(n.call(this,i,e),this._interactive=e.interactive,this._maxTileCacheSize=e.maxTileCacheSize,this._failIfMajorPerformanceCaveat=e.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=e.preserveDrawingBuffer,this._antialias=e.antialias,this._trackResize=e.trackResize,this._bearingSnap=e.bearingSnap,this._refreshExpiredTiles=e.refreshExpiredTiles,this._fadeDuration=e.fadeDuration,this._crossSourceCollisions=e.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=e.collectResourceTiming,this._renderTaskQueue=new Ei,this._controls=[],this._mapId=t.uniqueId(),this._locale=t.extend({},Ci,e.locale),this._clickTolerance=e.clickTolerance,this._requestManager=new t.RequestManager(e.transformRequest,e.accessToken),"string"==typeof e.container){if(this._container=t.window.document.getElementById(e.container),!this._container)throw new Error("Container '"+e.container+"' not found.")}else{if(!(e.container instanceof Li))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=e.container}if(e.maxBounds&&this.setMaxBounds(e.maxBounds),t.bindAll(["_onWindowOnline","_onWindowResize","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");this.on("move",(function(){return r._update(!1)})),this.on("moveend",(function(){return r._update(!1)})),this.on("zoom",(function(){return r._update(!0)})),typeof t.window<"u"&&(t.window.addEventListener("online",this._onWindowOnline,!1),t.window.addEventListener("resize",this._onWindowResize,!1),t.window.addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new Ai(this,e);var a="string"==typeof e.hash&&e.hash||void 0;this._hash=e.hash&&new In(a).addTo(this),(!this._hash||!this._hash._onHashChange())&&(this.jumpTo({center:e.center,zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}),e.bounds&&(this.resize(),this.fitBounds(e.bounds,t.extend({},e.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=e.localIdeographFontFamily,e.style&&this.setStyle(e.style,{localIdeographFontFamily:e.localIdeographFontFamily}),e.attributionControl&&this.addControl(new Mi({customAttribution:e.customAttribution})),this.addControl(new Si,e.logoPosition),this.on("style.load",(function(){r.transform.unmodified&&r.jumpTo(r.style.stylesheet)})),this.on("data",(function(e){r._update("style"===e.dataType),r.fire(new t.Event(e.dataType+"data",e))})),this.on("dataloading",(function(e){r.fire(new t.Event(e.dataType+"dataloading",e))}))}n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i;var a={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return i.prototype._getMapId=function(){return this._mapId},i.prototype.addControl=function(e,r){if(void 0===r&&(r=e.getDefaultPosition?e.getDefaultPosition():"top-right"),!e||!e.onAdd)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var n=e.onAdd(this);this._controls.push(e);var i=this._controlPositions[r];return-1!==r.indexOf("bottom")?i.insertBefore(n,i.firstChild):i.appendChild(n),this},i.prototype.removeControl=function(e){if(!e||!e.onRemove)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var r=this._controls.indexOf(e);return r>-1&&this._controls.splice(r,1),e.onRemove(this),this},i.prototype.hasControl=function(t){return this._controls.indexOf(t)>-1},i.prototype.resize=function(e){var r=this._containerDimensions(),n=r[0],i=r[1];this._resizeCanvas(n,i),this.transform.resize(n,i),this.painter.resize(n,i);var a=!this._moving;return a&&(this.stop(),this.fire(new t.Event("movestart",e)).fire(new t.Event("move",e))),this.fire(new t.Event("resize",e)),a&&this.fire(new t.Event("moveend",e)),this},i.prototype.getBounds=function(){return this.transform.getBounds()},i.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},i.prototype.setMaxBounds=function(e){return this.transform.setMaxBounds(t.LngLatBounds.convert(e)),this._update()},i.prototype.setMinZoom=function(t){if((t=t??-2)>=-2&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=t,this._update(),this.getZoom()>t&&this.setZoom(t),this;throw new Error("maxZoom must be greater than the current minZoom")},i.prototype.getMaxZoom=function(){return this.transform.maxZoom},i.prototype.setMinPitch=function(t){if((t=t??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(t>=0&&t<=this.transform.maxPitch)return this.transform.minPitch=t,this._update(),this.getPitch()60)throw new Error("maxPitch must be less than or equal to 60");if(t>=this.transform.minPitch)return this.transform.maxPitch=t,this._update(),this.getPitch()>t&&this.setPitch(t),this;throw new Error("maxPitch must be greater than the current minPitch")},i.prototype.getMaxPitch=function(){return this.transform.maxPitch},i.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},i.prototype.setRenderWorldCopies=function(t){return this.transform.renderWorldCopies=t,this._update()},i.prototype.project=function(e){return this.transform.locationPoint(t.LngLat.convert(e))},i.prototype.unproject=function(e){return this.transform.pointLocation(t.Point.convert(e))},i.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},i.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},i.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},i.prototype._createDelegatedListener=function(t,e,r){var n,i=this;if("mouseenter"===t||"mouseover"===t){var a=!1;return{layer:e,listener:r,delegates:{mousemove:function(n){var o=i.getLayer(e)?i.queryRenderedFeatures(n.point,{layers:[e]}):[];o.length?a||(a=!0,r.call(i,new jn(t,i,n.originalEvent,{features:o}))):a=!1},mouseout:function(){a=!1}}}}if("mouseleave"===t||"mouseout"===t){var o=!1;return{layer:e,listener:r,delegates:{mousemove:function(n){(i.getLayer(e)?i.queryRenderedFeatures(n.point,{layers:[e]}):[]).length?o=!0:o&&(o=!1,r.call(i,new jn(t,i,n.originalEvent)))},mouseout:function(e){o&&(o=!1,r.call(i,new jn(t,i,e.originalEvent)))}}}}return{layer:e,listener:r,delegates:(n={},n[t]=function(t){var n=i.getLayer(e)?i.queryRenderedFeatures(t.point,{layers:[e]}):[];n.length&&(t.features=n,r.call(i,t),delete t.features)},n)}},i.prototype.on=function(t,e,r){if(void 0===r)return n.prototype.on.call(this,t,e);var i=this._createDelegatedListener(t,e,r);for(var a in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[t]=this._delegatedListeners[t]||[],this._delegatedListeners[t].push(i),i.delegates)this.on(a,i.delegates[a]);return this},i.prototype.once=function(t,e,r){if(void 0===r)return n.prototype.once.call(this,t,e);var i=this._createDelegatedListener(t,e,r);for(var a in i.delegates)this.once(a,i.delegates[a]);return this},i.prototype.off=function(t,e,r){var i=this;return void 0===r?n.prototype.off.call(this,t,e):(this._delegatedListeners&&this._delegatedListeners[t]&&function(n){for(var a=n[t],o=0;o180;){var s=n.locationPoint(e);if(s.x>=0&&s.y>=0&&s.x<=n.width&&s.y<=n.height)break;e.lng>n.center.lng?e.lng-=360:e.lng+=360}return e}Bi.prototype.down=function(t,e){this.mouseRotate.mousedown(t,e),this.mousePitch&&this.mousePitch.mousedown(t,e),r.disableDrag()},Bi.prototype.move=function(t,e){var r=this.map,n=this.mouseRotate.mousemoveWindow(t,e);if(n&&n.bearingDelta&&r.setBearing(r.getBearing()+n.bearingDelta),this.mousePitch){var i=this.mousePitch.mousemoveWindow(t,e);i&&i.pitchDelta&&r.setPitch(r.getPitch()+i.pitchDelta)}},Bi.prototype.off=function(){var t=this.element;r.removeEventListener(t,"mousedown",this.mousedown),r.removeEventListener(t,"touchstart",this.touchstart,{passive:!1}),r.removeEventListener(t,"touchmove",this.touchmove),r.removeEventListener(t,"touchend",this.touchend),r.removeEventListener(t,"touchcancel",this.reset),this.offTemp()},Bi.prototype.offTemp=function(){r.enableDrag(),r.removeEventListener(t.window,"mousemove",this.mousemove),r.removeEventListener(t.window,"mouseup",this.mouseup)},Bi.prototype.mousedown=function(e){this.down(t.extend({},e,{ctrlKey:!0,preventDefault:function(){return e.preventDefault()}}),r.mousePos(this.element,e)),r.addEventListener(t.window,"mousemove",this.mousemove),r.addEventListener(t.window,"mouseup",this.mouseup)},Bi.prototype.mousemove=function(t){this.move(t,r.mousePos(this.element,t))},Bi.prototype.mouseup=function(t){this.mouseRotate.mouseupWindow(t),this.mousePitch&&this.mousePitch.mouseupWindow(t),this.offTemp()},Bi.prototype.touchstart=function(t){1!==t.targetTouches.length?this.reset():(this._startPos=this._lastPos=r.touchPos(this.element,t.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:function(){return t.preventDefault()}},this._startPos))},Bi.prototype.touchmove=function(t){1!==t.targetTouches.length?this.reset():(this._lastPos=r.touchPos(this.element,t.targetTouches)[0],this.move({preventDefault:function(){return t.preventDefault()}},this._lastPos))},Bi.prototype.touchend=function(t){0===t.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)=r}this._isDragging&&(this._pos=e.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new t.Event("dragstart"))),this.fire(new t.Event("drag")))},n.prototype._onUp=function(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),"active"===this._state&&this.fire(new t.Event("dragend")),this._state="inactive"},n.prototype._addDragHandler=function(t){this._element.contains(t.originalEvent.target)&&(t.preventDefault(),this._positionDelta=t.point.sub(this._pos).add(this._offset),this._pointerdownPos=t.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},n.prototype.setDraggable=function(t){return this._draggable=!!t,this._map&&(t?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this},n.prototype.isDraggable=function(){return this._draggable},n.prototype.setRotation=function(t){return this._rotation=t||0,this._update(),this},n.prototype.getRotation=function(){return this._rotation},n.prototype.setRotationAlignment=function(t){return this._rotationAlignment=t||"auto",this._update(),this},n.prototype.getRotationAlignment=function(){return this._rotationAlignment},n.prototype.setPitchAlignment=function(t){return this._pitchAlignment=t&&"auto"!==t?t:this._rotationAlignment,this._update(),this},n.prototype.getPitchAlignment=function(){return this._pitchAlignment},n}(t.Evented),Hi={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},Gi=0,Wi=!1,Zi=function(e){function n(r){e.call(this),this.options=t.extend({},Hi,r),t.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.onAdd=function(e){return this._map=e,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),function(e){void 0!==Vi?e(Vi):void 0!==t.window.navigator.permissions?t.window.navigator.permissions.query({name:"geolocation"}).then((function(t){Vi="denied"!==t.state,e(Vi)})):(Vi=!!t.window.navigator.geolocation,e(Vi))}(this._setupUI),this._container},n.prototype.onRemove=function(){void 0!==this._geolocationWatchID&&(t.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),r.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Gi=0,Wi=!1},n.prototype._isOutOfMapMaxBounds=function(t){var e=this._map.getMaxBounds(),r=t.coords;return e&&(r.longitudee.getEast()||r.latitudee.getNorth())},n.prototype._setErrorState=function(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}},n.prototype._onSuccess=function(e){if(this._map){if(this._isOutOfMapMaxBounds(e))return this._setErrorState(),this.fire(new t.Event("outofmaxbounds",e)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=e,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(e),(!this.options.trackUserLocation||"ACTIVE_LOCK"===this._watchState)&&this._updateCamera(e),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("geolocate",e)),this._finish()}},n.prototype._updateCamera=function(e){var r=new t.LngLat(e.coords.longitude,e.coords.latitude),n=e.coords.accuracy,i=this._map.getBearing(),a=t.extend({bearing:i},this.options.fitBoundsOptions);this._map.fitBounds(r.toBounds(n),a,{geolocateSource:!0})},n.prototype._updateMarker=function(e){if(e){var r=new t.LngLat(e.coords.longitude,e.coords.latitude);this._accuracyCircleMarker.setLngLat(r).addTo(this._map),this._userLocationDotMarker.setLngLat(r).addTo(this._map),this._accuracy=e.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},n.prototype._updateCircleRadius=function(){var t=this._map._container.clientHeight/2,e=this._map.unproject([0,t]),r=this._map.unproject([1,t]),n=e.distanceTo(r),i=Math.ceil(2*this._accuracy/n);this._circleElement.style.width=i+"px",this._circleElement.style.height=i+"px"},n.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},n.prototype._onError=function(e){if(this._map){if(this.options.trackUserLocation)if(1===e.code){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;var r=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=r,this._geolocateButton.setAttribute("aria-label",r),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===e.code&&Wi)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("error",e)),this._finish()}},n.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},n.prototype._setupUI=function(e){var n=this;if(this._container.addEventListener("contextmenu",(function(t){return t.preventDefault()})),this._geolocateButton=r.create("button","mapboxgl-ctrl-geolocate",this._container),r.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",!1===e){t.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var i=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=i,this._geolocateButton.setAttribute("aria-label",i)}else{var a=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=a,this._geolocateButton.setAttribute("aria-label",a)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=r.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new qi(this._dotElement),this._circleElement=r.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new qi({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",(function(e){var r=e.originalEvent&&"resize"===e.originalEvent.type;!e.geolocateSource&&"ACTIVE_LOCK"===n._watchState&&!r&&(n._watchState="BACKGROUND",n._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),n._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),n.fire(new t.Event("trackuserlocationend")))}))},n.prototype.trigger=function(){if(!this._setup)return t.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new t.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Gi--,Wi=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new t.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new t.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){var e;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),++Gi>1?(e={maximumAge:6e5,timeout:0},Wi=!0):(e=this.options.positionOptions,Wi=!1),this._geolocationWatchID=t.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,e)}}else t.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},n.prototype._clearWatch=function(){t.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},n}(t.Evented),Yi={maxWidth:100,unit:"metric"},Xi=function(e){this.options=t.extend({},Yi,e),t.bindAll(["_onMove","setUnit"],this)};function $i(t,e,r){var n=r&&r.maxWidth||100,i=t._container.clientHeight/2,a=t.unproject([0,i]),o=t.unproject([n,i]),s=a.distanceTo(o);if(r&&"imperial"===r.unit){var l=3.2808*s;l>5280?Ki(e,n,l/5280,t._getUIString("ScaleControl.Miles")):Ki(e,n,l,t._getUIString("ScaleControl.Feet"))}else r&&"nautical"===r.unit?Ki(e,n,s/1852,t._getUIString("ScaleControl.NauticalMiles")):s>=1e3?Ki(e,n,s/1e3,t._getUIString("ScaleControl.Kilometers")):Ki(e,n,s,t._getUIString("ScaleControl.Meters"))}function Ki(t,e,r,n){var i=function(t){var e=Math.pow(10,(""+Math.floor(t)).length-1),r=t/e;return r=r>=10?10:r>=5?5:r>=3?3:r>=2?2:r>=1?1:function(t){var e=Math.pow(10,Math.ceil(-Math.log(t)/Math.LN10));return Math.round(t*e)/e}(r),e*r}(r),a=i/r;t.style.width=e*a+"px",t.innerHTML=i+" "+n}Xi.prototype.getDefaultPosition=function(){return"bottom-left"},Xi.prototype._onMove=function(){$i(this._map,this._container,this.options)},Xi.prototype.onAdd=function(t){return this._map=t,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},Xi.prototype.onRemove=function(){r.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},Xi.prototype.setUnit=function(t){this.options.unit=t,$i(this._map,this._container,this.options)};var Ji=function(e){this._fullscreen=!1,e&&e.container&&(e.container instanceof t.window.HTMLElement?this._container=e.container:t.warnOnce("Full screen control 'container' must be a DOM element.")),t.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in t.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in t.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in t.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in t.window.document&&(this._fullscreenchange="MSFullscreenChange")};Ji.prototype.onAdd=function(e){return this._map=e,this._container||(this._container=this._map.getContainer()),this._controlContainer=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",t.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},Ji.prototype.onRemove=function(){r.remove(this._controlContainer),this._map=null,t.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},Ji.prototype._checkFullscreenSupport=function(){return!!(t.window.document.fullscreenEnabled||t.window.document.mozFullScreenEnabled||t.window.document.msFullscreenEnabled||t.window.document.webkitFullscreenEnabled)},Ji.prototype._setupUI=function(){var e=this._fullscreenButton=r.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);r.create("span","mapboxgl-ctrl-icon",e).setAttribute("aria-hidden",!0),e.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),t.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},Ji.prototype._updateTitle=function(){var t=this._getTitle();this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.title=t},Ji.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},Ji.prototype._isFullscreen=function(){return this._fullscreen},Ji.prototype._changeIcon=function(){(t.window.document.fullscreenElement||t.window.document.mozFullScreenElement||t.window.document.webkitFullscreenElement||t.window.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())},Ji.prototype._onClickFullscreen=function(){this._isFullscreen()?t.window.document.exitFullscreen?t.window.document.exitFullscreen():t.window.document.mozCancelFullScreen?t.window.document.mozCancelFullScreen():t.window.document.msExitFullscreen?t.window.document.msExitFullscreen():t.window.document.webkitCancelFullScreen&&t.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()};var Qi={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},ta=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", "),ea=function(e){function n(r){e.call(this),this.options=t.extend(Object.create(Qi),r),t.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.addTo=function(e){return this._map&&this.remove(),this._map=e,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new t.Event("open")),this},n.prototype.isOpen=function(){return!!this._map},n.prototype.remove=function(){return this._content&&r.remove(this._content),this._container&&(r.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new t.Event("close")),this},n.prototype.getLngLat=function(){return this._lngLat},n.prototype.setLngLat=function(e){return this._lngLat=t.LngLat.convert(e),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this},n.prototype.trackPointer=function(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this},n.prototype.getElement=function(){return this._container},n.prototype.setText=function(e){return this.setDOMContent(t.window.document.createTextNode(e))},n.prototype.setHTML=function(e){var r,n=t.window.document.createDocumentFragment(),i=t.window.document.createElement("body");for(i.innerHTML=e;r=i.firstChild;)n.appendChild(r);return this.setDOMContent(n)},n.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},n.prototype.setMaxWidth=function(t){return this.options.maxWidth=t,this._update(),this},n.prototype.setDOMContent=function(t){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=r.create("div","mapboxgl-popup-content",this._container);return this._content.appendChild(t),this._createCloseButton(),this._update(),this._focusFirstElement(),this},n.prototype.addClassName=function(t){this._container&&this._container.classList.add(t)},n.prototype.removeClassName=function(t){this._container&&this._container.classList.remove(t)},n.prototype.setOffset=function(t){return this.options.offset=t,this._update(),this},n.prototype.toggleClassName=function(t){if(this._container)return this._container.classList.toggle(t)},n.prototype._createCloseButton=function(){this.options.closeButton&&(this._closeButton=r.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))},n.prototype._onMouseUp=function(t){this._update(t.point)},n.prototype._onMouseMove=function(t){this._update(t.point)},n.prototype._onDrag=function(t){this._update(t.point)},n.prototype._update=function(t){var e=this,n=this._lngLat||this._trackPointer;if(this._map&&n&&this._content&&(this._container||(this._container=r.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=r.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach((function(t){return e._container.classList.add(t)})),this._trackPointer&&this._container.classList.add("mapboxgl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=ji(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||t)){var i=this._pos=this._trackPointer&&t?t:this._map.project(this._lngLat),a=this.options.anchor,o=ra(this.options.offset);if(!a){var s,l=this._container.offsetWidth,c=this._container.offsetHeight;s=i.y+o.bottom.ythis._map.transform.height-c?["bottom"]:[],i.xthis._map.transform.width-l/2&&s.push("right"),a=0===s.length?"bottom":s.join("-")}var u=i.add(o[a]).round();r.setTransform(this._container,Ni[a]+" translate("+u.x+"px,"+u.y+"px)"),Ui(this._container,a,"popup")}},n.prototype._focusFirstElement=function(){if(this.options.focusAfterOpen&&this._container){var t=this._container.querySelector(ta);t&&t.focus()}},n.prototype._onClose=function(){this.remove()},n}(t.Evented);function ra(e){if(e){if("number"==typeof e){var r=Math.round(Math.sqrt(.5*Math.pow(e,2)));return{center:new t.Point(0,0),top:new t.Point(0,e),"top-left":new t.Point(r,r),"top-right":new t.Point(-r,r),bottom:new t.Point(0,-e),"bottom-left":new t.Point(r,-r),"bottom-right":new t.Point(-r,-r),left:new t.Point(e,0),right:new t.Point(-e,0)}}if(e instanceof t.Point||Array.isArray(e)){var n=t.Point.convert(e);return{center:n,top:n,"top-left":n,"top-right":n,bottom:n,"bottom-left":n,"bottom-right":n,left:n,right:n}}return{center:t.Point.convert(e.center||[0,0]),top:t.Point.convert(e.top||[0,0]),"top-left":t.Point.convert(e["top-left"]||[0,0]),"top-right":t.Point.convert(e["top-right"]||[0,0]),bottom:t.Point.convert(e.bottom||[0,0]),"bottom-left":t.Point.convert(e["bottom-left"]||[0,0]),"bottom-right":t.Point.convert(e["bottom-right"]||[0,0]),left:t.Point.convert(e.left||[0,0]),right:t.Point.convert(e.right||[0,0])}}return ra(new t.Point(0,0))}var na={version:t.version,supported:e,setRTLTextPlugin:t.setRTLTextPlugin,getRTLTextPluginStatus:t.getRTLTextPluginStatus,Map:Di,NavigationControl:Fi,GeolocateControl:Zi,AttributionControl:Mi,ScaleControl:Xi,FullscreenControl:Ji,Popup:ea,Marker:qi,Style:Ge,LngLat:t.LngLat,LngLatBounds:t.LngLatBounds,Point:t.Point,MercatorCoordinate:t.MercatorCoordinate,Evented:t.Evented,config:t.config,prewarm:function(){jt().acquire(Ot)},clearPrewarmedResources:function(){var t=Ft;t&&(t.isPreloaded()&&1===t.numActive()?(t.release(Ot),Ft=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},get accessToken(){return t.config.ACCESS_TOKEN},set accessToken(e){t.config.ACCESS_TOKEN=e},get baseApiUrl(){return t.config.API_URL},set baseApiUrl(e){t.config.API_URL=e},get workerCount(){return Rt.workerCount},set workerCount(t){Rt.workerCount=t},get maxParallelImageRequests(){return t.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(e){t.config.MAX_PARALLEL_IMAGE_REQUESTS=e},clearStorage:function(e){t.clearTileCache(e)},workerUrl:""};return na})),r},"object"==typeof t&&typeof e<"u"?e.exports=n():(r=r||self).mapboxgl=n()}}),b_=f({"src/plots/mapbox/layers.js"(t,e){var r=le(),n=Se().sanitizeHTML,i=d_(),a=l_();function o(t,e){this.subplot=t,this.uid=t.uid+"-"+e,this.index=e,this.idSource="source-"+this.uid,this.idLayer=a.layoutLayerPrefix+this.uid,this.sourceType=null,this.source=null,this.layerType=null,this.below=null,this.visible=!1}var s=o.prototype;function l(t){if(!t.visible)return!1;var e=t.source;if(Array.isArray(e)&&e.length>0){for(var n=0;n0}function c(t){var e={},n={};switch(t.type){case"circle":r.extendFlat(n,{"circle-radius":t.circle.radius,"circle-color":t.color,"circle-opacity":t.opacity});break;case"line":r.extendFlat(n,{"line-width":t.line.width,"line-color":t.color,"line-opacity":t.opacity,"line-dasharray":t.line.dash});break;case"fill":r.extendFlat(n,{"fill-color":t.color,"fill-outline-color":t.fill.outlinecolor,"fill-opacity":t.opacity});break;case"symbol":var a=t.symbol,o=i(a.textposition,a.iconsize);r.extendFlat(e,{"icon-image":a.icon+"-15","icon-size":a.iconsize/10,"text-field":a.text,"text-size":a.textfont.size,"text-anchor":o.anchor,"text-offset":o.offset,"symbol-placement":a.placement}),r.extendFlat(n,{"icon-color":t.color,"text-color":a.textfont.color,"text-opacity":t.opacity});break;case"raster":r.extendFlat(n,{"raster-fade-duration":0,"raster-opacity":t.opacity})}return{layout:e,paint:n}}s.update=function(t){this.visible?this.needsNewImage(t)?this.updateImage(t):this.needsNewSource(t)?(this.removeLayer(),this.updateSource(t),this.updateLayer(t)):this.needsNewLayer(t)?this.updateLayer(t):this.updateStyle(t):(this.updateSource(t),this.updateLayer(t)),this.visible=l(t)},s.needsNewImage=function(t){return this.subplot.map.getSource(this.idSource)&&"image"===this.sourceType&&"image"===t.sourcetype&&(this.source!==t.source||JSON.stringify(this.coordinates)!==JSON.stringify(t.coordinates))},s.needsNewSource=function(t){return this.sourceType!==t.sourcetype||JSON.stringify(this.source)!==JSON.stringify(t.source)||this.layerType!==t.type},s.needsNewLayer=function(t){return this.layerType!==t.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},s.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},s.updateImage=function(t){this.subplot.map.getSource(this.idSource).updateImage({url:t.source,coordinates:t.coordinates});var e=this.findFollowingMapboxLayerId(this.lookupBelow());null!==e&&this.subplot.map.moveLayer(this.idLayer,e)},s.updateSource=function(t){var e=this.subplot.map;if(e.getSource(this.idSource)&&e.removeSource(this.idSource),this.sourceType=t.sourcetype,this.source=t.source,l(t)){var r=function(t){var e,r=t.sourcetype,i=t.source,a={type:r};return"geojson"===r?e="data":"vector"===r?e="string"==typeof i?"url":"tiles":"raster"===r?(e="tiles",a.tileSize=256):"image"===r&&(e="url",a.coordinates=t.coordinates),a[e]=i,t.sourceattribution&&(a.attribution=n(t.sourceattribution)),a}(t);e.addSource(this.idSource,r)}},s.findFollowingMapboxLayerId=function(t){if("traces"===t)for(var e=this.subplot.getMapLayers(),r=0;r1)for(r=0;r-1&&m(e.originalEvent,n,[r.xaxis],[r.yaxis],r.id,t),i.indexOf("event")>-1&&l.click(n,e.originalEvent)}}},x.updateFx=function(t){var e=this,r=e.map,i=e.gd;if(!e.isStatic){var a,o=t.dragmode;a=function(t,r){r.isRect?(t.range={})[e.id]=[c([r.xmin,r.ymin]),c([r.xmax,r.ymax])]:(t.lassoPoints={})[e.id]=r.map(c)};var l=e.dragOptions;e.dragOptions=n.extendDeep(l||{},{dragmode:t.dragmode,element:e.div,gd:i,plotinfo:{id:e.id,domain:t[e.id].domain,xaxis:e.xaxis,yaxis:e.yaxis,fillRangeItems:a},xaxes:[e.xaxis],yaxes:[e.yaxis],subplot:e.id}),r.off("click",e.onClickInPanHandler),h(o)||u(o)?(r.dragPan.disable(),r.on("zoomstart",e.clearOutline),e.dragOptions.prepFn=function(t,r,n){p(t,r,n,e.dragOptions,o)},s.init(e.dragOptions)):(r.dragPan.enable(),r.off("zoomstart",e.clearOutline),e.div.onmousedown=null,e.div.ontouchstart=null,e.div.removeEventListener("touchstart",e.div._ontouchstart),e.onClickInPanHandler=e.onClickInPanFn(e.dragOptions),r.on("click",e.onClickInPanHandler))}function c(t){var r=e.map.unproject(t);return[r.lng,r.lat]}},x.updateFramework=function(t){var e=t[this.id].domain,r=t._size,n=this.div.style;n.width=r.w*(e.x[1]-e.x[0])+"px",n.height=r.h*(e.y[1]-e.y[0])+"px",n.left=r.l+e.x[0]*r.w+"px",n.top=r.t+(1-e.y[1])*r.h+"px",this.xaxis._offset=r.l+e.x[0]*r.w,this.xaxis._length=r.w*(e.x[1]-e.x[0]),this.yaxis._offset=r.t+(1-e.y[1])*r.h,this.yaxis._length=r.h*(e.y[1]-e.y[0])},x.updateLayers=function(t){var e,r=t[this.id].layers,n=this.layerList;if(r.length!==n.length){for(e=0;e1&&r.warn(p.multipleTokensErrorMsg),i[0]):(a.length&&r.log(["Listed mapbox access token(s)",a.join(","),"but did not use a Mapbox map style, ignoring token(s)."].join(" ")),"")}(t,o);e.accessToken=s;for(var l=0;lw/2){var T=v.split("|").join("
");_.text(T).attr("data-unformatted",T).call(c.convertToTspans,t),b=l.bBox(_.node())}_.attr("transform",n(-3,8-b.height)),x.insert("rect",".static-attribution").attr({x:-b.width-6,y:-b.height-3,width:b.width+6,height:b.height+3,fill:"rgba(255, 255, 255, 0.75)"});var A=1;b.width+6>w&&(A=w/(b.width+6));var k=[a.l+a.w*d.x[1],a.t+a.h*(1-d.y[0])];x.attr("transform",n(k[0],k[1])+i(A))}},t.updateFx=function(t){for(var e=t._fullLayout,r=e._subplots[h],n=0;n=0;r--)t.removeLayer(e[r][1])},o.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},e.exports=function(t,e){var n=e[0].trace,i=new a(t,n.uid),o=i.sourceId,s=r(e),l=i.below=t.belowLookup["trace-"+n.uid];return t.map.addSource(o,{type:"geojson",data:s.geojson}),i._addLayers(s,l),e[0].trace._glTrace=i,i}}}),L_=f({"src/traces/choroplethmapbox/index.js"(t,e){["*choroplethmapbox* trace is deprecated!","Please consider switching to the *choroplethmap* trace type and `map` subplots.","Learn more at: https://plotly.com/python/maplibre-migration/","as well as https://plotly.com/javascript/maplibre-migration/"].join(" "),e.exports={attributes:S_(),supplyDefaults:E_(),colorbar:Uo(),calc:_g(),plot:I_(),hoverPoints:Tg(),eventData:Ag(),selectPoints:kg(),styleOnSelect:function(t,e){e&&e[0].trace._glTrace.updateOnSelect(e)},getBelow:function(t,e){for(var r=e.getMapLayers(),n=r.length-2;n>=0;n--){var i=r[n].id;if("string"==typeof i&&0===i.indexOf("water"))for(var a=n+1;a0?+f[u]:0),h.push({type:"Feature",geometry:{type:"Point",coordinates:y},properties:v})}}var _=a.extractOpts(e),b=_.reversescale?a.flipScale(_.colorscale):_.colorscale,w=b[0][1],T=["interpolate",["linear"],["heatmap-density"],0,i.opacity(w)<1?w:i.addOpacity(w,0)];for(u=1;u=0;r--)t.removeLayer(e[r][1])},a.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},e.exports=function(t,e){var n=e[0].trace,a=new i(t,n.uid),o=a.sourceId,s=r(e),l=a.below=t.belowLookup["trace-"+n.uid];return t.map.addSource(o,{type:"geojson",data:s.geojson}),a._addLayers(s,l),a}}}),B_=f({"src/traces/densitymapbox/hover.js"(t,e){var r=ir(),n=y_().hoverPoints,i=y_().getExtraText;e.exports=function(t,e,a){var o=n(t,e,a);if(o){var s=o[0],l=s.cd,c=l[0].trace,u=l[s.index];if(delete s.color,"z"in u){var h=s.subplot.mockAxis;s.z=u.z,s.zLabel=r.tickText(h,h.c2l(u.z),"hover").text}return s.extraText=i(c,u,l[0].t.labels),[s]}}}}),j_=f({"src/traces/densitymapbox/event_data.js"(t,e){e.exports=function(t,e){return t.lon=e.lon,t.lat=e.lat,t.z=e.z,t}}}),N_=f({"src/traces/densitymapbox/index.js"(t,e){["*densitymapbox* trace is deprecated!","Please consider switching to the *densitymap* trace type and `map` subplots.","Learn more at: https://plotly.com/python/maplibre-migration/","as well as https://plotly.com/javascript/maplibre-migration/"].join(" "),e.exports={attributes:z_(),supplyDefaults:D_(),colorbar:Uo(),formatLabels:f_(),calc:O_(),plot:F_(),hoverPoints:B_(),eventData:j_(),getBelow:function(t,e){for(var r=e.getMapLayers(),n=0;nESRI"},ortoInstaMaps:{type:"raster",tiles:["https://tilemaps.icgc.cat/mapfactory/wmts/orto_8_12/CAT3857/{z}/{x}/{y}.png"],tileSize:256,maxzoom:13},ortoICGC:{type:"raster",tiles:["https://geoserveis.icgc.cat/icc_mapesmultibase/noutm/wmts/orto/GRID3857/{z}/{x}/{y}.jpeg"],tileSize:256,minzoom:13.1,maxzoom:20},openmaptiles:{type:"vector",url:"https://geoserveis.icgc.cat/contextmaps/basemap.json"}},sprite:"https://geoserveis.icgc.cat/contextmaps/sprites/sprite@1",glyphs:"https://geoserveis.icgc.cat/contextmaps/glyphs/{fontstack}/{range}.pbf",layers:[{id:"background",type:"background",paint:{"background-color":"#F4F9F4"}},{id:"ortoEsri",type:"raster",source:"ortoEsri",maxzoom:16,layout:{visibility:"visible"}},{id:"ortoICGC",type:"raster",source:"ortoICGC",minzoom:13.1,maxzoom:19,layout:{visibility:"visible"}},{id:"ortoInstaMaps",type:"raster",source:"ortoInstaMaps",maxzoom:13,layout:{visibility:"visible"}},{id:"waterway_tunnel",type:"line",source:"openmaptiles","source-layer":"waterway",minzoom:14,filter:["all",["in","class","river","stream","canal"],["==","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,6]]},"line-dasharray":[2,4]}},{id:"waterway-other",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["!in","class","canal","river","stream"],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,2]]}}},{id:"waterway-stream-canal",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["all",["in","class","canal","stream"],["!=","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,6]]}}},{id:"waterway-river",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["all",["==","class","river"],["!=","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.2,stops:[[10,.8],[20,4]]},"line-opacity":.5}},{id:"water-offset",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",maxzoom:8,filter:["==","$type","Polygon"],layout:{visibility:"visible"},paint:{"fill-opacity":0,"fill-color":"#a0c8f0","fill-translate":{base:1,stops:[[6,[2,0]],[8,[0,0]]]}}},{id:"water",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",layout:{visibility:"visible"},paint:{"fill-color":"hsl(210, 67%, 85%)","fill-opacity":0}},{id:"water-pattern",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",layout:{visibility:"visible"},paint:{"fill-translate":[0,2.5],"fill-pattern":"wave","fill-opacity":1}},{id:"landcover-ice-shelf",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"landcover",filter:["==","subclass","ice_shelf"],layout:{visibility:"visible"},paint:{"fill-color":"#fff","fill-opacity":{base:1,stops:[[0,.9],[10,.3]]}}},{id:"tunnel-service-track-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","service","track"]],layout:{"line-join":"round"},paint:{"line-color":"#cfcdca","line-dasharray":[.5,.25],"line-width":{base:1.2,stops:[[15,1],[16,4],[20,11]]}}},{id:"tunnel-minor-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","minor"]],layout:{"line-join":"round"},paint:{"line-color":"#cfcdca","line-opacity":{stops:[[12,0],[12.5,1]]},"line-width":{base:1.2,stops:[[12,.5],[13,1],[14,4],[20,15]]}}},{id:"tunnel-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[8,1.5],[20,17]]}}},{id:"tunnel-trunk-primary-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.7}},{id:"tunnel-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","motorway"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-dasharray":[.5,.25],"line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.5}},{id:"tunnel-path",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","tunnel"],["==","class","path"]]],paint:{"line-color":"#cba","line-dasharray":[1.5,.75],"line-width":{base:1.2,stops:[[15,1.2],[20,4]]}}},{id:"tunnel-service-track",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","service","track"]],layout:{"line-join":"round"},paint:{"line-color":"#fff","line-width":{base:1.2,stops:[[15.5,0],[16,2],[20,7.5]]}}},{id:"tunnel-minor",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","minor_road"]],layout:{"line-join":"round"},paint:{"line-color":"#fff","line-opacity":1,"line-width":{base:1.2,stops:[[13.5,0],[14,2.5],[20,11.5]]}}},{id:"tunnel-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#fff4c6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,10]]}}},{id:"tunnel-trunk-primary",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#fff4c6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"tunnel-motorway",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","motorway"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"#ffdaa6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"tunnel-railway",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","rail"]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]},"line-dasharray":[2,2]}},{id:"ferry",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["in","class","ferry"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(108, 159, 182, 1)","line-width":1.1,"line-dasharray":[2,2]}},{id:"aeroway-taxiway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:12,filter:["all",["in","class","taxiway"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(153, 153, 153, 1)","line-width":{base:1.5,stops:[[11,2],[17,12]]},"line-opacity":1}},{id:"aeroway-runway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:12,filter:["all",["in","class","runway"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(153, 153, 153, 1)","line-width":{base:1.5,stops:[[11,5],[17,55]]},"line-opacity":1}},{id:"aeroway-taxiway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:4,filter:["all",["in","class","taxiway"],["==","$type","LineString"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(255, 255, 255, 1)","line-width":{base:1.5,stops:[[11,1],[17,10]]},"line-opacity":{base:1,stops:[[11,0],[12,1]]}}},{id:"aeroway-runway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:4,filter:["all",["in","class","runway"],["==","$type","LineString"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(255, 255, 255, 1)","line-width":{base:1.5,stops:[[11,4],[17,50]]},"line-opacity":{base:1,stops:[[11,0],[12,1]]}}},{id:"highway-motorway-link-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:12,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway_link"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"highway-link-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"highway-minor-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!=","brunnel","tunnel"],["in","class","minor","service","track"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#cfcdca","line-opacity":{stops:[[12,0],[12.5,0]]},"line-width":{base:1.2,stops:[[12,.5],[13,1],[14,4],[20,15]]}}},{id:"highway-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":.5,"line-width":{base:1.2,stops:[[8,1.5],[20,17]]}}},{id:"highway-primary-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":{stops:[[7,0],[8,.6]]},"line-width":{base:1.2,stops:[[7,0],[8,.6],[9,1.5],[20,22]]}}},{id:"highway-trunk-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","trunk"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":{stops:[[5,0],[6,.5]]},"line-width":{base:1.2,stops:[[5,0],[6,.6],[7,1.5],[20,22]]}}},{id:"highway-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:4,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[4,0],[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":{stops:[[4,0],[5,.5]]}}},{id:"highway-path",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["==","class","path"]]],paint:{"line-color":"#cba","line-dasharray":[1.5,.75],"line-width":{base:1.2,stops:[[15,1.2],[20,4]]}}},{id:"highway-motorway-link",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:12,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway_link"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"highway-link",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"highway-minor",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!=","brunnel","tunnel"],["in","class","minor","service","track"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fff","line-opacity":.5,"line-width":{base:1.2,stops:[[13.5,0],[14,2.5],[20,11.5]]}}},{id:"highway-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[8,.5],[20,13]]},"line-opacity":.5}},{id:"highway-primary",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["in","class","primary"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[8.5,0],[9,.5],[20,18]]},"line-opacity":0}},{id:"highway-trunk",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["in","class","trunk"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"highway-motorway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"railway-transit",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","transit"],["!in","brunnel","tunnel"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.77)","line-width":{base:1.4,stops:[[14,.4],[20,1]]}}},{id:"railway-transit-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","transit"],["!in","brunnel","tunnel"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.68)","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,2],[20,6]]}}},{id:"railway-service",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","rail"],["has","service"]]],paint:{"line-color":"hsla(0, 0%, 73%, 0.77)","line-width":{base:1.4,stops:[[14,.4],[20,1]]}}},{id:"railway-service-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","rail"],["has","service"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.68)","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,2],[20,6]]}}},{id:"railway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!has","service"],["!in","brunnel","bridge","tunnel"],["==","class","rail"]]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]}}},{id:"railway-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!has","service"],["!in","brunnel","bridge","tunnel"],["==","class","rail"]]],paint:{"line-color":"#bbb","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,3],[20,8]]}}},{id:"bridge-motorway-link-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway_link"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"bridge-link-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"bridge-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[8,1.5],[20,28]]}}},{id:"bridge-trunk-primary-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"hsl(28, 76%, 67%)","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,26]]}}},{id:"bridge-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.5}},{id:"bridge-path-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","bridge"],["==","class","path"]]],paint:{"line-color":"#f8f4f0","line-width":{base:1.2,stops:[[15,1.2],[20,18]]}}},{id:"bridge-path",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","bridge"],["==","class","path"]]],paint:{"line-color":"#cba","line-width":{base:1.2,stops:[[15,1.2],[20,4]]},"line-dasharray":[1.5,.75]}},{id:"bridge-motorway-link",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway_link"]],layout:{"line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"bridge-link",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"bridge-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,20]]}}},{id:"bridge-trunk-primary",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]}}},{id:"bridge-motorway",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway"]],layout:{"line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"bridge-railway",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","rail"]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]}}},{id:"bridge-railway-hatching",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","rail"]],paint:{"line-color":"#bbb","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,3],[20,8]]}}},{id:"cablecar",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["==","class","cable_car"],layout:{visibility:"visible","line-cap":"round"},paint:{"line-color":"hsl(0, 0%, 70%)","line-width":{base:1,stops:[[11,1],[19,2.5]]}}},{id:"cablecar-dash",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["==","class","cable_car"],layout:{visibility:"visible","line-cap":"round"},paint:{"line-color":"hsl(0, 0%, 70%)","line-width":{base:1,stops:[[11,3],[19,5.5]]},"line-dasharray":[2,3]}},{id:"boundary-land-level-4",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",[">=","admin_level",4],["<=","admin_level",8],["!=","maritime",1]],layout:{"line-join":"round"},paint:{"line-color":"#9e9cab","line-dasharray":[3,1,1,1],"line-width":{base:1.4,stops:[[4,.4],[5,1],[12,3]]},"line-opacity":.6}},{id:"boundary-land-level-2",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["==","admin_level",2],["!=","maritime",1],["!=","disputed",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"hsl(248, 7%, 66%)","line-width":{base:1,stops:[[0,.6],[4,1.4],[5,2],[12,2]]}}},{id:"boundary-land-disputed",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["!=","maritime",1],["==","disputed",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"hsl(248, 7%, 70%)","line-dasharray":[1,3],"line-width":{base:1,stops:[[0,.6],[4,1.4],[5,2],[12,8]]}}},{id:"boundary-water",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["in","admin_level",2,4],["==","maritime",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(154, 189, 214, 1)","line-width":{base:1,stops:[[0,.6],[4,1],[5,1],[12,1]]},"line-opacity":{stops:[[6,0],[10,0]]}}},{id:"waterway-name",type:"symbol",source:"openmaptiles","source-layer":"waterway",minzoom:13,filter:["all",["==","$type","LineString"],["has","name"]],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":"{name:latin} {name:nonlatin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"line","text-letter-spacing":.2,"symbol-spacing":350},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"water-name-lakeline",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["==","$type","LineString"],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":"{name:latin}\n{name:nonlatin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"line","symbol-spacing":350,"text-letter-spacing":.2},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"water-name-ocean",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["all",["==","$type","Point"],["==","class","ocean"]],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":"{name:latin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"point","symbol-spacing":350,"text-letter-spacing":.2},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"water-name-other",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["all",["==","$type","Point"],["!in","class","ocean"]],layout:{"text-font":["Noto Sans Italic"],"text-size":{stops:[[0,10],[6,14]]},"text-field":"{name:latin}\n{name:nonlatin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"point","symbol-spacing":350,"text-letter-spacing":.2,visibility:"visible"},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"poi-level-3",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:16,filter:["all",["==","$type","Point"],[">=","rank",25]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":"{name:latin}\n{name:nonlatin}","text-offset":[0,.6],"text-size":12,"text-max-width":9},paint:{"text-halo-blur":.5,"text-color":"#666","text-halo-width":1,"text-halo-color":"#ffffff"}},{id:"poi-level-2",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:15,filter:["all",["==","$type","Point"],["<=","rank",24],[">=","rank",15]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":"{name:latin}\n{name:nonlatin}","text-offset":[0,.6],"text-size":12,"text-max-width":9},paint:{"text-halo-blur":.5,"text-color":"#666","text-halo-width":1,"text-halo-color":"#ffffff"}},{id:"poi-level-1",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:14,filter:["all",["==","$type","Point"],["<=","rank",14],["has","name"]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":"{name:latin}\n{name:nonlatin}","text-offset":[0,.6],"text-size":11,"text-max-width":9},paint:{"text-halo-blur":.5,"text-color":"rgba(191, 228, 172, 1)","text-halo-width":1,"text-halo-color":"rgba(30, 29, 29, 1)"}},{id:"poi-railway",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:13,filter:["all",["==","$type","Point"],["has","name"],["==","class","railway"],["==","subclass","station"]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":"{name:latin}\n{name:nonlatin}","text-offset":[0,.6],"text-size":12,"text-max-width":9,"icon-optional":!1,"icon-ignore-placement":!1,"icon-allow-overlap":!1,"text-ignore-placement":!1,"text-allow-overlap":!1,"text-optional":!0},paint:{"text-halo-blur":.5,"text-color":"#666","text-halo-width":1,"text-halo-color":"#ffffff"}},{id:"road_oneway",type:"symbol",source:"openmaptiles","source-layer":"transportation",minzoom:15,filter:["all",["==","oneway",1],["in","class","motorway","trunk","primary","secondary","tertiary","minor","service"]],layout:{"symbol-placement":"line","icon-image":"oneway","symbol-spacing":75,"icon-padding":2,"icon-rotation-alignment":"map","icon-rotate":90,"icon-size":{stops:[[15,.5],[19,1]]}},paint:{"icon-opacity":.5}},{id:"road_oneway_opposite",type:"symbol",source:"openmaptiles","source-layer":"transportation",minzoom:15,filter:["all",["==","oneway",-1],["in","class","motorway","trunk","primary","secondary","tertiary","minor","service"]],layout:{"symbol-placement":"line","icon-image":"oneway","symbol-spacing":75,"icon-padding":2,"icon-rotation-alignment":"map","icon-rotate":-90,"icon-size":{stops:[[15,.5],[19,1]]}},paint:{"icon-opacity":.5}},{id:"highway-name-path",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:15.5,filter:["==","class","path"],layout:{"text-size":{base:1,stops:[[13,12],[14,13]]},"text-font":["Noto Sans Regular"],"text-field":"{name:latin} {name:nonlatin}","symbol-placement":"line","text-rotation-alignment":"map"},paint:{"text-halo-color":"#f8f4f0","text-color":"hsl(30, 23%, 62%)","text-halo-width":.5}},{id:"highway-name-minor",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:15,filter:["all",["==","$type","LineString"],["in","class","minor","service","track"]],layout:{"text-size":{base:1,stops:[[13,12],[14,13]]},"text-font":["Noto Sans Regular"],"text-field":"{name:latin} {name:nonlatin}","symbol-placement":"line","text-rotation-alignment":"map"},paint:{"text-halo-blur":.5,"text-color":"#765","text-halo-width":1}},{id:"highway-name-major",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:12.2,filter:["in","class","primary","secondary","tertiary","trunk"],layout:{"text-size":{base:1,stops:[[13,12],[14,13]]},"text-font":["Noto Sans Regular"],"text-field":"{name:latin} {name:nonlatin}","symbol-placement":"line","text-rotation-alignment":"map"},paint:{"text-halo-blur":.5,"text-color":"#765","text-halo-width":1}},{id:"highway-shield",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:8,filter:["all",["<=","ref_length",6],["==","$type","LineString"],["!in","network","us-interstate","us-highway","us-state"]],layout:{"text-size":10,"icon-image":"road_{ref_length}","icon-rotation-alignment":"viewport","symbol-spacing":200,"text-font":["Noto Sans Regular"],"symbol-placement":{base:1,stops:[[10,"point"],[11,"line"]]},"text-rotation-alignment":"viewport","icon-size":1,"text-field":"{ref}"},paint:{"text-opacity":1,"text-color":"rgba(20, 19, 19, 1)","text-halo-color":"rgba(230, 221, 221, 0)","text-halo-width":2,"icon-color":"rgba(183, 18, 18, 1)","icon-opacity":.3,"icon-halo-color":"rgba(183, 55, 55, 0)"}},{id:"highway-shield-us-interstate",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:7,filter:["all",["<=","ref_length",6],["==","$type","LineString"],["in","network","us-interstate"]],layout:{"text-size":10,"icon-image":"{network}_{ref_length}","icon-rotation-alignment":"viewport","symbol-spacing":200,"text-font":["Noto Sans Regular"],"symbol-placement":{base:1,stops:[[7,"point"],[7,"line"],[8,"line"]]},"text-rotation-alignment":"viewport","icon-size":1,"text-field":"{ref}"},paint:{"text-color":"rgba(0, 0, 0, 1)"}},{id:"highway-shield-us-other",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:9,filter:["all",["<=","ref_length",6],["==","$type","LineString"],["in","network","us-highway","us-state"]],layout:{"text-size":10,"icon-image":"{network}_{ref_length}","icon-rotation-alignment":"viewport","symbol-spacing":200,"text-font":["Noto Sans Regular"],"symbol-placement":{base:1,stops:[[10,"point"],[11,"line"]]},"text-rotation-alignment":"viewport","icon-size":1,"text-field":"{ref}"},paint:{"text-color":"rgba(0, 0, 0, 1)"}},{id:"place-other",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",minzoom:12,filter:["!in","class","city","town","village","country","continent"],layout:{"text-letter-spacing":.1,"text-size":{base:1.2,stops:[[12,10],[15,14]]},"text-font":["Noto Sans Bold"],"text-field":"{name:latin}\n{name:nonlatin}","text-transform":"uppercase","text-max-width":9,visibility:"visible"},paint:{"text-color":"rgba(255,255,255,1)","text-halo-width":1.2,"text-halo-color":"rgba(57, 28, 28, 1)"}},{id:"place-village",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",minzoom:10,filter:["==","class","village"],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[10,12],[15,16]]},"text-field":"{name:latin}\n{name:nonlatin}","text-max-width":8,visibility:"visible"},paint:{"text-color":"rgba(255, 255, 255, 1)","text-halo-width":1.2,"text-halo-color":"rgba(10, 9, 9, 0.8)"}},{id:"place-town",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["==","class","town"],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[10,14],[15,24]]},"text-field":"{name:latin}\n{name:nonlatin}","text-max-width":8,visibility:"visible"},paint:{"text-color":"rgba(255, 255, 255, 1)","text-halo-width":1.2,"text-halo-color":"rgba(22, 22, 22, 0.8)"}},{id:"place-city",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["!=","capital",2],["==","class","city"]],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[7,14],[11,24]]},"text-field":"{name:latin}\n{name:nonlatin}","text-max-width":8,visibility:"visible"},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-width":1.2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-city-capital",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","capital",2],["==","class","city"]],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[7,14],[11,24]]},"text-field":"{name:latin}\n{name:nonlatin}","text-max-width":8,"icon-image":"star_11","text-offset":[.4,0],"icon-size":.8,"text-anchor":"left",visibility:"visible"},paint:{"text-color":"#333","text-halo-width":1.2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-other",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],[">=","rank",3],["!has","iso_a2"]],layout:{"text-font":["Noto Sans Italic"],"text-field":"{name:latin}","text-size":{stops:[[3,11],[7,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-3",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],[">=","rank",3],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[3,11],[7,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-2",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],["==","rank",2],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[2,11],[5,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-1",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],["==","rank",1],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[1,11],[4,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-continent",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",maxzoom:1,filter:["==","class","continent"],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":14,"text-max-width":6.25,"text-transform":"uppercase",visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}}],id:"qebnlkra6"}}}),q_=f({"src/plots/map/styles/arcgis-sat.js"(t,e){e.exports={version:8,name:"orto",metadata:{},center:[1.537786,41.837539],zoom:12,bearing:0,pitch:0,light:{anchor:"viewport",color:"white",intensity:.4,position:[1.15,45,30]},sources:{ortoEsri:{type:"raster",tiles:["https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}"],tileSize:256,maxzoom:18,attribution:"ESRI © ESRI"},ortoInstaMaps:{type:"raster",tiles:["https://tilemaps.icgc.cat/mapfactory/wmts/orto_8_12/CAT3857/{z}/{x}/{y}.png"],tileSize:256,maxzoom:13},ortoICGC:{type:"raster",tiles:["https://geoserveis.icgc.cat/icc_mapesmultibase/noutm/wmts/orto/GRID3857/{z}/{x}/{y}.jpeg"],tileSize:256,minzoom:13.1,maxzoom:20},openmaptiles:{type:"vector",url:"https://geoserveis.icgc.cat/contextmaps/basemap.json"}},sprite:"https://geoserveis.icgc.cat/contextmaps/sprites/sprite@1",glyphs:"https://geoserveis.icgc.cat/contextmaps/glyphs/{fontstack}/{range}.pbf",layers:[{id:"background",type:"background",paint:{"background-color":"#F4F9F4"}},{id:"ortoEsri",type:"raster",source:"ortoEsri",maxzoom:16,layout:{visibility:"visible"}},{id:"ortoICGC",type:"raster",source:"ortoICGC",minzoom:13.1,maxzoom:19,layout:{visibility:"visible"}},{id:"ortoInstaMaps",type:"raster",source:"ortoInstaMaps",maxzoom:13,layout:{visibility:"visible"}}]}}}),H_=f({"src/plots/map/constants.js"(t,e){var r=Zt(),n=V_(),i="https://basemaps.cartocdn.com/gl/positron-gl-style/style.json",a="https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json",o="https://basemaps.cartocdn.com/gl/voyager-gl-style/style.json",s={basic:o,streets:o,outdoors:o,light:i,dark:a,satellite:q_(),"satellite-streets":n,"open-street-map":{id:"osm",version:8,sources:{"plotly-osm-tiles":{type:"raster",attribution:'© OpenStreetMap contributors',tiles:["https://tile.openstreetmap.org/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-osm-tiles",type:"raster",source:"plotly-osm-tiles",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"white-bg":{id:"white-bg",version:8,sources:{},layers:[{id:"white-bg",type:"background",paint:{"background-color":"#FFFFFF"},minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"carto-positron":i,"carto-darkmatter":a,"carto-voyager":o,"carto-positron-nolabels":"https://basemaps.cartocdn.com/gl/positron-nolabels-gl-style/style.json","carto-darkmatter-nolabels":"https://basemaps.cartocdn.com/gl/dark-matter-nolabels-gl-style/style.json","carto-voyager-nolabels":"https://basemaps.cartocdn.com/gl/voyager-nolabels-gl-style/style.json"},l=r(s);e.exports={styleValueDflt:"basic",stylesMap:s,styleValuesMap:l,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",missingStyleErrorMsg:["No valid maplibre style found, please set `map.style` to one of:",l.join(", "),"or use a tile service."].join("\n"),mapOnErrorMsg:"Map error."}}}),G_=f({"src/plots/map/layout_attributes.js"(t,e){var r=le(),n=H().defaultLine,i=Aa().attributes,a=F(),o=Tn().textposition,s=Pt().overrideAll,l=ye().templatedArray,c=H_(),u=a({noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0});u.family.dflt="Open Sans Regular, Arial Unicode MS Regular",(e.exports=s({_arrayAttrRegexps:[r.counterRegex("map",".layers",!0)],domain:i({name:"map"}),style:{valType:"any",values:c.styleValuesMap,dflt:c.styleValueDflt},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},bounds:{west:{valType:"number"},east:{valType:"number"},south:{valType:"number"},north:{valType:"number"}},layers:l("layer",{visible:{valType:"boolean",dflt:!0},sourcetype:{valType:"enumerated",values:["geojson","vector","raster","image"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},sourceattribution:{valType:"string"},type:{valType:"enumerated",values:["circle","line","fill","symbol","raster"],dflt:"circle"},coordinates:{valType:"any"},below:{valType:"string"},color:{valType:"color",dflt:n},opacity:{valType:"number",min:0,max:1,dflt:1},minzoom:{valType:"number",min:0,max:24,dflt:0},maxzoom:{valType:"number",min:0,max:24,dflt:24},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2},dash:{valType:"data_array"}},fill:{outlinecolor:{valType:"color",dflt:n}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},placement:{valType:"enumerated",values:["point","line","line-center"],dflt:"point"},textfont:u,textposition:r.extendFlat({},o,{arrayOk:!1})}})},"plot","from-root")).uirevision={valType:"any",editType:"none"}}}),W_=f({"src/traces/scattermap/attributes.js"(t,e){var r=Ot().hovertemplateAttrs,n=Ot().texttemplateAttrs,i=wn(),a=Vm(),o=Tn(),s=G_(),l=U(),c=Pe(),u=R().extendFlat,h=Pt().overrideAll,p=G_(),f=a.line,d=a.marker;e.exports=h({lon:a.lon,lat:a.lat,cluster:{enabled:{valType:"boolean"},maxzoom:u({},p.layers.maxzoom,{}),step:{valType:"number",arrayOk:!0,dflt:-1,min:-1},size:{valType:"number",arrayOk:!0,dflt:20,min:0},color:{valType:"color",arrayOk:!0},opacity:u({},d.opacity,{dflt:1})},mode:u({},o.mode,{dflt:"markers"}),text:u({},o.text,{}),texttemplate:n({editType:"plot"},{keys:["lat","lon","text"]}),hovertext:u({},o.hovertext,{}),line:{color:f.color,width:f.width},connectgaps:o.connectgaps,marker:u({symbol:{valType:"string",dflt:"circle",arrayOk:!0},angle:{valType:"number",dflt:"auto",arrayOk:!0},allowoverlap:{valType:"boolean",dflt:!1},opacity:d.opacity,size:d.size,sizeref:d.sizeref,sizemin:d.sizemin,sizemode:d.sizemode},c("marker")),fill:a.fill,fillcolor:i(),textfont:s.layers.symbol.textfont,textposition:s.layers.symbol.textposition,below:{valType:"string"},selected:{marker:o.selected.marker},unselected:{marker:o.unselected.marker},hoverinfo:u({},l.hoverinfo,{flags:["lon","lat","text","name"]}),hovertemplate:r()},"calc","nested")}}),Z_=f({"src/traces/scattermap/constants.js"(t,e){var r=["Metropolis Black Italic","Metropolis Black","Metropolis Bold Italic","Metropolis Bold","Metropolis Extra Bold Italic","Metropolis Extra Bold","Metropolis Extra Light Italic","Metropolis Extra Light","Metropolis Light Italic","Metropolis Light","Metropolis Medium Italic","Metropolis Medium","Metropolis Regular Italic","Metropolis Regular","Metropolis Semi Bold Italic","Metropolis Semi Bold","Metropolis Thin Italic","Metropolis Thin","Open Sans Bold Italic","Open Sans Bold","Open Sans Extrabold Italic","Open Sans Extrabold","Open Sans Italic","Open Sans Light Italic","Open Sans Light","Open Sans Regular","Open Sans Semibold Italic","Open Sans Semibold","Klokantech Noto Sans Bold","Klokantech Noto Sans CJK Bold","Klokantech Noto Sans CJK Regular","Klokantech Noto Sans Italic","Klokantech Noto Sans Regular"];e.exports={isSupportedFont:function(t){return-1!==r.indexOf(t)}}}}),Y_=f({"src/traces/scattermap/defaults.js"(t,e){var r=le(),n=Ye(),i=Zn(),a=Yn(),o=$n(),s=Kn(),l=W_(),c=Z_().isSupportedFont;e.exports=function(t,e,u,h){function p(n,i){return r.coerce(t,e,l,n,i)}function f(n,i){return r.coerce2(t,e,l,n,i)}var d=function(t,e,r){var n=r("lon")||[],i=r("lat")||[],a=Math.min(n.length,i.length);return e._length=a,a}(0,e,p);if(d){if(p("text"),p("texttemplate"),p("hovertext"),p("hovertemplate"),p("mode"),p("below"),n.hasMarkers(e)){i(t,e,u,h,p,{noLine:!0,noAngle:!0}),p("marker.allowoverlap"),p("marker.angle");var m=e.marker;"circle"!==m.symbol&&(r.isArrayOrTypedArray(m.size)&&(m.size=m.size[0]),r.isArrayOrTypedArray(m.color)&&(m.color=m.color[0]))}n.hasLines(e)&&(a(t,e,u,h,p,{noDash:!0}),p("connectgaps"));var g=f("cluster.maxzoom"),y=f("cluster.step"),v=f("cluster.color",e.marker&&e.marker.color||u),x=f("cluster.size"),_=f("cluster.opacity");if(p("cluster.enabled",!1!==g||!1!==y||!1!==v||!1!==x||!1!==_)||n.hasText(e)){var b=h.font.family;o(t,e,h,p,{noSelect:!0,noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,font:{family:c(b)?b:"Open Sans Regular",weight:h.font.weight,style:h.font.style,size:h.font.size,color:h.font.color}})}p("fill"),"none"!==e.fill&&s(t,e,u,p),r.coerceSelectionMarkerOpacity(e,p)}else e.visible=!1}}}),X_=f({"src/traces/scattermap/format_labels.js"(t,e){var r=ir();e.exports=function(t,e,n){var i={},a=n[e.subplot]._subplot.mockAxis,o=t.lonlat;return i.lonLabel=r.tickText(a,a.c2l(o[0]),!0).text,i.latLabel=r.tickText(a,a.c2l(o[1]),!0).text,i}}}),$_=f({"src/plots/map/convert_text_opts.js"(t,e){var r=le();e.exports=function(t,e){var n=t.split(" "),i=n[0],a=n[1],o=r.isArrayOrTypedArray(e)?r.mean(e):e,s=.5+o/100,l=1.5+o/100,c=["",""],u=[0,0];switch(i){case"top":c[0]="top",u[1]=-l;break;case"bottom":c[0]="bottom",u[1]=l}switch(a){case"left":c[1]="right",u[0]=-s;break;case"right":c[1]="left",u[0]=s}return{anchor:c[0]&&c[1]?c.join("-"):c[0]?c[0]:c[1]?c[1]:"center",offset:u}}}}),K_=f({"src/traces/scattermap/convert.js"(t,e){var r=A(),n=le(),i=k().BADNUM,a=Xm(),o=Ze(),s=Qe(),l=Xe(),c=Ye(),u=Z_().isSupportedFont,h=$_(),p=$e().appendArrayPointValue,f=Se().NEWLINES,d=Se().BR_TAG_ALL;function m(t){return{type:t,geojson:a.makeBlank(),layout:{visibility:"none"},filter:null,paint:{}}}function g(t,e){return n.isArrayOrTypedArray(t)?e?function(e){return r(t[e])?+t[e]:0}:function(e){return t[e]}:t?function(){return t}:y}function y(){return""}function v(t){return t[0]===i}function x(t,e){var r;if(n.isArrayOrTypedArray(t)&&n.isArrayOrTypedArray(e)){r=["step",["get","point_count"],t[0]];for(var i=1;i850?" Black":i>750?" Extra Bold":i>650?" Bold":i>550?" Semi Bold":i>450?" Medium":i>350?" Regular":i>250?" Light":i>150?" Extra Light":" Thin"):"Open Sans"===a.slice(0,2).join(" ")?(s="Open Sans",s+=i>750?" Extrabold":i>650?" Bold":i>550?" Semibold":i>350?" Regular":" Light"):"Klokantech Noto Sans"===a.slice(0,3).join(" ")&&(s="Klokantech Noto Sans","CJK"===a[3]&&(s+=" CJK"),s+=i>500?" Bold":" Regular")),o&&(s+=" Italic"),"Open Sans Regular Italic"===s?s="Open Sans Italic":"Open Sans Regular Bold"===s?s="Open Sans Bold":"Open Sans Regular Bold Italic"===s?s="Open Sans Bold Italic":"Klokantech Noto Sans Regular Italic"===s&&(s="Klokantech Noto Sans Italic"),u(s)||(s=r),s.split(", ")}e.exports=function(t,e){var i,u=e[0].trace,b=!0===u.visible&&0!==u._length,w="none"!==u.fill,T=c.hasLines(u),A=c.hasMarkers(u),k=c.hasText(u),M=A&&"circle"===u.marker.symbol,S=A&&"circle"!==u.marker.symbol,E=u.cluster&&u.cluster.enabled,C=m("fill"),I=m("line"),L=m("circle"),P=m("symbol"),z={fill:C,line:I,circle:L,symbol:P};if(!b)return z;if((w||T)&&(i=a.calcTraceToLineCoords(e)),w&&(C.geojson=a.makePolygon(i),C.layout.visibility="visible",n.extendFlat(C.paint,{"fill-color":u.fillcolor})),T&&(I.geojson=a.makeLine(i),I.layout.visibility="visible",n.extendFlat(I.paint,{"line-width":u.line.width,"line-color":u.line.color,"line-opacity":u.opacity})),M){var D=function(t){var e,i,a,c,u=t[0].trace,h=u.marker,p=u.selectedpoints,f=n.isArrayOrTypedArray(h.color),d=n.isArrayOrTypedArray(h.size),m=n.isArrayOrTypedArray(h.opacity);function g(t){return u.opacity*t}f&&(i=o.hasColorscale(u,"marker")?o.makeColorScaleFuncFromTrace(h):n.identity),d&&(a=l(u)),m&&(c=function(t){return g(r(t)?+n.constrain(t,0,1):0)});var y,x=[];for(e=0;e=0;r--){var n=e[r];i.removeLayer(u.layerIds[n])}t||i.removeSource(u.sourceIds.circle)}(t):function(t){for(var e=a.nonCluster,r=e.length-1;r>=0;r--){var n=e[r];i.removeLayer(u.layerIds[n]),t||i.removeSource(u.sourceIds[n])}}(t)}function p(t){l?function(t){t||u.addSource("circle",o.circle,e.cluster);for(var r=a.cluster,n=0;n=0;r--){var n=e[r];t.removeLayer(this.layerIds[n]),t.removeSource(this.sourceIds[n])}},e.exports=function(t,e){var r,i,s,l=e[0].trace,c=l.cluster&&l.cluster.enabled,u=!0!==l.visible,h=new o(t,l.uid,c,u),p=n(t.gd,e),f=h.below=t.belowLookup["trace-"+l.uid];if(c)for(h.addSource("circle",p.circle,l.cluster),r=0;r")}function u(t){return t+"°"}}e.exports={hoverPoints:function(t,e,a){var c=t.cd,u=c[0].trace,h=t.xa,p=t.ya,f=t.subplot,d=[],m=s+u.uid+"-circle",g=u.cluster&&u.cluster.enabled;if(g){var y=f.map.queryRenderedFeatures(null,{layers:[m]});d=y.map((function(t){return t.id}))}var v=360*(e>=0?Math.floor((e+180)/360):Math.ceil((e-180)/360)),x=e-v;if(r.getClosest(c,(function(t){var e=t.lonlat;if(e[0]===o||g&&-1===d.indexOf(t.i+1))return 1/0;var r=n.modHalf(e[0],360),i=e[1],s=f.project([r,i]),l=s.x-h.c2p([x,i]),c=s.y-p.c2p([r,a]),u=Math.max(3,t.mrc||0);return Math.max(Math.sqrt(l*l+c*c)-u,1-3/u)}),t),!1!==t.index){var _=c[t.index],b=_.lonlat,w=[n.modHalf(b[0],360)+v,b[1]],T=h.c2p(w),A=p.c2p(w),k=_.mrc||1;t.x0=T-k,t.x1=T+k,t.y0=A-k,t.y1=A+k;var M={};M[u.subplot]={_subplot:f};var S=u._module.formatLabels(_,u,M);return t.lonLabel=S.lonLabel,t.latLabel=S.latLabel,t.color=i(u,_),t.extraText=l(u,_,c[0].t.labels),t.hovertemplate=u.hovertemplate,[t]}},getExtraText:l}}}),tb=f({"src/traces/scattermap/event_data.js"(t,e){e.exports=function(t,e){return t.lon=e.lon,t.lat=e.lat,t}}}),eb=f({"src/traces/scattermap/select.js"(t,e){var r=le(),n=Ye(),i=k().BADNUM;e.exports=function(t,e){var a,o=t.cd,s=t.xaxis,l=t.yaxis,c=[],u=o[0].trace;if(!n.hasMarkers(u))return[];if(!1===e)for(a=0;a1)return 1;for(var r=t,n=0;n<8;n++){var i=this.sampleCurveX(r)-t;if(Math.abs(i)i?o=r:s=r,r=.5*(s-o)+o;return r},solve:function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))}};var d=n(p);let m,g;function y(){return null==m&&(m=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof createImageBitmap),m}function v(){if(null==g&&(g=!1,y())){let t=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(t){for(let e=0;e<25;e++){let r=4*e;t.fillStyle=`rgb(${r},${r+1},${r+2})`,t.fillRect(e%5,Math.floor(e/5),1,1)}let e=t.getImageData(0,0,5,5).data;for(let t=0;t<100;t++)if(t%4!=3&&e[t]!==t){g=!0;break}}}return g||!1}function x(t,e,r,n){let i=new d(t,e,r,n);return t=>i.solve(t)}let _=x(.25,.1,.25,1);function b(t,e,r){return Math.min(r,Math.max(e,t))}function w(t,e,r){let n=r-e,i=((t-e)%n+n)%n+e;return i===e?r:i}function T(t,...e){for(let r of e)for(let e in r)t[e]=r[e];return t}let A=1;function k(t,e,r){let n={};for(let r in t)n[r]=e.call(this,t[r],r,t);return n}function M(t,e,r){let n={};for(let r in t)e.call(this,t[r],r,t)&&(n[r]=t[r]);return n}function S(t){return Array.isArray(t)?t.map(S):"object"==typeof t&&t?k(t,S):t}let E={};function C(t){E[t]||(typeof console<"u"&&console.warn(t),E[t]=!0)}function I(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function L(t){return typeof WorkerGlobalScope<"u"&&void 0!==t&&t instanceof WorkerGlobalScope}let P=null;function z(t){return typeof ImageBitmap<"u"&&t instanceof ImageBitmap}let D="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function O(t,r,n,i,a){return e(this,void 0,void 0,(function*(){if(typeof VideoFrame>"u")throw new Error("VideoFrame not supported");let e=new VideoFrame(t,{timestamp:0});try{let o=e?.format;if(!o||!o.startsWith("BGR")&&!o.startsWith("RGB"))throw new Error(`Unrecognized format ${o}`);let s=o.startsWith("BGR"),l=new Uint8ClampedArray(i*a*4);if(yield e.copyTo(l,function(t,e,r,n,i){let a=4*Math.max(-e,0),o=(Math.max(0,r)-r)*n*4+a,s=4*n,l=Math.max(0,e),c=Math.max(0,r);return{rect:{x:l,y:c,width:Math.min(t.width,e+n)-l,height:Math.min(t.height,r+i)-c},layout:[{offset:o,stride:s}]}}(t,r,n,i,a)),s)for(let t=0;tL(self)?self.worker&&self.worker.referrer:("blob:"===window.location.protocol?window.parent:window).location.href,G=function(t,r){if(/:\/\//.test(t.url)&&!/^https?:|^file:/.test(t.url)){let e=U(t.url);if(e)return e(t,r);if(L(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:t,targetMapId:V},r)}if(!(/^file:/.test(n=t.url)||/^file:/.test(H())&&!/^\w+:/.test(n))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return function(t,r){return e(this,void 0,void 0,(function*(){let e=new Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,cache:t.cache,referrer:H(),signal:r.signal});"json"!==t.type||e.headers.has("Accept")||e.headers.set("Accept","application/json");let n,i=yield fetch(e);if(!i.ok){let e=yield i.blob();throw new q(i.status,i.statusText,t.url,e)}n="arrayBuffer"===t.type||"image"===t.type?i.arrayBuffer():"json"===t.type?i.json():i.text();let a=yield n;if(r.signal.aborted)throw j();return{data:a,cacheControl:i.headers.get("Cache-Control"),expires:i.headers.get("Expires")}}))}(t,r);if(L(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:t,mustQueue:!0,targetMapId:V},r)}var n,i,a;return i=t,a=r,new Promise(((t,e)=>{var r;let n=new XMLHttpRequest;n.open(i.method||"GET",i.url,!0),"arrayBuffer"!==i.type&&"image"!==i.type||(n.responseType="arraybuffer");for(let t in i.headers)n.setRequestHeader(t,i.headers[t]);"json"===i.type&&(n.responseType="text",!(null===(r=i.headers)||void 0===r)&&r.Accept||n.setRequestHeader("Accept","application/json")),n.withCredentials="include"===i.credentials,n.onerror=()=>{e(new Error(n.statusText))},n.onload=()=>{if(!a.signal.aborted)if((n.status>=200&&n.status<300||0===n.status)&&null!==n.response){let r=n.response;if("json"===i.type)try{r=JSON.parse(n.response)}catch(t){return void e(t)}t({data:r,cacheControl:n.getResponseHeader("Cache-Control"),expires:n.getResponseHeader("Expires")})}else{let t=new Blob([n.response],{type:n.getResponseHeader("Content-Type")});e(new q(n.status,n.statusText,i.url,t))}},a.signal.addEventListener("abort",(()=>{n.abort(),e(j())})),n.send(i.body)}))};function W(t){if(!t||t.indexOf("://")<=0||0===t.indexOf("data:image/")||0===t.indexOf("blob:"))return!0;let e=new URL(t),r=window.location;return e.protocol===r.protocol&&e.host===r.host}function Z(t,e,r){r[t]&&-1!==r[t].indexOf(e)||(r[t]=r[t]||[],r[t].push(e))}function Y(t,e,r){if(r&&r[t]){let n=r[t].indexOf(e);-1!==n&&r[t].splice(n,1)}}class X{constructor(t,e={}){T(this,e),this.type=t}}class $ extends X{constructor(t,e={}){super("error",T({error:t},e))}}class K{on(t,e){return this._listeners=this._listeners||{},Z(t,e,this._listeners),this}off(t,e){return Y(t,e,this._listeners),Y(t,e,this._oneTimeListeners),this}once(t,e){return e?(this._oneTimeListeners=this._oneTimeListeners||{},Z(t,e,this._oneTimeListeners),this):new Promise((e=>this.once(t,e)))}fire(t,e){"string"==typeof t&&(t=new X(t,e||{}));let r=t.type;if(this.listens(r)){t.target=this;let e=this._listeners&&this._listeners[r]?this._listeners[r].slice():[];for(let r of e)r.call(this,t);let n=this._oneTimeListeners&&this._oneTimeListeners[r]?this._oneTimeListeners[r].slice():[];for(let e of n)Y(r,e,this._oneTimeListeners),e.call(this,t);let i=this._eventedParent;i&&(T(t,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),i.fire(t))}else t instanceof $&&console.error(t.error);return this}listens(t){return this._listeners&&this._listeners[t]&&this._listeners[t].length>0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)}setEventedParent(t,e){return this._eventedParent=t,this._eventedParentData=e,this}}var J={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"enum",default:"mercator",values:{mercator:{},globe:{}}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}};let Q=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function tt(t,e){let r={};for(let e in t)"ref"!==e&&(r[e]=t[e]);return Q.forEach((t=>{t in e&&(r[t]=e[t])})),r}function et(t,e){if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(let r=0;r`:"value"===t.itemType.kind?"array":`array<${e}>`}return t.kind}let Et=[dt,mt,gt,yt,vt,wt,xt,Mt(_t),Tt,At,kt];function Ct(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!Ct(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(let t of Et)if(!Ct(t,e))return null}return`Expected ${St(t)} but found ${St(e)} instead.`}function It(t,e){return e.some((e=>e.kind===t.kind))}function Lt(t,e){return e.some((e=>"null"===e?null===t:"array"===e?Array.isArray(t):"object"===e?t&&!Array.isArray(t)&&"object"==typeof t:e===typeof t))}function Pt(t,e){return"array"===t.kind&&"array"===e.kind?t.itemType.kind===e.itemType.kind&&"number"==typeof t.N:t.kind===e.kind}let zt=.96422,Dt=.82521,Ot=4/29,Rt=6/29,Ft=3*Rt*Rt,Bt=Rt*Rt*Rt,jt=Math.PI/180,Nt=180/Math.PI;function Ut(t){return(t%=360)<0&&(t+=360),t}function Vt([t,e,r,n]){let i,a,o=Ht((.2225045*(t=qt(t))+.7168786*(e=qt(e))+.0606169*(r=qt(r)))/1);t===e&&e===r?i=a=o:(i=Ht((.4360747*t+.3850649*e+.1430804*r)/zt),a=Ht((.0139322*t+.0971045*e+.7141733*r)/Dt));let s=116*o-16;return[s<0?0:s,500*(i-o),200*(o-a),n]}function qt(t){return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Ht(t){return t>Bt?Math.pow(t,1/3):t/Ft+Ot}function Gt([t,e,r,n]){let i=(t+16)/116,a=isNaN(e)?i:i+e/500,o=isNaN(r)?i:i-r/200;return i=1*Zt(i),a=zt*Zt(a),o=Dt*Zt(o),[Wt(3.1338561*a-1.6168667*i-.4906146*o),Wt(-.9787684*a+1.9161415*i+.033454*o),Wt(.0719453*a-.2289914*i+1.4052427*o),n]}function Wt(t){return(t=t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055)<0?0:t>1?1:t}function Zt(t){return t>Rt?t*t*t:Ft*(t-Ot)}function Yt(t){return parseInt(t.padEnd(2,t),16)/255}function Xt(t,e){return $t(e?t/100:t,0,1)}function $t(t,e,r){return Math.min(Math.max(e,t),r)}function Kt(t){return!t.some(Number.isNaN)}let Jt={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};class Qt{constructor(t,e,r,n=1,i=!0){this.r=t,this.g=e,this.b=r,this.a=n,i||(this.r*=n,this.g*=n,this.b*=n,n||this.overwriteGetter("rgb",[t,e,r,n]))}static parse(t){if(t instanceof Qt)return t;if("string"!=typeof t)return;let e=function(t){if("transparent"===(t=t.toLowerCase().trim()))return[0,0,0,0];let e=Jt[t];if(e){let[t,r,n]=e;return[t/255,r/255,n/255,1]}if(t.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(t)){let e=t.length<6?1:2,r=1;return[Yt(t.slice(r,r+=e)),Yt(t.slice(r,r+=e)),Yt(t.slice(r,r+=e)),Yt(t.slice(r,r+e)||"ff")]}if(t.startsWith("rgb")){let e=t.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(e){let[t,r,n,i,a,o,s,l,c,u,h,p]=e,f=[i||" ",s||" ",u].join("");if(" "===f||" /"===f||",,"===f||",,,"===f){let t=[n,o,c].join(""),e="%%%"===t?100:""===t?255:0;if(e){let t=[$t(+r/e,0,1),$t(+a/e,0,1),$t(+l/e,0,1),h?Xt(+h,p):1];if(Kt(t))return t}}return}}let r=t.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(r){let[t,e,n,i,a,o,s,l,c]=r,u=[n||" ",a||" ",s].join("");if(" "===u||" /"===u||",,"===u||",,,"===u){let t=[+e,$t(+i,0,100),$t(+o,0,100),l?Xt(+l,c):1];if(Kt(t))return function([t,e,r,n]){function i(n){let i=(n+t/30)%12,a=e*Math.min(r,1-r);return r-a*Math.max(-1,Math.min(i-3,9-i,1))}return t=Ut(t),e/=100,r/=100,[i(0),i(8),i(4),n]}(t)}}}(t);return e?new Qt(...e,!1):void 0}get rgb(){let{r:t,g:e,b:r,a:n}=this,i=n||1/0;return this.overwriteGetter("rgb",[t/i,e/i,r/i,n])}get hcl(){return this.overwriteGetter("hcl",function(t){let[e,r,n,i]=Vt(t),a=Math.sqrt(r*r+n*n);return[Math.round(1e4*a)?Ut(Math.atan2(n,r)*Nt):NaN,a,e,i]}(this.rgb))}get lab(){return this.overwriteGetter("lab",Vt(this.rgb))}overwriteGetter(t,e){return Object.defineProperty(this,t,{value:e}),e}toString(){let[t,e,r,n]=this.rgb;return`rgba(${[t,e,r].map((t=>Math.round(255*t))).join(",")},${n})`}}Qt.black=new Qt(0,0,0,1),Qt.white=new Qt(1,1,1,1),Qt.transparent=new Qt(0,0,0,0),Qt.red=new Qt(1,0,0,1);class te{constructor(t,e,r){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(t,e){return this.collator.compare(t,e)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class ee{constructor(t,e,r,n,i){this.text=t,this.image=e,this.scale=r,this.fontStack=n,this.textColor=i}}class re{constructor(t){this.sections=t}static fromString(t){return new re([new ee(t,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some((t=>0!==t.text.length||t.image&&0!==t.image.name.length))}static factory(t){return t instanceof re?t:re.fromString(t)}toString(){return 0===this.sections.length?"":this.sections.map((t=>t.text)).join("")}}class ne{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof ne)return t;if("number"==typeof t)return new ne([t,t,t,t]);if(Array.isArray(t)&&!(t.length<1||t.length>4)){for(let e of t)if("number"!=typeof e)return;switch(t.length){case 1:t=[t[0],t[0],t[0],t[0]];break;case 2:t=[t[0],t[1],t[0],t[1]];break;case 3:t=[t[0],t[1],t[2],t[1]]}return new ne(t)}}toString(){return JSON.stringify(this.values)}}let ie=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class ae{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof ae)return t;if(Array.isArray(t)&&!(t.length<1)&&t.length%2==0){for(let e=0;e=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:`Invalid rgba value [${[t,e,r,n].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof n?[t,e,r,n]:[t,e,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function le(t){if(null===t||"string"==typeof t||"boolean"==typeof t||"number"==typeof t||t instanceof Qt||t instanceof te||t instanceof re||t instanceof ne||t instanceof ae||t instanceof oe)return!0;if(Array.isArray(t)){for(let e of t)if(!le(e))return!1;return!0}if("object"==typeof t){for(let e in t)if(!le(t[e]))return!1;return!0}return!1}function ce(t){if(null===t)return dt;if("string"==typeof t)return gt;if("boolean"==typeof t)return yt;if("number"==typeof t)return mt;if(t instanceof Qt)return vt;if(t instanceof te)return bt;if(t instanceof re)return wt;if(t instanceof ne)return Tt;if(t instanceof ae)return kt;if(t instanceof oe)return At;if(Array.isArray(t)){let e,r=t.length;for(let r of t){let t=ce(r);if(e){if(e===t)continue;e=_t;break}e=t}return Mt(e||_t,r)}return xt}function ue(t){let e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof Qt||t instanceof re||t instanceof ne||t instanceof ae||t instanceof oe?t.toString():JSON.stringify(t)}class he{constructor(t,e){this.type=t,this.value=e}static parse(t,e){if(2!==t.length)return e.error(`'literal' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!le(t[1]))return e.error("invalid value");let r=t[1],n=ce(r),i=e.expectedType;return"array"!==n.kind||0!==n.N||!i||"array"!==i.kind||"number"==typeof i.N&&0!==i.N||(n=i),new he(n,r)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class pe{constructor(t){this.name="ExpressionEvaluationError",this.message=t}toJSON(){return this.message}}let fe={string:gt,number:mt,boolean:yt,object:xt};class de{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");let r,n=1,i=t[0];if("array"===i){let i,a;if(t.length>2){let r=t[1];if("string"!=typeof r||!(r in fe)||"object"===r)return e.error('The item type argument of "array" must be one of string, number, boolean',1);i=fe[r],n++}else i=_t;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);a=t[2],n++}r=Mt(i,a)}else{if(!fe[i])throw new Error(`Types doesn't contain name = ${i}`);r=fe[i]}let a=[];for(;nt.outputDefined()))}}let me={"to-boolean":yt,"to-color":vt,"to-number":mt,"to-string":gt};class ge{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");let r=t[0];if(!me[r])throw new Error(`Can't parse ${r} as it is not part of the known types`);if(("to-boolean"===r||"to-string"===r)&&2!==t.length)return e.error("Expected one argument.");let n=me[r],i=[];for(let r=1;r4?`Invalid rbga value ${JSON.stringify(e)}: expected an array containing either three or four numeric values.`:se(e[0],e[1],e[2],e[3]),!r))return new Qt(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new pe(r||`Could not parse color from value '${"string"==typeof e?e:JSON.stringify(e)}'`)}case"padding":{let e;for(let r of this.args){e=r.evaluate(t);let n=ne.parse(e);if(n)return n}throw new pe(`Could not parse padding from value '${"string"==typeof e?e:JSON.stringify(e)}'`)}case"variableAnchorOffsetCollection":{let e;for(let r of this.args){e=r.evaluate(t);let n=ae.parse(e);if(n)return n}throw new pe(`Could not parse variableAnchorOffsetCollection from value '${"string"==typeof e?e:JSON.stringify(e)}'`)}case"number":{let e=null;for(let r of this.args){if(e=r.evaluate(t),null===e)return 0;let n=Number(e);if(!isNaN(n))return n}throw new pe(`Could not convert ${JSON.stringify(e)} to number.`)}case"formatted":return re.fromString(ue(this.args[0].evaluate(t)));case"resolvedImage":return oe.fromString(ue(this.args[0].evaluate(t)));default:return ue(this.args[0].evaluate(t))}}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every((t=>t.outputDefined()))}}let ye=["Unknown","Point","LineString","Polygon"];class ve{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?ye[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(t){let e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=Qt.parse(t)),e}}class xe{constructor(t,e,r=[],n,i=new ft,a=[]){this.registry=t,this.path=r,this.key=r.map((t=>`[${t}]`)).join(""),this.scope=i,this.errors=a,this.expectedType=n,this._isConstant=e}parse(t,e,r,n,i={}){return e?this.concat(e,r,n)._parse(t,i):this._parse(t,i)}_parse(t,e){function r(t,e,r){return"assert"===r?new de(e,[t]):"coerce"===r?new ge(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');let n=t[0];if("string"!=typeof n)return this.error(`Expression name must be a string, but found ${typeof n} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;let i=this.registry[n];if(i){let n=i.parse(t,this);if(!n)return null;if(this.expectedType){let t=this.expectedType,i=n.type;if("string"!==t.kind&&"number"!==t.kind&&"boolean"!==t.kind&&"object"!==t.kind&&"array"!==t.kind||"value"!==i.kind)if("color"!==t.kind&&"formatted"!==t.kind&&"resolvedImage"!==t.kind||"value"!==i.kind&&"string"!==i.kind)if("padding"!==t.kind||"value"!==i.kind&&"number"!==i.kind&&"array"!==i.kind)if("variableAnchorOffsetCollection"!==t.kind||"value"!==i.kind&&"array"!==i.kind){if(this.checkSubtype(t,i))return null}else n=r(n,t,e.typeAnnotation||"coerce");else n=r(n,t,e.typeAnnotation||"coerce");else n=r(n,t,e.typeAnnotation||"coerce");else n=r(n,t,e.typeAnnotation||"assert")}if(!(n instanceof he)&&"resolvedImage"!==n.type.kind&&this._isConstant(n)){let t=new ve;try{n=new he(n.type,n.evaluate(t))}catch(t){return this.error(t.message),null}}return n}return this.error(`Unknown expression "${n}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(void 0===t?"'undefined' value invalid. Use null instead.":"object"==typeof t?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof t} instead.`)}concat(t,e,r){let n="number"==typeof t?this.path.concat(t):this.path,i=r?this.scope.concat(r):this.scope;return new xe(this.registry,this._isConstant,n,e||null,i,this.errors)}error(t,...e){let r=`${this.key}${e.map((t=>`[${t}]`)).join("")}`;this.errors.push(new pt(r,t))}checkSubtype(t,e){let r=Ct(t,e);return r&&this.error(r),r}}class _e{constructor(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e}evaluate(t){return this.result.evaluate(t)}eachChild(t){for(let e of this.bindings)t(e[1]);t(this.result)}static parse(t,e){if(t.length<4)return e.error(`Expected at least 3 arguments, but found ${t.length-1} instead.`);let r=[];for(let n=1;n=r.length)throw new pe(`Array index out of bounds: ${e} > ${r.length-1}.`);if(e!==Math.floor(e))throw new pe(`Array index must be an integer, but found ${e} instead.`);return r[e]}eachChild(t){t(this.index),t(this.input)}outputDefined(){return!1}}class Te{constructor(t,e){this.type=yt,this.needle=t,this.haystack=e}static parse(t,e){if(3!==t.length)return e.error(`Expected 2 arguments, but found ${t.length-1} instead.`);let r=e.parse(t[1],1,_t),n=e.parse(t[2],2,_t);return r&&n?It(r.type,[yt,gt,mt,dt,_t])?new Te(r,n):e.error(`Expected first argument to be of type boolean, string, number or null, but found ${St(r.type)} instead`):null}evaluate(t){let e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!r)return!1;if(!Lt(e,["boolean","string","number","null"]))throw new pe(`Expected first argument to be of type boolean, string, number or null, but found ${St(ce(e))} instead.`);if(!Lt(r,["string","array"]))throw new pe(`Expected second argument to be of type array or string, but found ${St(ce(r))} instead.`);return r.indexOf(e)>=0}eachChild(t){t(this.needle),t(this.haystack)}outputDefined(){return!0}}class Ae{constructor(t,e,r){this.type=mt,this.needle=t,this.haystack=e,this.fromIndex=r}static parse(t,e){if(t.length<=2||t.length>=5)return e.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);let r=e.parse(t[1],1,_t),n=e.parse(t[2],2,_t);if(!r||!n)return null;if(!It(r.type,[yt,gt,mt,dt,_t]))return e.error(`Expected first argument to be of type boolean, string, number or null, but found ${St(r.type)} instead`);if(4===t.length){let i=e.parse(t[3],3,mt);return i?new Ae(r,n,i):null}return new Ae(r,n)}evaluate(t){let e,r=this.needle.evaluate(t),n=this.haystack.evaluate(t);if(!Lt(r,["boolean","string","number","null"]))throw new pe(`Expected first argument to be of type boolean, string, number or null, but found ${St(ce(r))} instead.`);if(this.fromIndex&&(e=this.fromIndex.evaluate(t)),Lt(n,["string"])){let t=n.indexOf(r,e);return-1===t?-1:[...n.slice(0,t)].length}if(Lt(n,["array"]))return n.indexOf(r,e);throw new pe(`Expected second argument to be of type array or string, but found ${St(ce(n))} instead.`)}eachChild(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)}outputDefined(){return!1}}class ke{constructor(t,e,r,n,i,a){this.inputType=t,this.type=e,this.input=r,this.cases=n,this.outputs=i,this.otherwise=a}static parse(t,e){if(t.length<5)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if(t.length%2!=1)return e.error("Expected an even number of arguments.");let r,n;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);let i={},a=[];for(let o=2;oNumber.MAX_SAFE_INTEGER)return c.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof t&&Math.floor(t)!==t)return c.error("Numeric branch labels must be integer values.");if(r){if(c.checkSubtype(r,ce(t)))return null}else r=ce(t);if(void 0!==i[String(t)])return c.error("Branch labels must be unique.");i[String(t)]=a.length}let u=e.parse(l,o,n);if(!u)return null;n=n||u.type,a.push(u)}let o=e.parse(t[1],1,_t);if(!o)return null;let s=e.parse(t[t.length-1],t.length-1,n);return s?"value"!==o.type.kind&&e.concat(1).checkSubtype(r,o.type)?null:new ke(r,n,o,i,a,s):null}evaluate(t){let e=this.input.evaluate(t);return(ce(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)}eachChild(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))&&this.otherwise.outputDefined()}}class Me{constructor(t,e,r){this.type=t,this.branches=e,this.otherwise=r}static parse(t,e){if(t.length<4)return e.error(`Expected at least 3 arguments, but found only ${t.length-1}.`);if(t.length%2!=0)return e.error("Expected an odd number of arguments.");let r;e.expectedType&&"value"!==e.expectedType.kind&&(r=e.expectedType);let n=[];for(let i=1;ie.outputDefined()))&&this.otherwise.outputDefined()}}class Se{constructor(t,e,r,n){this.type=t,this.input=e,this.beginIndex=r,this.endIndex=n}static parse(t,e){if(t.length<=2||t.length>=5)return e.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);let r=e.parse(t[1],1,_t),n=e.parse(t[2],2,mt);if(!r||!n)return null;if(!It(r.type,[Mt(_t),gt,_t]))return e.error(`Expected first argument to be of type array or string, but found ${St(r.type)} instead`);if(4===t.length){let i=e.parse(t[3],3,mt);return i?new Se(r.type,r,n,i):null}return new Se(r.type,r,n)}evaluate(t){let e,r=this.input.evaluate(t),n=this.beginIndex.evaluate(t);if(this.endIndex&&(e=this.endIndex.evaluate(t)),Lt(r,["string"]))return[...r].slice(n,e).join("");if(Lt(r,["array"]))return r.slice(n,e);throw new pe(`Expected first argument to be of type array or string, but found ${St(ce(r))} instead.`)}eachChild(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)}outputDefined(){return!1}}function Ee(t,e){let r,n,i=t.length-1,a=0,o=i,s=0;for(;a<=o;)if(s=Math.floor((a+o)/2),r=t[s],n=t[s+1],r<=e){if(s===i||ee))throw new pe("Input is not a number.");o=s-1}return 0}class Ce{constructor(t,e,r){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(let[t,e]of r)this.labels.push(t),this.outputs.push(e)}static parse(t,e){if(t.length-1<4)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");let r=e.parse(t[1],1,mt);if(!r)return null;let n=[],i=null;e.expectedType&&"value"!==e.expectedType.kind&&(i=e.expectedType);for(let r=1;r=a)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',s);let c=e.parse(o,l,i);if(!c)return null;i=i||c.type,n.push([a,c])}return new Ce(i,r,n)}evaluate(t){let e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);let n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);let i=e.length;return n>=e[i-1]?r[i-1].evaluate(t):r[Ee(e,n)].evaluate(t)}eachChild(t){t(this.input);for(let e of this.outputs)t(e)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))}}var Ie=Le;function Le(t,e,r,n){this.cx=3*t,this.bx=3*(r-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(n-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=e,this.p2x=r,this.p2y=n}Le.prototype={sampleCurveX:function(t){return((this.ax*t+this.bx)*t+this.cx)*t},sampleCurveY:function(t){return((this.ay*t+this.by)*t+this.cy)*t},sampleCurveDerivativeX:function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},solveCurveX:function(t,e){if(void 0===e&&(e=1e-6),t<0)return 0;if(t>1)return 1;for(var r=t,n=0;n<8;n++){var i=this.sampleCurveX(r)-t;if(Math.abs(i)i?o=r:s=r,r=.5*(s-o)+o;return r},solve:function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))}};var Pe,ze=(Pe=Ie)&&Pe.__esModule&&Object.prototype.hasOwnProperty.call(Pe,"default")?Pe.default:Pe;function De(t,e,r){return t+r*(e-t)}function Oe(t,e,r){return t.map(((t,n)=>De(t,e[n],r)))}let Re={number:De,color:function(t,e,r,n="rgb"){switch(n){case"rgb":{let[n,i,a,o]=Oe(t.rgb,e.rgb,r);return new Qt(n,i,a,o,!1)}case"hcl":{let n,i,[a,o,s,l]=t.hcl,[c,u,h,p]=e.hcl;if(isNaN(a)||isNaN(c))isNaN(a)?isNaN(c)?n=NaN:(n=c,1!==s&&0!==s||(i=u)):(n=a,1!==h&&0!==h||(i=o));else{let t=c-a;c>a&&t>180?t-=360:c180&&(t+=360),n=a+r*t}let[f,d,m,g]=function([t,e,r,n]){return t=isNaN(t)?0:t*jt,Gt([r,Math.cos(t)*e,Math.sin(t)*e,n])}([n,i??De(o,u,r),De(s,h,r),De(l,p,r)]);return new Qt(f,d,m,g,!1)}case"lab":{let[n,i,a,o]=Gt(Oe(t.lab,e.lab,r));return new Qt(n,i,a,o,!1)}}},array:Oe,padding:function(t,e,r){return new ne(Oe(t.values,e.values,r))},variableAnchorOffsetCollection:function(t,e,r){let n=t.values,i=e.values;if(n.length!==i.length)throw new pe(`Cannot interpolate values of different length. from: ${t.toString()}, to: ${e.toString()}`);let a=[];for(let t=0;t"number"!=typeof t||t<0||t>1)))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:t}}}if(t.length-1<4)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(i=e.parse(i,2,mt),!i)return null;let o=[],s=null;"interpolate-hcl"===r||"interpolate-lab"===r?s=vt:e.expectedType&&"value"!==e.expectedType.kind&&(s=e.expectedType);for(let t=0;t=r)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',i);let c=e.parse(n,l,s);if(!c)return null;s=s||c.type,o.push([r,c])}return Pt(s,mt)||Pt(s,vt)||Pt(s,Tt)||Pt(s,kt)||Pt(s,Mt(mt))?new Fe(s,r,n,i,o):e.error(`Type ${St(s)} is not interpolatable.`)}evaluate(t){let e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);let n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);let i=e.length;if(n>=e[i-1])return r[i-1].evaluate(t);let a=Ee(e,n),o=Fe.interpolationFactor(this.interpolation,n,e[a],e[a+1]),s=r[a].evaluate(t),l=r[a+1].evaluate(t);switch(this.operator){case"interpolate":return Re[this.type.kind](s,l,o);case"interpolate-hcl":return Re.color(s,l,o,"hcl");case"interpolate-lab":return Re.color(s,l,o,"lab")}}eachChild(t){t(this.input);for(let e of this.outputs)t(e)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))}}function Be(t,e,r,n){let i=n-r,a=t-r;return 0===i?0:1===e?a/i:(Math.pow(e,a)-1)/(Math.pow(e,i)-1)}class je{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expectected at least one argument.");let r=null,n=e.expectedType;n&&"value"!==n.kind&&(r=n);let i=[];for(let n of t.slice(1)){let t=e.parse(n,1+i.length,r,void 0,{typeAnnotation:"omit"});if(!t)return null;r=r||t.type,i.push(t)}if(!r)throw new Error("No output type");let a=n&&i.some((t=>Ct(n,t.type)));return new je(a?_t:r,i)}evaluate(t){let e,r=null,n=0;for(let i of this.args)if(n++,r=i.evaluate(t),r&&r instanceof oe&&!r.available&&(e||(e=r.name),r=null,n===this.args.length&&(r=e)),null!==r)break;return r}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every((t=>t.outputDefined()))}}function Ne(t,e){return"=="===t||"!="===t?"boolean"===e.kind||"string"===e.kind||"number"===e.kind||"null"===e.kind||"value"===e.kind:"string"===e.kind||"number"===e.kind||"value"===e.kind}function Ue(t,e,r,n){return 0===n.compare(e,r)}function Ve(t,e,r){let n="=="!==t&&"!="!==t;return class i{constructor(t,e,r){this.type=yt,this.lhs=t,this.rhs=e,this.collator=r,this.hasUntypedArgument="value"===t.type.kind||"value"===e.type.kind}static parse(t,e){if(3!==t.length&&4!==t.length)return e.error("Expected two or three arguments.");let r=t[0],a=e.parse(t[1],1,_t);if(!a)return null;if(!Ne(r,a.type))return e.concat(1).error(`"${r}" comparisons are not supported for type '${St(a.type)}'.`);let o=e.parse(t[2],2,_t);if(!o)return null;if(!Ne(r,o.type))return e.concat(2).error(`"${r}" comparisons are not supported for type '${St(o.type)}'.`);if(a.type.kind!==o.type.kind&&"value"!==a.type.kind&&"value"!==o.type.kind)return e.error(`Cannot compare types '${St(a.type)}' and '${St(o.type)}'.`);n&&("value"===a.type.kind&&"value"!==o.type.kind?a=new de(o.type,[a]):"value"!==a.type.kind&&"value"===o.type.kind&&(o=new de(a.type,[o])));let s=null;if(4===t.length){if("string"!==a.type.kind&&"string"!==o.type.kind&&"value"!==a.type.kind&&"value"!==o.type.kind)return e.error("Cannot use collator to compare non-string types.");if(s=e.parse(t[3],3,bt),!s)return null}return new i(a,o,s)}evaluate(i){let a=this.lhs.evaluate(i),o=this.rhs.evaluate(i);if(n&&this.hasUntypedArgument){let e=ce(a),r=ce(o);if(e.kind!==r.kind||"string"!==e.kind&&"number"!==e.kind)throw new pe(`Expected arguments for "${t}" to be (string, string) or (number, number), but found (${e.kind}, ${r.kind}) instead.`)}if(this.collator&&!n&&this.hasUntypedArgument){let t=ce(a),r=ce(o);if("string"!==t.kind||"string"!==r.kind)return e(i,a,o)}return this.collator?r(i,a,o,this.collator.evaluate(i)):e(i,a,o)}eachChild(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)}outputDefined(){return!0}}}let qe=Ve("==",(function(t,e,r){return e===r}),Ue),He=Ve("!=",(function(t,e,r){return e!==r}),(function(t,e,r,n){return!Ue(0,e,r,n)})),Ge=Ve("<",(function(t,e,r){return e",(function(t,e,r){return e>r}),(function(t,e,r,n){return n.compare(e,r)>0})),Ze=Ve("<=",(function(t,e,r){return e<=r}),(function(t,e,r,n){return n.compare(e,r)<=0})),Ye=Ve(">=",(function(t,e,r){return e>=r}),(function(t,e,r,n){return n.compare(e,r)>=0}));class Xe{constructor(t,e,r){this.type=bt,this.locale=r,this.caseSensitive=t,this.diacriticSensitive=e}static parse(t,e){if(2!==t.length)return e.error("Expected one argument.");let r=t[1];if("object"!=typeof r||Array.isArray(r))return e.error("Collator options argument must be an object.");let n=e.parse(void 0!==r["case-sensitive"]&&r["case-sensitive"],1,yt);if(!n)return null;let i=e.parse(void 0!==r["diacritic-sensitive"]&&r["diacritic-sensitive"],1,yt);if(!i)return null;let a=null;return r.locale&&(a=e.parse(r.locale,1,gt),!a)?null:new Xe(n,i,a)}evaluate(t){return new te(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)}eachChild(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)}outputDefined(){return!1}}class $e{constructor(t,e,r,n,i){this.type=gt,this.number=t,this.locale=e,this.currency=r,this.minFractionDigits=n,this.maxFractionDigits=i}static parse(t,e){if(3!==t.length)return e.error("Expected two arguments.");let r=e.parse(t[1],1,mt);if(!r)return null;let n=t[2];if("object"!=typeof n||Array.isArray(n))return e.error("NumberFormat options argument must be an object.");let i=null;if(n.locale&&(i=e.parse(n.locale,1,gt),!i))return null;let a=null;if(n.currency&&(a=e.parse(n.currency,1,gt),!a))return null;let o=null;if(n["min-fraction-digits"]&&(o=e.parse(n["min-fraction-digits"],1,mt),!o))return null;let s=null;return n["max-fraction-digits"]&&(s=e.parse(n["max-fraction-digits"],1,mt),!s)?null:new $e(r,i,a,o,s)}evaluate(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))}eachChild(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)}outputDefined(){return!1}}class Ke{constructor(t){this.type=wt,this.sections=t}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");let r=t[1];if(!Array.isArray(r)&&"object"==typeof r)return e.error("First argument must be an image or text section.");let n=[],i=!1;for(let r=1;r<=t.length-1;++r){let a=t[r];if(i&&"object"==typeof a&&!Array.isArray(a)){i=!1;let t=null;if(a["font-scale"]&&(t=e.parse(a["font-scale"],1,mt),!t))return null;let r=null;if(a["text-font"]&&(r=e.parse(a["text-font"],1,Mt(gt)),!r))return null;let o=null;if(a["text-color"]&&(o=e.parse(a["text-color"],1,vt),!o))return null;let s=n[n.length-1];s.scale=t,s.font=r,s.textColor=o}else{let a=e.parse(t[r],1,_t);if(!a)return null;let o=a.type.kind;if("string"!==o&&"value"!==o&&"null"!==o&&"resolvedImage"!==o)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");i=!0,n.push({content:a,scale:null,font:null,textColor:null})}}return new Ke(n)}evaluate(t){return new re(this.sections.map((e=>{let r=e.content.evaluate(t);return ce(r)===At?new ee("",r,null,null,null):new ee(ue(r),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))}eachChild(t){for(let e of this.sections)t(e.content),e.scale&&t(e.scale),e.font&&t(e.font),e.textColor&&t(e.textColor)}outputDefined(){return!1}}class Je{constructor(t){this.type=At,this.input=t}static parse(t,e){if(2!==t.length)return e.error("Expected two arguments.");let r=e.parse(t[1],1,gt);return r?new Je(r):e.error("No image name provided.")}evaluate(t){let e=this.input.evaluate(t),r=oe.fromString(e);return r&&t.availableImages&&(r.available=t.availableImages.indexOf(e)>-1),r}eachChild(t){t(this.input)}outputDefined(){return!1}}class Qe{constructor(t){this.type=mt,this.input=t}static parse(t,e){if(2!==t.length)return e.error(`Expected 1 argument, but found ${t.length-1} instead.`);let r=e.parse(t[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?e.error(`Expected argument of type string or array, but found ${St(r.type)} instead.`):new Qe(r):null}evaluate(t){let e=this.input.evaluate(t);if("string"==typeof e)return[...e].length;if(Array.isArray(e))return e.length;throw new pe(`Expected value to be of type string or array, but found ${St(ce(e))} instead.`)}eachChild(t){t(this.input)}outputDefined(){return!1}}let tr=8192;function er(t,e){let r=(180+t[0])/360,n=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t[1]*Math.PI/360)))/360,i=Math.pow(2,e.z);return[Math.round(r*i*tr),Math.round(n*i*tr)]}function rr(t,e){let r=Math.pow(2,e.z);return[(i=(t[0]/tr+e.x)/r,360*i-180),(n=(t[1]/tr+e.y)/r,360/Math.PI*Math.atan(Math.exp((180-360*n)*Math.PI/180))-90)];var n,i}function nr(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.max(t[2],e[0]),t[3]=Math.max(t[3],e[1])}function ir(t,e){return!(t[0]<=e[0]||t[2]>=e[2]||t[1]<=e[1]||t[3]>=e[3])}function ar(t,e,r){let n=t[0]-e[0],i=t[1]-e[1],a=t[0]-r[0],o=t[1]-r[1];return n*o-a*i==0&&n*a<=0&&i*o<=0}function or(t,e,r,n){return(i=[n[0]-r[0],n[1]-r[1]])[0]*(a=[e[0]-t[0],e[1]-t[1]])[1]-i[1]*a[0]!=0&&!(!pr(t,e,r,n)||!pr(r,n,t,e));var i,a}function sr(t,e,r){for(let n of r)for(let r=0;r(i=t)[1]!=(o=s[e+1])[1]>i[1]&&i[0]<(o[0]-a[0])*(i[1]-a[1])/(o[1]-a[1])+a[0]&&(n=!n)}var i,a,o;return n}function cr(t,e){for(let r of e)if(lr(t,r))return!0;return!1}function ur(t,e){for(let r of t)if(!lr(r,e))return!1;for(let r=0;r0&&s<0||o<0&&s>0}function fr(t,e,r){let n=[];for(let i=0;ir[2]){let e=.5*n,i=t[0]-r[0]>e?-n:r[0]-t[0]>e?n:0;0===i&&(i=t[0]-r[2]>e?-n:r[2]-t[0]>e?n:0),t[0]+=i}nr(e,t)}function gr(t,e,r,n){let i=Math.pow(2,n.z)*tr,a=[n.x*tr,n.y*tr],o=[];for(let n of t)for(let t of n){let n=[t.x+a[0],t.y+a[1]];mr(n,e,r,i),o.push(n)}return o}function yr(t,e,r,n){let i=Math.pow(2,n.z)*tr,a=[n.x*tr,n.y*tr],o=[];for(let r of t){let t=[];for(let n of r){let r=[n.x+a[0],n.y+a[1]];nr(e,r),t.push(r)}o.push(t)}if(e[2]-e[0]<=i/2){(s=e)[0]=s[1]=1/0,s[2]=s[3]=-1/0;for(let t of o)for(let n of t)mr(n,e,r,i)}var s;return o}class vr{constructor(t,e){this.type=yt,this.geojson=t,this.geometries=e}static parse(t,e){if(2!==t.length)return e.error(`'within' expression requires exactly one argument, but found ${t.length-1} instead.`);if(le(t[1])){let e=t[1];if("FeatureCollection"===e.type){let t=[];for(let r of e.features){let{type:e,coordinates:n}=r.geometry;"Polygon"===e&&t.push(n),"MultiPolygon"===e&&t.push(...n)}if(t.length)return new vr(e,{type:"MultiPolygon",coordinates:t})}else if("Feature"===e.type){let t=e.geometry.type;if("Polygon"===t||"MultiPolygon"===t)return new vr(e,e.geometry)}else if("Polygon"===e.type||"MultiPolygon"===e.type)return new vr(e,e)}return e.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,e){let r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=t.canonicalID();if("Polygon"===e.type){let a=fr(e.coordinates,n,i),o=gr(t.geometry(),r,n,i);if(!ir(r,n))return!1;for(let t of o)if(!lr(t,a))return!1}if("MultiPolygon"===e.type){let a=dr(e.coordinates,n,i),o=gr(t.geometry(),r,n,i);if(!ir(r,n))return!1;for(let t of o)if(!cr(t,a))return!1}return!0}(t,this.geometries);if("LineString"===t.geometryType())return function(t,e){let r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=t.canonicalID();if("Polygon"===e.type){let a=fr(e.coordinates,n,i),o=yr(t.geometry(),r,n,i);if(!ir(r,n))return!1;for(let t of o)if(!ur(t,a))return!1}if("MultiPolygon"===e.type){let a=dr(e.coordinates,n,i),o=yr(t.geometry(),r,n,i);if(!ir(r,n))return!1;for(let t of o)if(!hr(t,a))return!1}return!0}(t,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let xr=class{constructor(t=[],e=(t,e)=>te?1:0){if(this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(let t=(this.length>>1)-1;t>=0;t--)this._down(t)}push(t){this.data.push(t),this._up(this.length++)}pop(){if(0===this.length)return;let t=this.data[0],e=this.data.pop();return--this.length>0&&(this.data[0]=e,this._down(0)),t}peek(){return this.data[0]}_up(t){let{data:e,compare:r}=this,n=e[t];for(;t>0;){let i=t-1>>1,a=e[i];if(r(n,a)>=0)break;e[t]=a,t=i}e[t]=n}_down(t){let{data:e,compare:r}=this,n=this.length>>1,i=e[t];for(;t=0)break;e[t]=e[n],t=n}e[t]=i}};function _r(t,e,r,n,i){br(t,e,r,n||t.length-1,i||Tr)}function br(t,e,r,n,i){for(;n>r;){if(n-r>600){var a=n-r+1,o=e-r+1,s=Math.log(a),l=.5*Math.exp(2*s/3),c=.5*Math.sqrt(s*l*(a-l)/a)*(o-a/2<0?-1:1);br(t,e,Math.max(r,Math.floor(e-o*l/a+c)),Math.min(n,Math.floor(e+(a-o)*l/a+c)),i)}var u=t[e],h=r,p=n;for(wr(t,r,e),i(t[n],u)>0&&wr(t,r,n);h0;)p--}0===i(t[r],u)?wr(t,r,p):wr(t,++p,n),p<=e&&(r=p+1),e<=p&&(n=p-1)}}function wr(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function Tr(t,e){return te?1:0}function Ar(t,e){if(t.length<=1)return[t];let r,n,i=[];for(let e of t){let t=Mr(e);0!==t&&(e.area=Math.abs(t),void 0===n&&(n=t<0),n===t<0?(r&&i.push(r),r=[e]):r.push(e))}if(r&&i.push(r),e>1)for(let t=0;t1?(l=t[s+1][0],c=t[s+1][1]):p>0&&(l+=u/this.kx*p,c+=h/this.ky*p)),u=this.wrap(e[0]-l)*this.kx,h=(e[1]-c)*this.ky;let f=u*u+h*h;f180;)t-=360;return t}}function Lr(t,e){return e[0]-t[0]}function Pr(t){return t[1]-t[0]+1}function zr(t,e){return t[1]>=t[0]&&t[1]t[1])return[null,null];let r=Pr(t);if(e){if(2===r)return[t,null];let e=Math.floor(r/2);return[[t[0],t[0]+e],[t[0]+e,t[1]]]}if(1===r)return[t,null];let n=Math.floor(r/2)-1;return[[t[0],t[0]+n],[t[0]+n+1,t[1]]]}function Or(t,e){if(!zr(e,t.length))return[1/0,1/0,-1/0,-1/0];let r=[1/0,1/0,-1/0,-1/0];for(let n=e[0];n<=e[1];++n)nr(r,t[n]);return r}function Rr(t){let e=[1/0,1/0,-1/0,-1/0];for(let r of t)for(let t of r)nr(e,t);return e}function Fr(t){return t[0]!==-1/0&&t[1]!==-1/0&&t[2]!==1/0&&t[3]!==1/0}function Br(t,e,r){if(!Fr(t)||!Fr(e))return NaN;let n=0,i=0;return t[2]e[2]&&(n=t[0]-e[2]),t[1]>e[3]&&(i=t[1]-e[3]),t[3]=n)return n;if(ir(i,a)){if(Gr(t,e))return 0}else if(Gr(e,t))return 0;let o=1/0;for(let n of t)for(let t=0,i=n.length,a=i-1;t0;){let i=o.pop();if(i[0]>=a)continue;let l=i[1],c=e?50:100;if(Pr(l)<=c){if(!zr(l,t.length))return NaN;if(e){let e=Hr(t,l,r,n);if(isNaN(e)||0===e)return e;a=Math.min(a,e)}else for(let e=l[0];e<=l[1];++e){let i=qr(t[e],r,n);if(a=Math.min(a,i),0===a)return 0}}else{let r=Dr(l,e);Zr(o,a,n,t,s,r[0]),Zr(o,a,n,t,s,r[1])}}return a}function $r(t,e,r,n,i,a=1/0){let o=Math.min(a,i.distance(t[0],r[0]));if(0===o)return o;let s=new xr([[0,[0,t.length-1],[0,r.length-1]]],Lr);for(;s.length>0;){let a=s.pop();if(a[0]>=o)continue;let l=a[1],c=a[2],u=e?50:100,h=n?50:100;if(Pr(l)<=u&&Pr(c)<=h){if(!zr(l,t.length)&&zr(c,r.length))return NaN;let a;if(e&&n)a=Ur(t,l,r,c,i),o=Math.min(o,a);else if(e&&!n){let e=t.slice(l[0],l[1]+1);for(let t=c[0];t<=c[1];++t)if(a=jr(r[t],e,i),o=Math.min(o,a),0===o)return o}else if(!e&&n){let e=r.slice(c[0],c[1]+1);for(let r=l[0];r<=l[1];++r)if(a=jr(t[r],e,i),o=Math.min(o,a),0===o)return o}else a=Vr(t,l,r,c,i),o=Math.min(o,a)}else{let a=Dr(l,e),u=Dr(c,n);Yr(s,o,i,t,r,a[0],u[0]),Yr(s,o,i,t,r,a[0],u[1]),Yr(s,o,i,t,r,a[1],u[0]),Yr(s,o,i,t,r,a[1],u[1])}}return o}function Kr(t){return"MultiPolygon"===t.type?t.coordinates.map((t=>({type:"Polygon",coordinates:t}))):"MultiLineString"===t.type?t.coordinates.map((t=>({type:"LineString",coordinates:t}))):"MultiPoint"===t.type?t.coordinates.map((t=>({type:"Point",coordinates:t}))):[t]}class Jr{constructor(t,e){this.type=mt,this.geojson=t,this.geometries=e}static parse(t,e){if(2!==t.length)return e.error(`'distance' expression requires exactly one argument, but found ${t.length-1} instead.`);if(le(t[1])){let e=t[1];if("FeatureCollection"===e.type)return new Jr(e,e.features.map((t=>Kr(t.geometry))).flat());if("Feature"===e.type)return new Jr(e,Kr(e.geometry));if("type"in e&&"coordinates"in e)return new Jr(e,Kr(e))}return e.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,e){let r=t.geometry(),n=r.flat().map((e=>rr([e.x,e.y],t.canonical)));if(0===r.length)return NaN;let i=new Ir(n[0][1]),a=1/0;for(let t of e){switch(t.type){case"Point":a=Math.min(a,$r(n,!1,[t.coordinates],!1,i,a));break;case"LineString":a=Math.min(a,$r(n,!1,t.coordinates,!0,i,a));break;case"Polygon":a=Math.min(a,Xr(n,!1,t.coordinates,i,a))}if(0===a)return a}return a}(t,this.geometries);if("LineString"===t.geometryType())return function(t,e){let r=t.geometry(),n=r.flat().map((e=>rr([e.x,e.y],t.canonical)));if(0===r.length)return NaN;let i=new Ir(n[0][1]),a=1/0;for(let t of e){switch(t.type){case"Point":a=Math.min(a,$r(n,!0,[t.coordinates],!1,i,a));break;case"LineString":a=Math.min(a,$r(n,!0,t.coordinates,!0,i,a));break;case"Polygon":a=Math.min(a,Xr(n,!0,t.coordinates,i,a))}if(0===a)return a}return a}(t,this.geometries);if("Polygon"===t.geometryType())return function(t,e){let r=t.geometry();if(0===r.length||0===r[0].length)return NaN;let n=Ar(r,0).map((e=>e.map((e=>e.map((e=>rr([e.x,e.y],t.canonical))))))),i=new Ir(n[0][0][0][1]),a=1/0;for(let t of e)for(let e of n){switch(t.type){case"Point":a=Math.min(a,Xr([t.coordinates],!1,e,i,a));break;case"LineString":a=Math.min(a,Xr(t.coordinates,!0,e,i,a));break;case"Polygon":a=Math.min(a,Wr(e,t.coordinates,i,a))}if(0===a)return a}return a}(t,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}let Qr={"==":qe,"!=":He,">":We,"<":Ge,">=":Ye,"<=":Ze,array:de,at:we,boolean:de,case:Me,coalesce:je,collator:Xe,format:Ke,image:Je,in:Te,"index-of":Ae,interpolate:Fe,"interpolate-hcl":Fe,"interpolate-lab":Fe,length:Qe,let:_e,literal:he,match:ke,number:de,"number-format":$e,object:de,slice:Se,step:Ce,string:de,"to-boolean":ge,"to-color":ge,"to-number":ge,"to-string":ge,var:be,within:vr,distance:Jr};class tn{constructor(t,e,r,n){this.name=t,this.type=e,this._evaluate=r,this.args=n}evaluate(t){return this._evaluate(t,this.args)}eachChild(t){this.args.forEach(t)}outputDefined(){return!1}static parse(t,e){let r=t[0],n=tn.definitions[r];if(!n)return e.error(`Unknown expression "${r}". If you wanted a literal array, use ["literal", [...]].`,0);let i=Array.isArray(n)?n[0]:n.type,a=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,o=a.filter((([e])=>!Array.isArray(e)||e.length===t.length-1)),s=null;for(let[n,a]of o){s=new xe(e.registry,on,e.path,null,e.scope);let o=[],l=!1;for(let e=1;e{return e=t,Array.isArray(e)?`(${e.map(St).join(", ")})`:`(${St(e.type)}...)`;var e})).join(" | "),n=[];for(let r=1;r{r=e?r&&on(t):r&&t instanceof he})),!!r&&sn(t)&&cn(t,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function sn(t){if(t instanceof tn&&("get"===t.name&&1===t.args.length||"feature-state"===t.name||"has"===t.name&&1===t.args.length||"properties"===t.name||"geometry-type"===t.name||"id"===t.name||/^filter-/.test(t.name))||t instanceof vr||t instanceof Jr)return!1;let e=!0;return t.eachChild((t=>{e&&!sn(t)&&(e=!1)})),e}function ln(t){if(t instanceof tn&&"feature-state"===t.name)return!1;let e=!0;return t.eachChild((t=>{e&&!ln(t)&&(e=!1)})),e}function cn(t,e){if(t instanceof tn&&e.indexOf(t.name)>=0)return!1;let r=!0;return t.eachChild((t=>{r&&!cn(t,e)&&(r=!1)})),r}function un(t){return{result:"success",value:t}}function hn(t){return{result:"error",value:t}}function pn(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function fn(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function dn(t){return!!t.expression&&t.expression.interpolated}function mn(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function gn(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function yn(t){return t}function vn(t,e){let r="color"===e.type,n=t.stops&&"object"==typeof t.stops[0][0],i=n||!(n||void 0!==t.property),a=t.type||(dn(e)?"exponential":"interval");if(r||"padding"===e.type){let n=r?Qt.parse:ne.parse;(t=ht({},t)).stops&&(t.stops=t.stops.map((t=>[t[0],n(t[1])]))),t.default=n(t.default?t.default:e.default)}if(t.colorSpace&&"rgb"!==(o=t.colorSpace)&&"hcl"!==o&&"lab"!==o)throw new Error(`Unknown color space: "${t.colorSpace}"`);var o;let s,l,c;if("exponential"===a)s=wn;else if("interval"===a)s=bn;else if("categorical"===a){s=_n,l=Object.create(null);for(let e of t.stops)l[e[0]]=e[1];c=typeof t.stops[0][0]}else{if("identity"!==a)throw new Error(`Unknown function type "${a}"`);s=Tn}if(n){let r={},n=[];for(let e=0;et[0])),evaluate:({zoom:r},n)=>wn({stops:i,base:t.base},e,r).evaluate(r,n)}}if(i){let r="exponential"===a?{name:"exponential",base:void 0!==t.base?t.base:1}:null;return{kind:"camera",interpolationType:r,interpolationFactor:Fe.interpolationFactor.bind(void 0,r),zoomStops:t.stops.map((t=>t[0])),evaluate:({zoom:r})=>s(t,e,r,l,c)}}return{kind:"source",evaluate(r,n){let i=n&&n.properties?n.properties[t.property]:void 0;return void 0===i?xn(t.default,e.default):s(t,e,i,l,c)}}}function xn(t,e,r){return void 0!==t?t:void 0!==e?e:void 0!==r?r:void 0}function _n(t,e,r,n,i){return xn(typeof r===i?n[r]:void 0,t.default,e.default)}function bn(t,e,r){if("number"!==mn(r))return xn(t.default,e.default);let n=t.stops.length;if(1===n||r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[n-1][0])return t.stops[n-1][1];let i=Ee(t.stops.map((t=>t[0])),r);return t.stops[i][1]}function wn(t,e,r){let n=void 0!==t.base?t.base:1;if("number"!==mn(r))return xn(t.default,e.default);let i=t.stops.length;if(1===i||r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[i-1][0])return t.stops[i-1][1];let a=Ee(t.stops.map((t=>t[0])),r),o=function(t,e,r,n){let i=n-r,a=t-r;return 0===i?0:1===e?a/i:(Math.pow(e,a)-1)/(Math.pow(e,i)-1)}(r,n,t.stops[a][0],t.stops[a+1][0]),s=t.stops[a][1],l=t.stops[a+1][1],c=Re[e.type]||yn;return"function"==typeof s.evaluate?{evaluate(...e){let r=s.evaluate.apply(void 0,e),n=l.evaluate.apply(void 0,e);if(void 0!==r&&void 0!==n)return c(r,n,o,t.colorSpace)}}:c(s,l,o,t.colorSpace)}function Tn(t,e,r){switch(e.type){case"color":r=Qt.parse(r);break;case"formatted":r=re.fromString(r.toString());break;case"resolvedImage":r=oe.fromString(r.toString());break;case"padding":r=ne.parse(r);break;default:mn(r)===e.type||"enum"===e.type&&e.values[r]||(r=void 0)}return xn(r,t.default,e.default)}tn.register(Qr,{error:[{kind:"error"},[gt],(t,[e])=>{throw new pe(e.evaluate(t))}],typeof:[gt,[_t],(t,[e])=>St(ce(e.evaluate(t)))],"to-rgba":[Mt(mt,4),[vt],(t,[e])=>{let[r,n,i,a]=e.evaluate(t).rgb;return[255*r,255*n,255*i,a]}],rgb:[vt,[mt,mt,mt],en],rgba:[vt,[mt,mt,mt,mt],en],has:{type:yt,overloads:[[[gt],(t,[e])=>rn(e.evaluate(t),t.properties())],[[gt,xt],(t,[e,r])=>rn(e.evaluate(t),r.evaluate(t))]]},get:{type:_t,overloads:[[[gt],(t,[e])=>nn(e.evaluate(t),t.properties())],[[gt,xt],(t,[e,r])=>nn(e.evaluate(t),r.evaluate(t))]]},"feature-state":[_t,[gt],(t,[e])=>nn(e.evaluate(t),t.featureState||{})],properties:[xt,[],t=>t.properties()],"geometry-type":[gt,[],t=>t.geometryType()],id:[_t,[],t=>t.id()],zoom:[mt,[],t=>t.globals.zoom],"heatmap-density":[mt,[],t=>t.globals.heatmapDensity||0],"line-progress":[mt,[],t=>t.globals.lineProgress||0],accumulated:[_t,[],t=>void 0===t.globals.accumulated?null:t.globals.accumulated],"+":[mt,an(mt),(t,e)=>{let r=0;for(let n of e)r+=n.evaluate(t);return r}],"*":[mt,an(mt),(t,e)=>{let r=1;for(let n of e)r*=n.evaluate(t);return r}],"-":{type:mt,overloads:[[[mt,mt],(t,[e,r])=>e.evaluate(t)-r.evaluate(t)],[[mt],(t,[e])=>-e.evaluate(t)]]},"/":[mt,[mt,mt],(t,[e,r])=>e.evaluate(t)/r.evaluate(t)],"%":[mt,[mt,mt],(t,[e,r])=>e.evaluate(t)%r.evaluate(t)],ln2:[mt,[],()=>Math.LN2],pi:[mt,[],()=>Math.PI],e:[mt,[],()=>Math.E],"^":[mt,[mt,mt],(t,[e,r])=>Math.pow(e.evaluate(t),r.evaluate(t))],sqrt:[mt,[mt],(t,[e])=>Math.sqrt(e.evaluate(t))],log10:[mt,[mt],(t,[e])=>Math.log(e.evaluate(t))/Math.LN10],ln:[mt,[mt],(t,[e])=>Math.log(e.evaluate(t))],log2:[mt,[mt],(t,[e])=>Math.log(e.evaluate(t))/Math.LN2],sin:[mt,[mt],(t,[e])=>Math.sin(e.evaluate(t))],cos:[mt,[mt],(t,[e])=>Math.cos(e.evaluate(t))],tan:[mt,[mt],(t,[e])=>Math.tan(e.evaluate(t))],asin:[mt,[mt],(t,[e])=>Math.asin(e.evaluate(t))],acos:[mt,[mt],(t,[e])=>Math.acos(e.evaluate(t))],atan:[mt,[mt],(t,[e])=>Math.atan(e.evaluate(t))],min:[mt,an(mt),(t,e)=>Math.min(...e.map((e=>e.evaluate(t))))],max:[mt,an(mt),(t,e)=>Math.max(...e.map((e=>e.evaluate(t))))],abs:[mt,[mt],(t,[e])=>Math.abs(e.evaluate(t))],round:[mt,[mt],(t,[e])=>{let r=e.evaluate(t);return r<0?-Math.round(-r):Math.round(r)}],floor:[mt,[mt],(t,[e])=>Math.floor(e.evaluate(t))],ceil:[mt,[mt],(t,[e])=>Math.ceil(e.evaluate(t))],"filter-==":[yt,[gt,_t],(t,[e,r])=>t.properties()[e.value]===r.value],"filter-id-==":[yt,[_t],(t,[e])=>t.id()===e.value],"filter-type-==":[yt,[gt],(t,[e])=>t.geometryType()===e.value],"filter-<":[yt,[gt,_t],(t,[e,r])=>{let n=t.properties()[e.value],i=r.value;return typeof n==typeof i&&n{let r=t.id(),n=e.value;return typeof r==typeof n&&r":[yt,[gt,_t],(t,[e,r])=>{let n=t.properties()[e.value],i=r.value;return typeof n==typeof i&&n>i}],"filter-id->":[yt,[_t],(t,[e])=>{let r=t.id(),n=e.value;return typeof r==typeof n&&r>n}],"filter-<=":[yt,[gt,_t],(t,[e,r])=>{let n=t.properties()[e.value],i=r.value;return typeof n==typeof i&&n<=i}],"filter-id-<=":[yt,[_t],(t,[e])=>{let r=t.id(),n=e.value;return typeof r==typeof n&&r<=n}],"filter->=":[yt,[gt,_t],(t,[e,r])=>{let n=t.properties()[e.value],i=r.value;return typeof n==typeof i&&n>=i}],"filter-id->=":[yt,[_t],(t,[e])=>{let r=t.id(),n=e.value;return typeof r==typeof n&&r>=n}],"filter-has":[yt,[_t],(t,[e])=>e.value in t.properties()],"filter-has-id":[yt,[],t=>null!==t.id()&&void 0!==t.id()],"filter-type-in":[yt,[Mt(gt)],(t,[e])=>e.value.indexOf(t.geometryType())>=0],"filter-id-in":[yt,[Mt(_t)],(t,[e])=>e.value.indexOf(t.id())>=0],"filter-in-small":[yt,[gt,Mt(_t)],(t,[e,r])=>r.value.indexOf(t.properties()[e.value])>=0],"filter-in-large":[yt,[gt,Mt(_t)],(t,[e,r])=>function(t,e,r,n){for(;r<=n;){let i=r+n>>1;if(e[i]===t)return!0;e[i]>t?n=i-1:r=i+1}return!1}(t.properties()[e.value],r.value,0,r.value.length-1)],all:{type:yt,overloads:[[[yt,yt],(t,[e,r])=>e.evaluate(t)&&r.evaluate(t)],[an(yt),(t,e)=>{for(let r of e)if(!r.evaluate(t))return!1;return!0}]]},any:{type:yt,overloads:[[[yt,yt],(t,[e,r])=>e.evaluate(t)||r.evaluate(t)],[an(yt),(t,e)=>{for(let r of e)if(r.evaluate(t))return!0;return!1}]]},"!":[yt,[yt],(t,[e])=>!e.evaluate(t)],"is-supported-script":[yt,[gt],(t,[e])=>{let r=t.globals&&t.globals.isSupportedScript;return!r||r(e.evaluate(t))}],upcase:[gt,[gt],(t,[e])=>e.evaluate(t).toUpperCase()],downcase:[gt,[gt],(t,[e])=>e.evaluate(t).toLowerCase()],concat:[gt,an(_t),(t,e)=>e.map((e=>ue(e.evaluate(t)))).join("")],"resolved-locale":[gt,[bt],(t,[e])=>e.evaluate(t).resolvedLocale()]});class An{constructor(t,e){var r;this.expression=t,this._warningHistory={},this._evaluator=new ve,this._defaultValue=e?"color"===(r=e).type&&gn(r.default)?new Qt(0,0,0,0):"color"===r.type?Qt.parse(r.default)||null:"padding"===r.type?ne.parse(r.default)||null:"variableAnchorOffsetCollection"===r.type?ae.parse(r.default)||null:void 0===r.default?null:r.default:null,this._enumValues=e&&"enum"===e.type?e.values:null}evaluateWithoutErrorHandling(t,e,r,n,i,a){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)}evaluate(t,e,r,n,i,a){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=r||null,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a||null;try{let t=this.expression.evaluate(this._evaluator);if(null==t||"number"==typeof t&&t!=t)return this._defaultValue;if(this._enumValues&&!(t in this._enumValues))throw new pe(`Expected value to be one of ${Object.keys(this._enumValues).map((t=>JSON.stringify(t))).join(", ")}, but found ${JSON.stringify(t)} instead.`);return t}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,typeof console<"u"&&console.warn(t.message)),this._defaultValue}}}function kn(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in Qr}function Mn(t,e){let r=new xe(Qr,on,[],e?function(t){let e={color:vt,string:gt,number:mt,enum:gt,boolean:yt,formatted:wt,padding:Tt,resolvedImage:At,variableAnchorOffsetCollection:kt};return"array"===t.type?Mt(e[t.value]||_t,t.length):e[t.type]}(e):void 0),n=r.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return n?un(new An(n,e)):hn(r.errors)}class Sn{constructor(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!ln(e.expression)}evaluateWithoutErrorHandling(t,e,r,n,i,a){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n,i,a)}evaluate(t,e,r,n,i,a){return this._styleExpression.evaluate(t,e,r,n,i,a)}}class En{constructor(t,e,r,n){this.kind=t,this.zoomStops=r,this._styleExpression=e,this.isStateDependent="camera"!==t&&!ln(e.expression),this.interpolationType=n}evaluateWithoutErrorHandling(t,e,r,n,i,a){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n,i,a)}evaluate(t,e,r,n,i,a){return this._styleExpression.evaluate(t,e,r,n,i,a)}interpolationFactor(t,e,r){return this.interpolationType?Fe.interpolationFactor(this.interpolationType,t,e,r):0}}function Cn(t,e){let r=Mn(t,e);if("error"===r.result)return r;let n=r.value.expression,i=sn(n);if(!i&&!pn(e))return hn([new pt("","data expressions not supported")]);let a=cn(n,["zoom"]);if(!a&&!fn(e))return hn([new pt("","zoom expressions not supported")]);let o=Ln(n);return o||a?o instanceof pt?hn([o]):o instanceof Fe&&!dn(e)?hn([new pt("",'"interpolate" expressions cannot be used with this property')]):un(o?new En(i?"camera":"composite",r.value,o.labels,o instanceof Fe?o.interpolation:void 0):new Sn(i?"constant":"source",r.value)):hn([new pt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class In{constructor(t,e){this._parameters=t,this._specification=e,ht(this,vn(this._parameters,this._specification))}static deserialize(t){return new In(t._parameters,t._specification)}static serialize(t){return{_parameters:t._parameters,_specification:t._specification}}}function Ln(t){let e=null;if(t instanceof _e)e=Ln(t.result);else if(t instanceof je){for(let r of t.args)if(e=Ln(r),e)break}else(t instanceof Ce||t instanceof Fe)&&t.input instanceof tn&&"zoom"===t.input.name&&(e=t);return e instanceof pt||t.eachChild((t=>{let r=Ln(t);r instanceof pt?e=r:!e&&r?e=new pt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&r&&e!==r&&(e=new pt("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),e}function Pn(t){if(!0===t||!1===t)return!0;if(!Array.isArray(t)||0===t.length)return!1;switch(t[0]){case"has":return t.length>=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(let e of t.slice(1))if(!Pn(e)&&"boolean"!=typeof e)return!1;return!0;default:return!0}}let zn={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Dn(t){if(null==t)return{filter:()=>!0,needGeometry:!1};Pn(t)||(t=Fn(t));let e=Mn(t,zn);if("error"===e.result)throw new Error(e.value.map((t=>`${t.key}: ${t.message}`)).join(", "));return{filter:(t,r,n)=>e.value.evaluate(t,r,{},n),needGeometry:Rn(t)}}function On(t,e){return te?1:0}function Rn(t){if(!Array.isArray(t))return!1;if("within"===t[0]||"distance"===t[0])return!0;for(let e=1;e"===e||"<="===e||">="===e?Bn(t[1],t[2],e):"any"===e?(r=t.slice(1),["any"].concat(r.map(Fn))):"all"===e?["all"].concat(t.slice(1).map(Fn)):"none"===e?["all"].concat(t.slice(1).map(Fn).map(Un)):"in"===e?jn(t[1],t.slice(2)):"!in"===e?Un(jn(t[1],t.slice(2))):"has"===e?Nn(t[1]):"!has"!==e||Un(Nn(t[1]));var r}function Bn(t,e,r){switch(t){case"$type":return[`filter-type-${r}`,e];case"$id":return[`filter-id-${r}`,e];default:return[`filter-${r}`,t,e]}}function jn(t,e){if(0===e.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some((t=>typeof t!=typeof e[0]))?["filter-in-large",t,["literal",e.sort(On)]]:["filter-in-small",t,["literal",e]]}}function Nn(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function Un(t){return["!",t]}function Vn(t){let e=typeof t;if("number"===e||"boolean"===e||"string"===e||null==t)return JSON.stringify(t);if(Array.isArray(t)){let e="[";for(let r of t)e+=`${Vn(r)},`;return`${e}]`}let r=Object.keys(t).sort(),n="{";for(let e=0;en.maximum?[new ut(e,r,`${r} is greater than the maximum value ${n.maximum}`)]:[]}function $n(t){let e,r,n,i=t.valueSpec,a=Gn(t.value.type),o={},s="categorical"!==a&&void 0===t.value.property,l=!s,c="array"===mn(t.value.stops)&&"array"===mn(t.value.stops[0])&&"object"===mn(t.value.stops[0][0]),u=Zn({key:t.key,value:t.value,valueSpec:t.styleSpec.function,validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===a)return[new ut(t.key,t.value,'identity function may not have a "stops" property')];let e=[],r=t.value;return e=e.concat(Yn({key:t.key,value:r,valueSpec:t.valueSpec,validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:h})),"array"===mn(r)&&0===r.length&&e.push(new ut(t.key,r,"array must have at least one stop")),e},default:function(t){return t.validateSpec({key:t.key,value:t.value,valueSpec:i,validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===a&&s&&u.push(new ut(t.key,t.value,'missing required property "property"')),"identity"===a||t.value.stops||u.push(new ut(t.key,t.value,'missing required property "stops"')),"exponential"===a&&t.valueSpec.expression&&!dn(t.valueSpec)&&u.push(new ut(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(l&&!pn(t.valueSpec)?u.push(new ut(t.key,t.value,"property functions not supported")):s&&!fn(t.valueSpec)&&u.push(new ut(t.key,t.value,"zoom functions not supported"))),"categorical"!==a&&!c||void 0!==t.value.property||u.push(new ut(t.key,t.value,'"property" property is required')),u;function h(t){let e=[],a=t.value,s=t.key;if("array"!==mn(a))return[new ut(s,a,`array expected, ${mn(a)} found`)];if(2!==a.length)return[new ut(s,a,`array length 2 expected, length ${a.length} found`)];if(c){if("object"!==mn(a[0]))return[new ut(s,a,`object expected, ${mn(a[0])} found`)];if(void 0===a[0].zoom)return[new ut(s,a,"object stop key must have zoom")];if(void 0===a[0].value)return[new ut(s,a,"object stop key must have value")];if(n&&n>Gn(a[0].zoom))return[new ut(s,a[0].zoom,"stop zoom values must appear in ascending order")];Gn(a[0].zoom)!==n&&(n=Gn(a[0].zoom),r=void 0,o={}),e=e.concat(Zn({key:`${s}[0]`,value:a[0],valueSpec:{zoom:{}},validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:Xn,value:p}}))}else e=e.concat(p({key:`${s}[0]`,value:a[0],valueSpec:{},validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec},a));return kn(Wn(a[1]))?e.concat([new ut(`${s}[1]`,a[1],"expressions are not allowed in function stops.")]):e.concat(t.validateSpec({key:`${s}[1]`,value:a[1],valueSpec:i,validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec}))}function p(t,n){let s=mn(t.value),l=Gn(t.value),c=null!==t.value?t.value:n;if(e){if(s!==e)return[new ut(t.key,c,`${s} stop domain type must match previous stop domain type ${e}`)]}else e=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new ut(t.key,c,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==a){let e=`number expected, ${s} found`;return pn(i)&&void 0===a&&(e+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new ut(t.key,c,e)]}return"categorical"!==a||"number"!==s||isFinite(l)&&Math.floor(l)===l?"categorical"!==a&&"number"===s&&void 0!==r&&lnew ut(`${t.key}${e.key}`,t.value,e.message)));let r=e.value.expression||e.value._styleExpression.expression;if("property"===t.expressionContext&&"text-font"===t.propertyKey&&!r.outputDefined())return[new ut(t.key,t.value,`Invalid data expression for "${t.propertyKey}". Output values must be contained as literals within the expression.`)];if("property"===t.expressionContext&&"layout"===t.propertyType&&!ln(r))return[new ut(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===t.expressionContext&&!ln(r))return[new ut(t.key,t.value,'"feature-state" data expressions are not supported with filters.')];if(t.expressionContext&&0===t.expressionContext.indexOf("cluster")){if(!cn(r,["zoom","feature-state"]))return[new ut(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===t.expressionContext&&!sn(r))return[new ut(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Jn(t){let e=t.key,r=t.value,n=t.valueSpec,i=[];return Array.isArray(n.values)?-1===n.values.indexOf(Gn(r))&&i.push(new ut(e,r,`expected one of [${n.values.join(", ")}], ${JSON.stringify(r)} found`)):-1===Object.keys(n.values).indexOf(Gn(r))&&i.push(new ut(e,r,`expected one of [${Object.keys(n.values).join(", ")}], ${JSON.stringify(r)} found`)),i}function Qn(t){return Pn(Wn(t.value))?Kn(ht({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):ti(t)}function ti(t){let e=t.value,r=t.key;if("array"!==mn(e))return[new ut(r,e,`array expected, ${mn(e)} found`)];let n,i=t.styleSpec,a=[];if(e.length<1)return[new ut(r,e,"filter array must have at least 1 element")];switch(a=a.concat(Jn({key:`${r}[0]`,value:e[0],valueSpec:i.filter_operator,style:t.style,styleSpec:t.styleSpec})),Gn(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&"$type"===Gn(e[1])&&a.push(new ut(r,e,`"$type" cannot be use with operator "${e[0]}"`));case"==":case"!=":3!==e.length&&a.push(new ut(r,e,`filter array for operator "${e[0]}" must have 3 elements`));case"in":case"!in":e.length>=2&&(n=mn(e[1]),"string"!==n&&a.push(new ut(`${r}[1]`,e[1],`string expected, ${n} found`)));for(let o=2;o{t in r&&e.push(new ut(n,r[t],`"${t}" is prohibited for ref layers`))})),i.layers.forEach((e=>{Gn(e.id)===s&&(t=e)})),t?t.ref?e.push(new ut(n,r.ref,"ref cannot reference another ref layer")):o=Gn(t.type):e.push(new ut(n,r.ref,`ref layer "${s}" not found`))}else if("background"!==o)if(r.source){let t=i.sources&&i.sources[r.source],a=t&&Gn(t.type);t?"vector"===a&&"raster"===o?e.push(new ut(n,r.source,`layer "${r.id}" requires a raster source`)):"raster-dem"!==a&&"hillshade"===o?e.push(new ut(n,r.source,`layer "${r.id}" requires a raster-dem source`)):"raster"===a&&"raster"!==o?e.push(new ut(n,r.source,`layer "${r.id}" requires a vector source`)):"vector"!==a||r["source-layer"]?"raster-dem"===a&&"hillshade"!==o?e.push(new ut(n,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"!==o||!r.paint||!r.paint["line-gradient"]||"geojson"===a&&t.lineMetrics||e.push(new ut(n,r,`layer "${r.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):e.push(new ut(n,r,`layer "${r.id}" must specify a "source-layer"`)):e.push(new ut(n,r.source,`source "${r.source}" not found`))}else e.push(new ut(n,r,'missing required property "source"'));return e=e.concat(Zn({key:n,value:r,valueSpec:a.layer,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,objectElementValidators:{"*":()=>[],type:()=>t.validateSpec({key:`${n}.type`,value:r.type,valueSpec:a.layer.type,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,object:r,objectKey:"type"}),filter:Qn,layout:t=>Zn({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,objectElementValidators:{"*":t=>ni(ht({layerType:o},t))}}),paint:t=>Zn({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,objectElementValidators:{"*":t=>ri(ht({layerType:o},t))}})}})),e}function ai(t){let e=t.value,r=t.key,n=mn(e);return"string"!==n?[new ut(r,e,`string expected, ${n} found`)]:[]}let oi={promoteId:function({key:t,value:e}){if("string"===mn(e))return ai({key:t,value:e});{let r=[];for(let n in e)r.push(...ai({key:`${t}.${n}`,value:e[n]}));return r}}};function si(t){let e=t.value,r=t.key,n=t.styleSpec,i=t.style,a=t.validateSpec;if(!e.type)return[new ut(r,e,'"type" is required')];let o,s=Gn(e.type);switch(s){case"vector":case"raster":return o=Zn({key:r,value:e,valueSpec:n[`source_${s.replace("-","_")}`],style:t.style,styleSpec:n,objectElementValidators:oi,validateSpec:a}),o;case"raster-dem":return o=function(t){var e;let r=null!==(e=t.sourceName)&&void 0!==e?e:"",n=t.value,i=t.styleSpec,a=i.source_raster_dem,o=t.style,s=[],l=mn(n);if(void 0===n)return s;if("object"!==l)return s.push(new ut("source_raster_dem",n,`object expected, ${l} found`)),s;let c="custom"===Gn(n.encoding),u=["redFactor","greenFactor","blueFactor","baseShift"],h=t.value.encoding?`"${t.value.encoding}"`:"Default";for(let e in n)!c&&u.includes(e)?s.push(new ut(e,n[e],`In "${r}": "${e}" is only valid when "encoding" is set to "custom". ${h} encoding found`)):a[e]?s=s.concat(t.validateSpec({key:e,value:n[e],valueSpec:a[e],validateSpec:t.validateSpec,style:o,styleSpec:i})):s.push(new ut(e,n[e],`unknown property "${e}"`));return s}({sourceName:r,value:e,style:t.style,styleSpec:n,validateSpec:a}),o;case"geojson":if(o=Zn({key:r,value:e,valueSpec:n.source_geojson,style:i,styleSpec:n,validateSpec:a,objectElementValidators:oi}),e.cluster)for(let t in e.clusterProperties){let[n,i]=e.clusterProperties[t],s="string"==typeof n?[n,["accumulated"],["get",t]]:n;o.push(...Kn({key:`${r}.${t}.map`,value:i,validateSpec:a,expressionContext:"cluster-map"})),o.push(...Kn({key:`${r}.${t}.reduce`,value:s,validateSpec:a,expressionContext:"cluster-reduce"}))}return o;case"video":return Zn({key:r,value:e,valueSpec:n.source_video,style:i,validateSpec:a,styleSpec:n});case"image":return Zn({key:r,value:e,valueSpec:n.source_image,style:i,validateSpec:a,styleSpec:n});case"canvas":return[new ut(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Jn({key:`${r}.type`,value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:i,validateSpec:a,styleSpec:n})}}function li(t){let e=t.value,r=t.styleSpec,n=r.light,i=t.style,a=[],o=mn(e);if(void 0===e)return a;if("object"!==o)return a=a.concat([new ut("light",e,`object expected, ${o} found`)]),a;for(let o in e){let s=o.match(/^(.*)-transition$/);a=a.concat(s&&n[s[1]]&&n[s[1]].transition?t.validateSpec({key:o,value:e[o],valueSpec:r.transition,validateSpec:t.validateSpec,style:i,styleSpec:r}):n[o]?t.validateSpec({key:o,value:e[o],valueSpec:n[o],validateSpec:t.validateSpec,style:i,styleSpec:r}):[new ut(o,e[o],`unknown property "${o}"`)])}return a}function ci(t){let e=t.value,r=t.styleSpec,n=r.sky,i=t.style,a=mn(e);if(void 0===e)return[];if("object"!==a)return[new ut("sky",e,`object expected, ${a} found`)];let o=[];for(let a in e)o=o.concat(n[a]?t.validateSpec({key:a,value:e[a],valueSpec:n[a],style:i,styleSpec:r}):[new ut(a,e[a],`unknown property "${a}"`)]);return o}function ui(t){let e=t.value,r=t.styleSpec,n=r.terrain,i=t.style,a=[],o=mn(e);if(void 0===e)return a;if("object"!==o)return a=a.concat([new ut("terrain",e,`object expected, ${o} found`)]),a;for(let o in e)a=a.concat(n[o]?t.validateSpec({key:o,value:e[o],valueSpec:n[o],validateSpec:t.validateSpec,style:i,styleSpec:r}):[new ut(o,e[o],`unknown property "${o}"`)]);return a}function hi(t){let e=[],r=t.value,n=t.key;if(Array.isArray(r)){let i=[],a=[];for(let o in r)r[o].id&&i.includes(r[o].id)&&e.push(new ut(n,r,`all the sprites' ids must be unique, but ${r[o].id} is duplicated`)),i.push(r[o].id),r[o].url&&a.includes(r[o].url)&&e.push(new ut(n,r,`all the sprites' URLs must be unique, but ${r[o].url} is duplicated`)),a.push(r[o].url),e=e.concat(Zn({key:`${n}[${o}]`,value:r[o],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:t.validateSpec}));return e}return ai({key:n,value:r})}let pi={"*":()=>[],array:Yn,boolean:function(t){let e=t.value,r=t.key,n=mn(e);return"boolean"!==n?[new ut(r,e,`boolean expected, ${n} found`)]:[]},number:Xn,color:function(t){let e=t.key,r=t.value,n=mn(r);return"string"!==n?[new ut(e,r,`color expected, ${n} found`)]:Qt.parse(String(r))?[]:[new ut(e,r,`color expected, "${r}" found`)]},constants:Hn,enum:Jn,filter:Qn,function:$n,layer:ii,object:Zn,source:si,light:li,sky:ci,terrain:ui,projection:function(t){let e=t.value,r=t.styleSpec,n=r.projection,i=t.style,a=mn(e);if(void 0===e)return[];if("object"!==a)return[new ut("projection",e,`object expected, ${a} found`)];let o=[];for(let a in e)o=o.concat(n[a]?t.validateSpec({key:a,value:e[a],valueSpec:n[a],style:i,styleSpec:r}):[new ut(a,e[a],`unknown property "${a}"`)]);return o},string:ai,formatted:function(t){return 0===ai(t).length?[]:Kn(t)},resolvedImage:function(t){return 0===ai(t).length?[]:Kn(t)},padding:function(t){let e=t.key,r=t.value;if("array"===mn(r)){if(r.length<1||r.length>4)return[new ut(e,r,`padding requires 1 to 4 values; ${r.length} values found`)];let n={type:"number"},i=[];for(let a=0;a[]}})),t.constants&&(r=r.concat(Hn({key:"constants",value:t.constants,style:t,styleSpec:e,validateSpec:fi}))),yi(r)}function gi(t){return function(e){return t(((t,e)=>r(t,i(e)))(((t,e)=>{for(var r in e||(e={}))l.call(e,r)&&h(t,r,e[r]);if(o)for(var r of o(e))u.call(e,r)&&h(t,r,e[r]);return t})({},e),{validateSpec:fi}))}}function yi(t){return[].concat(t).sort(((t,e)=>t.line-e.line))}function vi(t){return function(...e){return yi(t.apply(this,e))}}mi.source=vi(gi(si)),mi.sprite=vi(gi(hi)),mi.glyphs=vi(gi(di)),mi.light=vi(gi(li)),mi.sky=vi(gi(ci)),mi.terrain=vi(gi(ui)),mi.layer=vi(gi(ii)),mi.filter=vi(gi(Qn)),mi.paintProperty=vi(gi(ri)),mi.layoutProperty=vi(gi(ni));let xi=mi,_i=xi.light,bi=xi.sky,wi=xi.paintProperty,Ti=xi.layoutProperty;function Ai(t,e){let r=!1;if(e&&e.length)for(let n of e)t.fire(new $(new Error(n.message))),r=!0;return r}class ki{constructor(t,e,r){let n=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;let i=new Int32Array(this.arrayBuffer);t=i[0],this.d=(e=i[1])+2*(r=i[2]);for(let t=0;t=c[l+0]&&n>=c[l+1])?(o[h]=!0,a.push(i[h])):o[h]=!1}}}}_forEachCell(t,e,r,n,i,a,o,s){let l=this._convertToCellCoord(t),c=this._convertToCellCoord(e),u=this._convertToCellCoord(r),h=this._convertToCellCoord(n);for(let p=l;p<=u;p++)for(let l=c;l<=h;l++){let c=this.d*l+p;if((!s||s(this._convertFromCellCoord(p),this._convertFromCellCoord(l),this._convertFromCellCoord(p+1),this._convertFromCellCoord(l+1)))&&i.call(this,t,e,r,n,c,a,o,s))return}}_convertFromCellCoord(t){return(t-this.padding)/this.scale}_convertToCellCoord(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;let t=this.cells,e=3+this.cells.length+1+1,r=0;for(let t=0;t=0)continue;let a=t[n];i[n]=Mi[r].shallow.indexOf(n)>=0?a:Li(a,e)}t instanceof Error&&(i.message=t.message)}if(i.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==r&&(i.$name=r),i}function Pi(t){if(Ii(t))return t;if(Array.isArray(t))return t.map(Pi);if("object"!=typeof t)throw new Error("can't deserialize object of type "+typeof t);let e=Ci(t)||"Object";if(!Mi[e])throw new Error(`can't deserialize unregistered class ${e}`);let{klass:r}=Mi[e];if(!r)throw new Error(`can't deserialize unregistered class ${e}`);if(r.deserialize)return r.deserialize(t);let n=Object.create(r.prototype);for(let r of Object.keys(t)){if("$name"===r)continue;let i=t[r];n[r]=Mi[e].shallow.indexOf(r)>=0?i:Pi(i)}return n}class zi{constructor(){this.first=!0}update(t,e){let r=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=e):this.lastFloorZoomt>=12272&&t<=12287,Oi=t=>t>=12288&&t<=12351,Ri=t=>t>=12448&&t<=12543,Fi=t=>t>=12736&&t<=12783,Bi=t=>t>=12800&&t<=13055,ji=t=>t>=13056&&t<=13311,Ni=t=>t>=65040&&t<=65055,Ui=t=>t>=65072&&t<=65103,Vi=t=>t>=65104&&t<=65135,qi=t=>t>=65280&&t<=65519;function Hi(t){for(let e of t)if($i(e.charCodeAt(0)))return!0;return!1}function Gi(t){for(let e of t)if(!Yi(e.charCodeAt(0)))return!1;return!0}function Wi(t){let e=t.map((t=>{try{return new RegExp(`\\p{sc=${t}}`,"u").source}catch{return null}})).filter((t=>t));return new RegExp(e.join("|"),"u")}let Zi=Wi(["Arab","Dupl","Mong","Ougr","Syrc"]);function Yi(t){return!Zi.test(String.fromCodePoint(t))}let Xi=Wi(["Bopo","Hani","Hira","Kana","Kits","Nshu","Tang","Yiii"]);function $i(t){return!(746!==t&&747!==t&&(t<4352||!(Ui(t)&&!(t>=65097&&t<=65103)||ji(t)||Fi(t)||!(!Oi(t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||Bi(t)||Di(t)||(t=>t>=12688&&t<=12703)(t)||Ri(t)&&12540!==t||!(!qi(t)||65288===t||65289===t||65293===t||t>=65306&&t<=65310||65339===t||65341===t||65343===t||t>=65371&&t<=65503||65507===t||t>=65512&&t<=65519)||!(!Vi(t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||Ni(t)||(t=>t>=19904&&t<=19967)(t)||new RegExp("\\p{sc=Cans}","u").test(String.fromCodePoint(t))||new RegExp("\\p{sc=Hang}","u").test(String.fromCodePoint(t))||Xi.test(String.fromCodePoint(t)))))}function Ki(t){return!($i(t)||(e=t,(t=>t>=128&&t<=255)(e)&&(167===e||169===e||174===e||177===e||188===e||189===e||190===e||215===e||247===e)||(t=>t>=8192&&t<=8303)(e)&&(8214===e||8224===e||8225===e||8240===e||8241===e||8251===e||8252===e||8258===e||8263===e||8264===e||8265===e||8273===e)||(t=>t>=8448&&t<=8527)(e)||(t=>t>=8528&&t<=8591)(e)||(t=>t>=8960&&t<=9215)(e)&&(e>=8960&&e<=8967||e>=8972&&e<=8991||e>=8996&&e<=9e3||9003===e||e>=9085&&e<=9114||e>=9150&&e<=9165||9167===e||e>=9169&&e<=9179||e>=9186&&e<=9215)||(t=>t>=9216&&t<=9279)(e)&&9251!==e||(t=>t>=9280&&t<=9311)(e)||(t=>t>=9312&&t<=9471)(e)||(t=>t>=9632&&t<=9727)(e)||(t=>t>=9728&&t<=9983)(e)&&!(e>=9754&&e<=9759)||(t=>t>=11008&&t<=11263)(e)&&(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243)||Oi(e)||Ri(e)||(t=>t>=57344&&t<=63743)(e)||Ui(e)||Vi(e)||qi(e)||8734===e||8756===e||8757===e||e>=9984&&e<=10087||e>=10102&&e<=10131||65532===e||65533===e));var e}let Ji=Wi(["Adlm","Arab","Armi","Avst","Chrs","Cprt","Egyp","Elym","Gara","Hatr","Hebr","Hung","Khar","Lydi","Mand","Mani","Mend","Merc","Mero","Narb","Nbat","Nkoo","Orkh","Palm","Phli","Phlp","Phnx","Prti","Rohg","Samr","Sarb","Sogo","Syrc","Thaa","Todr","Yezi"]);function Qi(t){return Ji.test(String.fromCodePoint(t))}function ta(t,e){return!(!e&&Qi(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||(t=>t>=6016&&t<=6143)(t))}function ea(t){for(let e of t)if(Qi(e.charCodeAt(0)))return!0;return!1}let ra=new class{constructor(){this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null}setState(t){this.pluginStatus=t.pluginStatus,this.pluginURL=t.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(t){this.applyArabicShaping=t.applyArabicShaping,this.processBidirectionalText=t.processBidirectionalText,this.processStyledBidirectionalText=t.processStyledBidirectionalText}isParsed(){return null!=this.applyArabicShaping&&null!=this.processBidirectionalText&&null!=this.processStyledBidirectionalText}getPluginURL(){return this.pluginURL}getRTLTextPluginStatus(){return this.pluginStatus}};class na{constructor(t,e){this.zoom=t,e?(this.now=e.now,this.fadeDuration=e.fadeDuration,this.zoomHistory=e.zoomHistory,this.transition=e.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new zi,this.transition={})}isSupportedScript(t){return function(t,e){for(let r of t)if(!ta(r.charCodeAt(0),e))return!1;return!0}(t,"loaded"===ra.getRTLTextPluginStatus())}crossFadingFactor(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){let t=this.zoom,e=t-Math.floor(t),r=this.crossFadingFactor();return t>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*e}}}class ia{constructor(t,e){this.property=t,this.value=e,this.expression=function(t,e){if(gn(t))return new In(t,e);if(kn(t)){let r=Cn(t,e);if("error"===r.result)throw new Error(r.value.map((t=>`${t.key}: ${t.message}`)).join(", "));return r.value}{let r=t;return"color"===e.type&&"string"==typeof t?r=Qt.parse(t):"padding"!==e.type||"number"!=typeof t&&!Array.isArray(t)?"variableAnchorOffsetCollection"===e.type&&Array.isArray(t)&&(r=ae.parse(t)):r=ne.parse(t),{kind:"constant",evaluate:()=>r}}}(void 0===e?t.specification.default:e,t.specification)}isDataDriven(){return"source"===this.expression.kind||"composite"===this.expression.kind}possiblyEvaluate(t,e,r){return this.property.possiblyEvaluate(this,t,e,r)}}class aa{constructor(t){this.property=t,this.value=new ia(t,void 0)}transitioned(t,e){return new sa(this.property,this.value,e,T({},t.transition,this.transition),t.now)}untransitioned(){return new sa(this.property,this.value,null,{},0)}}class oa{constructor(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)}getValue(t){return S(this._values[t].value.value)}setValue(t,e){Object.prototype.hasOwnProperty.call(this._values,t)||(this._values[t]=new aa(this._values[t].property)),this._values[t].value=new ia(this._values[t].property,null===e?void 0:S(e))}getTransition(t){return S(this._values[t].transition)}setTransition(t,e){Object.prototype.hasOwnProperty.call(this._values,t)||(this._values[t]=new aa(this._values[t].property)),this._values[t].transition=S(e)||void 0}serialize(){let t={};for(let e of Object.keys(this._values)){let r=this.getValue(e);void 0!==r&&(t[e]=r);let n=this.getTransition(e);void 0!==n&&(t[`${e}-transition`]=n)}return t}transitioned(t,e){let r=new la(this._properties);for(let n of Object.keys(this._values))r._values[n]=this._values[n].transitioned(t,e._values[n]);return r}untransitioned(){let t=new la(this._properties);for(let e of Object.keys(this._values))t._values[e]=this._values[e].untransitioned();return t}}class sa{constructor(t,e,r,n,i){this.property=t,this.value=e,this.begin=i+n.delay||0,this.end=this.begin+n.duration||0,t.specification.transition&&(n.delay||n.duration)&&(this.prior=r)}possiblyEvaluate(t,e,r){let n=t.now||0,i=this.value.possiblyEvaluate(t,e,r),a=this.prior;if(a){if(n>this.end)return this.prior=null,i;if(this.value.isDataDriven())return this.prior=null,i;if(n=1)return 1;let e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}(o))}}return i}}class la{constructor(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)}possiblyEvaluate(t,e,r){let n=new ha(this._properties);for(let i of Object.keys(this._values))n._values[i]=this._values[i].possiblyEvaluate(t,e,r);return n}hasTransition(){for(let t of Object.keys(this._values))if(this._values[t].prior)return!0;return!1}}class ca{constructor(t){this._properties=t,this._values=Object.create(t.defaultPropertyValues)}hasValue(t){return void 0!==this._values[t].value}getValue(t){return S(this._values[t].value)}setValue(t,e){this._values[t]=new ia(this._values[t].property,null===e?void 0:S(e))}serialize(){let t={};for(let e of Object.keys(this._values)){let r=this.getValue(e);void 0!==r&&(t[e]=r)}return t}possiblyEvaluate(t,e,r){let n=new ha(this._properties);for(let i of Object.keys(this._values))n._values[i]=this._values[i].possiblyEvaluate(t,e,r);return n}}class ua{constructor(t,e,r){this.property=t,this.value=e,this.parameters=r}isConstant(){return"constant"===this.value.kind}constantOr(t){return"constant"===this.value.kind?this.value.value:t}evaluate(t,e,r,n){return this.property.evaluate(this.value,this.parameters,t,e,r,n)}}class ha{constructor(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues)}get(t){return this._values[t]}}class pa{constructor(t){this.specification=t}possiblyEvaluate(t,e){if(t.isDataDriven())throw new Error("Value should not be data driven");return t.expression.evaluate(e)}interpolate(t,e,r){let n=Re[this.specification.type];return n?n(t,e,r):t}}class fa{constructor(t,e){this.specification=t,this.overrides=e}possiblyEvaluate(t,e,r,n){return new ua(this,"constant"===t.expression.kind||"camera"===t.expression.kind?{kind:"constant",value:t.expression.evaluate(e,null,{},r,n)}:t.expression,e)}interpolate(t,e,r){if("constant"!==t.value.kind||"constant"!==e.value.kind)return t;if(void 0===t.value.value||void 0===e.value.value)return new ua(this,{kind:"constant",value:void 0},t.parameters);let n=Re[this.specification.type];if(n){let i=n(t.value.value,e.value.value,r);return new ua(this,{kind:"constant",value:i},t.parameters)}return t}evaluate(t,e,r,n,i,a){return"constant"===t.kind?t.value:t.evaluate(e,r,n,i,a)}}class da extends fa{possiblyEvaluate(t,e,r,n){if(void 0===t.value)return new ua(this,{kind:"constant",value:void 0},e);if("constant"===t.expression.kind){let i=t.expression.evaluate(e,null,{},r,n),a="resolvedImage"===t.property.specification.type&&"string"!=typeof i?i.name:i,o=this._calculate(a,a,a,e);return new ua(this,{kind:"constant",value:o},e)}if("camera"===t.expression.kind){let r=this._calculate(t.expression.evaluate({zoom:e.zoom-1}),t.expression.evaluate({zoom:e.zoom}),t.expression.evaluate({zoom:e.zoom+1}),e);return new ua(this,{kind:"constant",value:r},e)}return new ua(this,t.expression,e)}evaluate(t,e,r,n,i,a){if("source"===t.kind){let o=t.evaluate(e,r,n,i,a);return this._calculate(o,o,o,e)}return"composite"===t.kind?this._calculate(t.evaluate({zoom:Math.floor(e.zoom)-1},r,n),t.evaluate({zoom:Math.floor(e.zoom)},r,n),t.evaluate({zoom:Math.floor(e.zoom)+1},r,n),e):t.value}_calculate(t,e,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}}interpolate(t){return t}}class ma{constructor(t){this.specification=t}possiblyEvaluate(t,e,r,n){if(void 0!==t.value){if("constant"===t.expression.kind){let i=t.expression.evaluate(e,null,{},r,n);return this._calculate(i,i,i,e)}return this._calculate(t.expression.evaluate(new na(Math.floor(e.zoom-1),e)),t.expression.evaluate(new na(Math.floor(e.zoom),e)),t.expression.evaluate(new na(Math.floor(e.zoom+1),e)),e)}}_calculate(t,e,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}}interpolate(t){return t}}class ga{constructor(t){this.specification=t}possiblyEvaluate(t,e,r,n){return!!t.expression.evaluate(e,null,{},r,n)}interpolate(){return!1}}class ya{constructor(t){this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(let e in t){let r=t[e];r.specification.overridable&&this.overridableProperties.push(e);let n=this.defaultPropertyValues[e]=new ia(r,void 0),i=this.defaultTransitionablePropertyValues[e]=new aa(r);this.defaultTransitioningPropertyValues[e]=i.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=n.possiblyEvaluate({})}}}Si("DataDrivenProperty",fa),Si("DataConstantProperty",pa),Si("CrossFadedDataDrivenProperty",da),Si("CrossFadedProperty",ma),Si("ColorRampProperty",ga);let va="-transition";class xa extends K{constructor(t,e){if(super(),this.id=t.id,this.type=t.type,this._featureFilter={filter:()=>!0,needGeometry:!1},"custom"!==t.type&&(this.metadata=t.metadata,this.minzoom=t.minzoom,this.maxzoom=t.maxzoom,"background"!==t.type&&(this.source=t.source,this.sourceLayer=t["source-layer"],this.filter=t.filter),e.layout&&(this._unevaluatedLayout=new ca(e.layout)),e.paint)){this._transitionablePaint=new oa(e.paint);for(let e in t.paint)this.setPaintProperty(e,t.paint[e],{validate:!1});for(let e in t.layout)this.setLayoutProperty(e,t.layout[e],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new ha(e.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(t){return"visibility"===t?this.visibility:this._unevaluatedLayout.getValue(t)}setLayoutProperty(t,e,r={}){null!=e&&this._validate(Ti,`layers.${this.id}.layout.${t}`,t,e,r)||("visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility=e)}getPaintProperty(t){return t.endsWith(va)?this._transitionablePaint.getTransition(t.slice(0,-11)):this._transitionablePaint.getValue(t)}setPaintProperty(t,e,r={}){if(null!=e&&this._validate(wi,`layers.${this.id}.paint.${t}`,t,e,r))return!1;if(t.endsWith(va))return this._transitionablePaint.setTransition(t.slice(0,-11),e||void 0),!1;{let r=this._transitionablePaint._values[t],n="cross-faded-data-driven"===r.property.specification["property-type"],i=r.value.isDataDriven(),a=r.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);let o=this._transitionablePaint._values[t].value;return o.isDataDriven()||i||n||this._handleOverridablePaintPropertyUpdate(t,a,o)}}_handleSpecialPaintPropertyUpdate(t){}_handleOverridablePaintPropertyUpdate(t,e,r){return!1}isHidden(t){return!!(this.minzoom&&t=this.maxzoom)||"none"===this.visibility}updateTransitions(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(t,e){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,e)}serialize(){let t={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(t.layout=t.layout||{},t.layout.visibility=this.visibility),M(t,((t,e)=>!(void 0===t||"layout"===e&&!Object.keys(t).length||"paint"===e&&!Object.keys(t).length)))}_validate(t,e,r,n,i={}){return(!i||!1!==i.validate)&&Ai(this,t.call(xi,{key:e,layerType:this.type,objectKey:r,value:n,styleSpec:J,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(let t in this.paint._values){let e=this.paint.get(t);if(e instanceof ua&&pn(e.property.specification)&&("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent)return!0}return!1}}let _a={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class ba{constructor(t,e){this._structArray=t,this._pos1=e*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class wa{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}}static deserialize(t){let e=Object.create(this.prototype);return e.arrayBuffer=t.arrayBuffer,e.length=t.length,e.capacity=t.arrayBuffer.byteLength/e.bytesPerElement,e._refreshViews(),e}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(t){this.reserve(t),this.length=t}reserve(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);let e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function Ta(t,e=1){let r=0,n=0;return{members:t.map((t=>{let i=_a[t.type].BYTES_PER_ELEMENT,a=r=Aa(r,Math.max(e,i)),o=t.components||1;return n=Math.max(n,i),r+=i*o,{name:t.name,type:t.type,components:o,offset:a}})),size:Aa(r,Math.max(n,e)),alignment:e}}function Aa(t,e){return Math.ceil(t/e)*e}class ka extends wa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e){let r=this.length;return this.resize(r+1),this.emplace(r,t,e)}emplace(t,e,r){let n=2*t;return this.int16[n+0]=e,this.int16[n+1]=r,t}}ka.prototype.bytesPerElement=4,Si("StructArrayLayout2i4",ka);class Ma extends wa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r){let n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)}emplace(t,e,r,n){let i=3*t;return this.int16[i+0]=e,this.int16[i+1]=r,this.int16[i+2]=n,t}}Ma.prototype.bytesPerElement=6,Si("StructArrayLayout3i6",Ma);class Sa extends wa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,n){let i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)}emplace(t,e,r,n,i){let a=4*t;return this.int16[a+0]=e,this.int16[a+1]=r,this.int16[a+2]=n,this.int16[a+3]=i,t}}Sa.prototype.bytesPerElement=8,Si("StructArrayLayout4i8",Sa);class Ea extends wa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,n,i,a){let o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i,a)}emplace(t,e,r,n,i,a,o){let s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=a,this.int16[s+5]=o,t}}Ea.prototype.bytesPerElement=12,Si("StructArrayLayout2i4i12",Ea);class Ca extends wa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,n,i,a){let o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i,a)}emplace(t,e,r,n,i,a,o){let s=4*t,l=8*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.uint8[l+4]=n,this.uint8[l+5]=i,this.uint8[l+6]=a,this.uint8[l+7]=o,t}}Ca.prototype.bytesPerElement=8,Si("StructArrayLayout2i4ub8",Ca);class Ia extends wa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e){let r=this.length;return this.resize(r+1),this.emplace(r,t,e)}emplace(t,e,r){let n=2*t;return this.float32[n+0]=e,this.float32[n+1]=r,t}}Ia.prototype.bytesPerElement=8,Si("StructArrayLayout2f8",Ia);class La extends wa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,r,n,i,a,o,s,l,c){let u=this.length;return this.resize(u+1),this.emplace(u,t,e,r,n,i,a,o,s,l,c)}emplace(t,e,r,n,i,a,o,s,l,c,u){let h=10*t;return this.uint16[h+0]=e,this.uint16[h+1]=r,this.uint16[h+2]=n,this.uint16[h+3]=i,this.uint16[h+4]=a,this.uint16[h+5]=o,this.uint16[h+6]=s,this.uint16[h+7]=l,this.uint16[h+8]=c,this.uint16[h+9]=u,t}}La.prototype.bytesPerElement=20,Si("StructArrayLayout10ui20",La);class Pa extends wa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,r,n,i,a,o,s,l,c,u,h){let p=this.length;return this.resize(p+1),this.emplace(p,t,e,r,n,i,a,o,s,l,c,u,h)}emplace(t,e,r,n,i,a,o,s,l,c,u,h,p){let f=12*t;return this.int16[f+0]=e,this.int16[f+1]=r,this.int16[f+2]=n,this.int16[f+3]=i,this.uint16[f+4]=a,this.uint16[f+5]=o,this.uint16[f+6]=s,this.uint16[f+7]=l,this.int16[f+8]=c,this.int16[f+9]=u,this.int16[f+10]=h,this.int16[f+11]=p,t}}Pa.prototype.bytesPerElement=24,Si("StructArrayLayout4i4ui4i24",Pa);class za extends wa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r){let n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)}emplace(t,e,r,n){let i=3*t;return this.float32[i+0]=e,this.float32[i+1]=r,this.float32[i+2]=n,t}}za.prototype.bytesPerElement=12,Si("StructArrayLayout3f12",za);class Da extends wa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(t){let e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){return this.uint32[1*t+0]=e,t}}Da.prototype.bytesPerElement=4,Si("StructArrayLayout1ul4",Da);class Oa extends wa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,r,n,i,a,o,s,l){let c=this.length;return this.resize(c+1),this.emplace(c,t,e,r,n,i,a,o,s,l)}emplace(t,e,r,n,i,a,o,s,l,c){let u=10*t,h=5*t;return this.int16[u+0]=e,this.int16[u+1]=r,this.int16[u+2]=n,this.int16[u+3]=i,this.int16[u+4]=a,this.int16[u+5]=o,this.uint32[h+3]=s,this.uint16[u+8]=l,this.uint16[u+9]=c,t}}Oa.prototype.bytesPerElement=20,Si("StructArrayLayout6i1ul2ui20",Oa);class Ra extends wa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,n,i,a){let o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i,a)}emplace(t,e,r,n,i,a,o){let s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=a,this.int16[s+5]=o,t}}Ra.prototype.bytesPerElement=12,Si("StructArrayLayout2i2i2i12",Ra);class Fa extends wa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,n,i){let a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n,i)}emplace(t,e,r,n,i,a){let o=4*t,s=8*t;return this.float32[o+0]=e,this.float32[o+1]=r,this.float32[o+2]=n,this.int16[s+6]=i,this.int16[s+7]=a,t}}Fa.prototype.bytesPerElement=16,Si("StructArrayLayout2f1f2i16",Fa);class Ba extends wa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,n,i,a){let o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i,a)}emplace(t,e,r,n,i,a,o){let s=16*t,l=4*t,c=8*t;return this.uint8[s+0]=e,this.uint8[s+1]=r,this.float32[l+1]=n,this.float32[l+2]=i,this.int16[c+6]=a,this.int16[c+7]=o,t}}Ba.prototype.bytesPerElement=16,Si("StructArrayLayout2ub2f2i16",Ba);class ja extends wa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,r){let n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)}emplace(t,e,r,n){let i=3*t;return this.uint16[i+0]=e,this.uint16[i+1]=r,this.uint16[i+2]=n,t}}ja.prototype.bytesPerElement=6,Si("StructArrayLayout3ui6",ja);class Na extends wa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r,n,i,a,o,s,l,c,u,h,p,f,d,m,g){let y=this.length;return this.resize(y+1),this.emplace(y,t,e,r,n,i,a,o,s,l,c,u,h,p,f,d,m,g)}emplace(t,e,r,n,i,a,o,s,l,c,u,h,p,f,d,m,g,y){let v=24*t,x=12*t,_=48*t;return this.int16[v+0]=e,this.int16[v+1]=r,this.uint16[v+2]=n,this.uint16[v+3]=i,this.uint32[x+2]=a,this.uint32[x+3]=o,this.uint32[x+4]=s,this.uint16[v+10]=l,this.uint16[v+11]=c,this.uint16[v+12]=u,this.float32[x+7]=h,this.float32[x+8]=p,this.uint8[_+36]=f,this.uint8[_+37]=d,this.uint8[_+38]=m,this.uint32[x+10]=g,this.int16[v+22]=y,t}}Na.prototype.bytesPerElement=48,Si("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Na);class Ua extends wa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r,n,i,a,o,s,l,c,u,h,p,f,d,m,g,y,v,x,_,b,w,T,A,k,M,S){let E=this.length;return this.resize(E+1),this.emplace(E,t,e,r,n,i,a,o,s,l,c,u,h,p,f,d,m,g,y,v,x,_,b,w,T,A,k,M,S)}emplace(t,e,r,n,i,a,o,s,l,c,u,h,p,f,d,m,g,y,v,x,_,b,w,T,A,k,M,S,E){let C=32*t,I=16*t;return this.int16[C+0]=e,this.int16[C+1]=r,this.int16[C+2]=n,this.int16[C+3]=i,this.int16[C+4]=a,this.int16[C+5]=o,this.int16[C+6]=s,this.int16[C+7]=l,this.uint16[C+8]=c,this.uint16[C+9]=u,this.uint16[C+10]=h,this.uint16[C+11]=p,this.uint16[C+12]=f,this.uint16[C+13]=d,this.uint16[C+14]=m,this.uint16[C+15]=g,this.uint16[C+16]=y,this.uint16[C+17]=v,this.uint16[C+18]=x,this.uint16[C+19]=_,this.uint16[C+20]=b,this.uint16[C+21]=w,this.uint16[C+22]=T,this.uint32[I+12]=A,this.float32[I+13]=k,this.float32[I+14]=M,this.uint16[C+30]=S,this.uint16[C+31]=E,t}}Ua.prototype.bytesPerElement=64,Si("StructArrayLayout8i15ui1ul2f2ui64",Ua);class Va extends wa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t){let e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){return this.float32[1*t+0]=e,t}}Va.prototype.bytesPerElement=4,Si("StructArrayLayout1f4",Va);class qa extends wa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r){let n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)}emplace(t,e,r,n){let i=3*t;return this.uint16[6*t+0]=e,this.float32[i+1]=r,this.float32[i+2]=n,t}}qa.prototype.bytesPerElement=12,Si("StructArrayLayout1ui2f12",qa);class Ha extends wa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,r){let n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)}emplace(t,e,r,n){let i=4*t;return this.uint32[2*t+0]=e,this.uint16[i+2]=r,this.uint16[i+3]=n,t}}Ha.prototype.bytesPerElement=8,Si("StructArrayLayout1ul2ui8",Ha);class Ga extends wa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e){let r=this.length;return this.resize(r+1),this.emplace(r,t,e)}emplace(t,e,r){let n=2*t;return this.uint16[n+0]=e,this.uint16[n+1]=r,t}}Ga.prototype.bytesPerElement=4,Si("StructArrayLayout2ui4",Ga);class Wa extends wa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t){let e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){return this.uint16[1*t+0]=e,t}}Wa.prototype.bytesPerElement=2,Si("StructArrayLayout1ui2",Wa);class Za extends wa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r,n){let i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)}emplace(t,e,r,n,i){let a=4*t;return this.float32[a+0]=e,this.float32[a+1]=r,this.float32[a+2]=n,this.float32[a+3]=i,t}}Za.prototype.bytesPerElement=16,Si("StructArrayLayout4f16",Za);class Ya extends ba{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new c(this.anchorPointX,this.anchorPointY)}}Ya.prototype.size=20;class Xa extends Oa{get(t){return new Ya(this,t)}}Si("CollisionBoxArray",Xa);class $a extends ba{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(t){this._structArray.uint8[this._pos1+37]=t}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(t){this._structArray.uint8[this._pos1+38]=t}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(t){this._structArray.uint32[this._pos4+10]=t}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}$a.prototype.size=48;class Ka extends Na{get(t){return new $a(this,t)}}Si("PlacedSymbolArray",Ka);class Ja extends ba{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(t){this._structArray.uint32[this._pos4+12]=t}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}}Ja.prototype.size=64;class Qa extends Ua{get(t){return new Ja(this,t)}}Si("SymbolInstanceArray",Qa);class to extends Va{getoffsetX(t){return this.float32[1*t+0]}}Si("GlyphOffsetArray",to);class eo extends Ma{getx(t){return this.int16[3*t+0]}gety(t){return this.int16[3*t+1]}gettileUnitDistanceFromAnchor(t){return this.int16[3*t+2]}}Si("SymbolLineVertexArray",eo);class ro extends ba{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}}ro.prototype.size=12;class no extends qa{get(t){return new ro(this,t)}}Si("TextAnchorOffsetArray",no);class io extends ba{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}}io.prototype.size=8;class ao extends Ha{get(t){return new io(this,t)}}Si("FeatureIndexArray",ao);class oo extends ka{}class so extends ka{}class lo extends ka{}class co extends Ea{}class uo extends Ca{}class ho extends Ia{}class po extends La{}class fo extends Pa{}class mo extends za{}class go extends Da{}class yo extends Ra{}class vo extends Ba{}class xo extends ja{}class _o extends Ga{}let bo=Ta([{name:"a_pos",components:2,type:"Int16"}],4),{members:wo}=bo;class To{constructor(t=[]){this.segments=t}prepareSegment(t,e,r,n){let i=this.segments[this.segments.length-1];return t>To.MAX_VERTEX_ARRAY_LENGTH&&C(`Max vertices per segment is ${To.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${t}`),(!i||i.vertexLength+t>To.MAX_VERTEX_ARRAY_LENGTH||i.sortKey!==n)&&(i={vertexOffset:e.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},void 0!==n&&(i.sortKey=n),this.segments.push(i)),i}get(){return this.segments}destroy(){for(let t of this.segments)for(let e in t.vaos)t.vaos[e].destroy()}static simpleSegment(t,e,r,n){return new To([{vertexOffset:t,primitiveOffset:e,vertexLength:r,primitiveLength:n,vaos:{},sortKey:0}])}}function Ao(t,e){return 256*(t=b(Math.floor(t),0,255))+b(Math.floor(e),0,255)}To.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Si("SegmentVector",To);let ko=Ta([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]);var Mo={exports:{}},So=function(t,e){var r,n,i,a,o,s,l,c;for(n=t.length-(r=3&t.length),i=e,o=3432918353,s=461845907,c=0;c>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<13|i>>>19))+((5*(i>>>16)&65535)<<16)&4294967295))+((58964+(a>>>16)&65535)<<16);switch(l=0,r){case 3:l^=(255&t.charCodeAt(c+2))<<16;case 2:l^=(255&t.charCodeAt(c+1))<<8;case 1:i^=l=(65535&(l=(l=(65535&(l^=255&t.charCodeAt(c)))*o+(((l>>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295}return i^=t.length,i=2246822507*(65535&(i^=i>>>16))+((2246822507*(i>>>16)&65535)<<16)&4294967295,i=3266489909*(65535&(i^=i>>>13))+((3266489909*(i>>>16)&65535)<<16)&4294967295,(i^=i>>>16)>>>0},Eo=function(t,e){for(var r,n=t.length,i=e^n,a=0;n>=4;)r=1540483477*(65535&(r=255&t.charCodeAt(a)|(255&t.charCodeAt(++a))<<8|(255&t.charCodeAt(++a))<<16|(255&t.charCodeAt(++a))<<24))+((1540483477*(r>>>16)&65535)<<16),i=1540483477*(65535&i)+((1540483477*(i>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),n-=4,++a;switch(n){case 3:i^=(255&t.charCodeAt(a+2))<<16;case 2:i^=(255&t.charCodeAt(a+1))<<8;case 1:i=1540483477*(65535&(i^=255&t.charCodeAt(a)))+((1540483477*(i>>>16)&65535)<<16)}return i=1540483477*(65535&(i^=i>>>13))+((1540483477*(i>>>16)&65535)<<16),(i^=i>>>15)>>>0};Mo.exports=So,Mo.exports.murmur3=So,Mo.exports.murmur2=Eo;var Co=n(Mo.exports);class Io{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(t,e,r,n){this.ids.push(Lo(t)),this.positions.push(e,r,n)}getPositions(t){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");let e=Lo(t),r=0,n=this.ids.length-1;for(;r>1;this.ids[t]>=e?n=t:r=t+1}let i=[];for(;this.ids[r]===e;)i.push({index:this.positions[3*r],start:this.positions[3*r+1],end:this.positions[3*r+2]}),r++;return i}static serialize(t,e){let r=new Float64Array(t.ids),n=new Uint32Array(t.positions);return Po(r,n,0,r.length-1),e&&e.push(r.buffer,n.buffer),{ids:r,positions:n}}static deserialize(t){let e=new Io;return e.ids=t.ids,e.positions=t.positions,e.indexed=!0,e}}function Lo(t){let e=+t;return!isNaN(e)&&e<=Number.MAX_SAFE_INTEGER?e:Co(String(t))}function Po(t,e,r,n){for(;r>1],a=r-1,o=n+1;for(;;){do{a++}while(t[a]i);if(a>=o)break;zo(t,a,o),zo(e,3*a,3*o),zo(e,3*a+1,3*o+1),zo(e,3*a+2,3*o+2)}o-r`u_${t}`)),this.type=r}setUniform(t,e,r){t.set(r.constantOr(this.value))}getBinding(t,e,r){return"color"===this.type?new Fo(t,e):new Oo(t,e)}}class Uo{constructor(t,e){this.uniformNames=e.map((t=>`u_${t}`)),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(t,e){this.pixelRatioFrom=e.pixelRatio,this.pixelRatioTo=t.pixelRatio,this.patternFrom=e.tlbr,this.patternTo=t.tlbr}setUniform(t,e,r,n){let i="u_pattern_to"===n?this.patternTo:"u_pattern_from"===n?this.patternFrom:"u_pixel_ratio_to"===n?this.pixelRatioTo:"u_pixel_ratio_from"===n?this.pixelRatioFrom:null;i&&t.set(i)}getBinding(t,e,r){return"u_pattern"===r.substr(0,9)?new Ro(t,e):new Oo(t,e)}}class Vo{constructor(t,e,r,n){this.expression=t,this.type=r,this.maxValue=0,this.paintVertexAttributes=e.map((t=>({name:`a_${t}`,type:"Float32",components:"color"===r?2:1,offset:0}))),this.paintVertexArray=new n}populatePaintArray(t,e,r,n,i){let a=this.paintVertexArray.length,o=this.expression.evaluate(new na(0),e,{},n,[],i);this.paintVertexArray.resize(t),this._setPaintValue(a,t,o)}updatePaintArray(t,e,r,n){let i=this.expression.evaluate({zoom:0},r,n);this._setPaintValue(t,e,i)}_setPaintValue(t,e,r){if("color"===this.type){let n=jo(r);for(let r=t;r`u_${t}_t`)),this.type=r,this.useIntegerZoom=n,this.zoom=i,this.maxValue=0,this.paintVertexAttributes=e.map((t=>({name:`a_${t}`,type:"Float32",components:"color"===r?4:2,offset:0}))),this.paintVertexArray=new a}populatePaintArray(t,e,r,n,i){let a=this.expression.evaluate(new na(this.zoom),e,{},n,[],i),o=this.expression.evaluate(new na(this.zoom+1),e,{},n,[],i),s=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValue(s,t,a,o)}updatePaintArray(t,e,r,n){let i=this.expression.evaluate({zoom:this.zoom},r,n),a=this.expression.evaluate({zoom:this.zoom+1},r,n);this._setPaintValue(t,e,i,a)}_setPaintValue(t,e,r,n){if("color"===this.type){let i=jo(r),a=jo(n);for(let r=t;r`#define HAS_UNIFORM_${t}`)))}return t}getBinderAttributes(){let t=[];for(let e in this.binders){let r=this.binders[e];if(r instanceof Vo||r instanceof qo)for(let e=0;e!0){this.programConfigurations={};for(let n of t)this.programConfigurations[n.id]=new Go(n,e,r);this.needsUpload=!1,this._featureMap=new Io,this._bufferOffset=0}populatePaintArrays(t,e,r,n,i,a){for(let r in this.programConfigurations)this.programConfigurations[r].populatePaintArrays(t,e,n,i,a);void 0!==e.id&&this._featureMap.add(e.id,r,this._bufferOffset,t),this._bufferOffset=t,this.needsUpload=!0}updatePaintArrays(t,e,r,n){for(let i of r)this.needsUpload=this.programConfigurations[i.id].updatePaintArrays(t,this._featureMap,e,i,n)||this.needsUpload}get(t){return this.programConfigurations[t]}upload(t){if(this.needsUpload){for(let e in this.programConfigurations)this.programConfigurations[e].upload(t);this.needsUpload=!1}}destroy(){for(let t in this.programConfigurations)this.programConfigurations[t].destroy()}}function Zo(t,e){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[t]||[t.replace(`${e}-`,"").replace(/-/g,"_")]}function Yo(t,e,r){let n={color:{source:Ia,composite:Za},number:{source:Va,composite:Ia}},i={"line-pattern":{source:po,composite:po},"fill-pattern":{source:po,composite:po},"fill-extrusion-pattern":{source:po,composite:po}}[t];return i&&i[r]||n[e][r]}Si("ConstantBinder",No),Si("CrossFadedConstantBinder",Uo),Si("SourceExpressionBinder",Vo),Si("CrossFadedCompositeBinder",Ho),Si("CompositeExpressionBinder",qo),Si("ProgramConfiguration",Go,{omit:["_buffers"]}),Si("ProgramConfigurationSet",Wo);let Xo,$o,Ko=8192,Jo=Math.pow(2,14)-1,Qo=-Jo-1;function ts(t){let e=Ko/t.extent,r=t.loadGeometry();for(let t=0;tr.x+1||ar.y+1)&&C("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return r}function es(t,e){return{type:t.type,id:t.id,properties:t.properties,geometry:e?ts(t):[]}}function rs(t,e,r,n,i){t.emplaceBack(2*e+(n+1)/2,2*r+(i+1)/2)}class ns{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((t=>t.id)),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new so,this.indexArray=new xo,this.segments=new To,this.programConfigurations=new Wo(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id))}populate(t,e,r){let n=this.layers[0],i=[],a=null,o=!1;"circle"===n.type&&(a=n.layout.get("circle-sort-key"),o=!a.isConstant());for(let{feature:e,id:n,index:s,sourceLayerIndex:l}of t){let t=this.layers[0]._featureFilter.needGeometry,c=es(e,t);if(!this.layers[0]._featureFilter.filter(new na(this.zoom),c,r))continue;let u=o?a.evaluate(c,{},r):void 0,h={id:n,properties:e.properties,type:e.type,sourceLayerIndex:l,index:s,geometry:t?c.geometry:ts(e),patterns:{},sortKey:u};i.push(h)}o&&i.sort(((t,e)=>t.sortKey-e.sortKey));for(let n of i){let{geometry:i,index:a,sourceLayerIndex:o}=n,s=t[a].feature;this.addFeature(n,i,a,r),e.featureIndex.insert(s,i,a,o,this.index)}}update(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,wo),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(t,e,r,n){for(let r of e)for(let e of r){let r=e.x,n=e.y;if(r<0||r>=Ko||n<0||n>=Ko)continue;let i=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),a=i.vertexLength;rs(this.layoutVertexArray,r,n,-1,-1),rs(this.layoutVertexArray,r,n,1,-1),rs(this.layoutVertexArray,r,n,1,1),rs(this.layoutVertexArray,r,n,-1,1),this.indexArray.emplaceBack(a,a+1,a+2),this.indexArray.emplaceBack(a,a+3,a+2),i.vertexLength+=4,i.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{},n)}}function is(t,e){for(let r=0;r1){if(ls(t,e))return!0;for(let n=0;n1?r:r.sub(e)._mult(i)._add(e))}function ps(t,e){let r,n,i,a=!1;for(let o=0;oe.y!=i.y>e.y&&e.x<(i.x-n.x)*(e.y-n.y)/(i.y-n.y)+n.x&&(a=!a)}return a}function fs(t,e){let r=!1;for(let n=0,i=t.length-1;ne.y!=o.y>e.y&&e.x<(o.x-a.x)*(e.y-a.y)/(o.y-a.y)+a.x&&(r=!r)}return r}function ds(t,e,r){let n=r[0],i=r[2];if(t.xi.x&&e.x>i.x||t.yi.y&&e.y>i.y)return!1;let a=I(t,e,r[0]);return a!==I(t,e,r[1])||a!==I(t,e,r[2])||a!==I(t,e,r[3])}function ms(t,e,r){let n=e.paint.get(t).value;return"constant"===n.kind?n.value:r.programConfigurations.get(e.id).getMaxValue(t)}function gs(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function ys(t,e,r,n,i){if(!e[0]&&!e[1])return t;let a=c.convert(e)._mult(i);"viewport"===r&&a._rotate(-n);let o=[];for(let e=0;eSs(t,f)))),p=u?c*o:c;var f;for(let t of n)for(let e of t){let t=u?e:Ss(e,s),r=p,n=ks([],[e.x,e.y,0,1],s);if("viewport"===this.paint.get("circle-pitch-scale")&&"map"===this.paint.get("circle-pitch-alignment")?r*=n[3]/a.cameraToCenterDistance:"map"===this.paint.get("circle-pitch-scale")&&"viewport"===this.paint.get("circle-pitch-alignment")&&(r*=a.cameraToCenterDistance/n[3]),as(h,t,r))return!0}return!1}}function Ss(t,e){let r=ks([],[t.x,t.y,0,1],e);return new c(r[0]/r[3],r[1]/r[3])}class Es extends ns{}let Cs;Si("HeatmapBucket",Es,{omit:["layers"]});var Is={get paint(){return Cs=Cs||new ya({"heatmap-radius":new fa(J.paint_heatmap["heatmap-radius"]),"heatmap-weight":new fa(J.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new pa(J.paint_heatmap["heatmap-intensity"]),"heatmap-color":new ga(J.paint_heatmap["heatmap-color"]),"heatmap-opacity":new pa(J.paint_heatmap["heatmap-opacity"])})}};function Ls(t,{width:e,height:r},n,i){if(i){if(i instanceof Uint8ClampedArray)i=new Uint8Array(i.buffer);else if(i.length!==e*r*n)throw new RangeError(`mismatched image size. expected: ${i.length} but got: ${e*r*n}`)}else i=new Uint8Array(e*r*n);return t.width=e,t.height=r,t.data=i,t}function Ps(t,{width:e,height:r},n){if(e===t.width&&r===t.height)return;let i=Ls({},{width:e,height:r},n);zs(t,i,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,e),height:Math.min(t.height,r)},n),t.width=e,t.height=r,t.data=i.data}function zs(t,e,r,n,i,a){if(0===i.width||0===i.height)return e;if(i.width>t.width||i.height>t.height||r.x>t.width-i.width||r.y>t.height-i.height)throw new RangeError("out of range source coordinates for image copy");if(i.width>e.width||i.height>e.height||n.x>e.width-i.width||n.y>e.height-i.height)throw new RangeError("out of range destination coordinates for image copy");let o=t.data,s=e.data;if(o===s)throw new Error("srcData equals dstData, so image is already copied");for(let l=0;l{e[t.evaluationKey]=a;let o=t.expression.evaluate(e);i.data[r+n+0]=Math.floor(255*o.r/o.a),i.data[r+n+1]=Math.floor(255*o.g/o.a),i.data[r+n+2]=Math.floor(255*o.b/o.a),i.data[r+n+3]=Math.floor(255*o.a)};if(t.clips)for(let e=0,i=0;e80*r){n=1/0,i=1/0;let e=-1/0,o=-1/0;for(let a=r;ae&&(e=r),s>o&&(o=s)}a=Math.max(e-n,o-i),a=0!==a?32767/a:0}return Xs(l,c,r,n,i,a,0),c}function Zs(t,e,r,n,i){let a;if(i===function(t,e,r,n){let i=0;for(let a=e,o=r-n;a0)for(let i=e;i=e;i-=n)a=dl(i/n|0,t[i],t[i+1],a);return a&&ll(a,a.next)&&(ml(a),a=a.next),a}function Ys(t,e){if(!t)return t;e||(e=t);let r,n=t;do{if(r=!1,n.steiner||!ll(n,n.next)&&0!==sl(n.prev,n,n.next))n=n.next;else{if(ml(n),n=e=n.prev,n===n.next)break;r=!0}}while(r||n!==e);return e}function Xs(t,e,r,n,i,a,o){if(!t)return;!o&&a&&function(t,e,r,n){let i=t;do{0===i.z&&(i.z=nl(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){let e,r=1;do{let n,i=t;t=null;let a=null;for(e=0;i;){e++;let o=i,s=0;for(let t=0;t0||l>0&&o;)0!==s&&(0===l||!o||i.z<=o.z)?(n=i,i=i.nextZ,s--):(n=o,o=o.nextZ,l--),a?a.nextZ=n:t=n,n.prevZ=a,a=n;i=o}a.nextZ=null,r*=2}while(e>1)}(i)}(t,n,i,a);let s=t;for(;t.prev!==t.next;){let l=t.prev,c=t.next;if(a?Ks(t,n,i,a):$s(t))e.push(l.i,t.i,c.i),ml(t),t=c.next,s=c.next;else if((t=c)===s){o?1===o?Xs(t=Js(Ys(t),e),e,r,n,i,a,2):2===o&&Qs(t,e,r,n,i,a):Xs(Ys(t),e,r,n,i,a,1);break}}}function $s(t){let e=t.prev,r=t,n=t.next;if(sl(e,r,n)>=0)return!1;let i=e.x,a=r.x,o=n.x,s=e.y,l=r.y,c=n.y,u=ia?i>o?i:o:a>o?a:o,f=s>l?s>c?s:c:l>c?l:c,d=n.next;for(;d!==e;){if(d.x>=u&&d.x<=p&&d.y>=h&&d.y<=f&&al(i,s,a,l,o,c,d.x,d.y)&&sl(d.prev,d,d.next)>=0)return!1;d=d.next}return!0}function Ks(t,e,r,n){let i=t.prev,a=t,o=t.next;if(sl(i,a,o)>=0)return!1;let s=i.x,l=a.x,c=o.x,u=i.y,h=a.y,p=o.y,f=sl?s>c?s:c:l>c?l:c,g=u>h?u>p?u:p:h>p?h:p,y=nl(f,d,e,r,n),v=nl(m,g,e,r,n),x=t.prevZ,_=t.nextZ;for(;x&&x.z>=y&&_&&_.z<=v;){if(x.x>=f&&x.x<=m&&x.y>=d&&x.y<=g&&x!==i&&x!==o&&al(s,u,l,h,c,p,x.x,x.y)&&sl(x.prev,x,x.next)>=0||(x=x.prevZ,_.x>=f&&_.x<=m&&_.y>=d&&_.y<=g&&_!==i&&_!==o&&al(s,u,l,h,c,p,_.x,_.y)&&sl(_.prev,_,_.next)>=0))return!1;_=_.nextZ}for(;x&&x.z>=y;){if(x.x>=f&&x.x<=m&&x.y>=d&&x.y<=g&&x!==i&&x!==o&&al(s,u,l,h,c,p,x.x,x.y)&&sl(x.prev,x,x.next)>=0)return!1;x=x.prevZ}for(;_&&_.z<=v;){if(_.x>=f&&_.x<=m&&_.y>=d&&_.y<=g&&_!==i&&_!==o&&al(s,u,l,h,c,p,_.x,_.y)&&sl(_.prev,_,_.next)>=0)return!1;_=_.nextZ}return!0}function Js(t,e){let r=t;do{let n=r.prev,i=r.next.next;!ll(n,i)&&cl(n,r,r.next,i)&&pl(n,i)&&pl(i,n)&&(e.push(n.i,r.i,i.i),ml(r),ml(r.next),r=t=i),r=r.next}while(r!==t);return Ys(r)}function Qs(t,e,r,n,i,a){let o=t;do{let t=o.next.next;for(;t!==o.prev;){if(o.i!==t.i&&ol(o,t)){let s=fl(o,t);return o=Ys(o,o.next),s=Ys(s,s.next),Xs(o,e,r,n,i,a,0),void Xs(s,e,r,n,i,a,0)}t=t.next}o=o.next}while(o!==t)}function tl(t,e){return t.x-e.x}function el(t,e){let r=function(t,e){let r,n=e,i=t.x,a=t.y,o=-1/0;do{if(a<=n.y&&a>=n.next.y&&n.next.y!==n.y){let t=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(t<=i&&t>o&&(o=t,r=n.x=n.x&&n.x>=l&&i!==n.x&&al(ar.x||n.x===r.x&&rl(r,n)))&&(r=n,u=e)}n=n.next}while(n!==s);return r}(t,e);if(!r)return e;let n=fl(r,t);return Ys(n,n.next),Ys(r,r.next)}function rl(t,e){return sl(t.prev,t,e.prev)<0&&sl(e.next,t,t.next)<0}function nl(t,e,r,n,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-r)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function il(t){let e=t,r=t;do{(e.x=(t-o)*(a-s)&&(t-o)*(n-s)>=(r-o)*(e-s)&&(r-o)*(a-s)>=(i-o)*(n-s)}function ol(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){let r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&cl(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(pl(t,e)&&pl(e,t)&&function(t,e){let r=t,n=!1,i=(t.x+e.x)/2,a=(t.y+e.y)/2;do{r.y>a!=r.next.y>a&&r.next.y!==r.y&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}(t,e)&&(sl(t.prev,t,e.prev)||sl(t,e.prev,e))||ll(t,e)&&sl(t.prev,t,t.next)>0&&sl(e.prev,e,e.next)>0)}function sl(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function ll(t,e){return t.x===e.x&&t.y===e.y}function cl(t,e,r,n){let i=hl(sl(t,e,r)),a=hl(sl(t,e,n)),o=hl(sl(r,n,t)),s=hl(sl(r,n,e));return i!==a&&o!==s||!(0!==i||!ul(t,r,e))||!(0!==a||!ul(t,n,e))||!(0!==o||!ul(r,t,n))||!(0!==s||!ul(r,e,n))}function ul(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function hl(t){return t>0?1:t<0?-1:0}function pl(t,e){return sl(t.prev,t,t.next)<0?sl(t,e,t.next)>=0&&sl(t,t.prev,e)>=0:sl(t,e,t.prev)<0||sl(t,t.next,e)<0}function fl(t,e){let r=gl(t.i,t.x,t.y),n=gl(e.i,e.x,e.y),i=t.next,a=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function dl(t,e,r,n){let i=gl(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function ml(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function gl(t,e,r){return{i:t,x:e,y:r,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function yl(t,e,r){let n=r.patternDependencies,i=!1;for(let r of e){let e=r.paint.get(`${t}-pattern`);e.isConstant()||(i=!0);let a=e.constantOr(null);a&&(i=!0,n[a.to]=!0,n[a.from]=!0)}return i}function vl(t,e,r,n,i){let a=i.patternDependencies;for(let o of e){let e=o.paint.get(`${t}-pattern`).value;if("constant"!==e.kind){let t=e.evaluate({zoom:n-1},r,{},i.availableImages),s=e.evaluate({zoom:n},r,{},i.availableImages),l=e.evaluate({zoom:n+1},r,{},i.availableImages);t=t&&t.name?t.name:t,s=s&&s.name?s.name:s,l=l&&l.name?l.name:l,a[t]=!0,a[s]=!0,a[l]=!0,r.patterns[o.id]={min:t,mid:s,max:l}}}return r}class xl{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((t=>t.id)),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new lo,this.indexArray=new xo,this.indexArray2=new _o,this.programConfigurations=new Wo(t.layers,t.zoom),this.segments=new To,this.segments2=new To,this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id))}populate(t,e,r){this.hasPattern=yl("fill",this.layers,e);let n=this.layers[0].layout.get("fill-sort-key"),i=!n.isConstant(),a=[];for(let{feature:o,id:s,index:l,sourceLayerIndex:c}of t){let t=this.layers[0]._featureFilter.needGeometry,u=es(o,t);if(!this.layers[0]._featureFilter.filter(new na(this.zoom),u,r))continue;let h=i?n.evaluate(u,{},r,e.availableImages):void 0,p={id:s,properties:o.properties,type:o.type,sourceLayerIndex:c,index:l,geometry:t?u.geometry:ts(o),patterns:{},sortKey:h};a.push(p)}i&&a.sort(((t,e)=>t.sortKey-e.sortKey));for(let n of a){let{geometry:i,index:a,sourceLayerIndex:o}=n;if(this.hasPattern){let t=vl("fill",this.layers,n,this.zoom,e);this.patternFeatures.push(t)}else this.addFeature(n,i,a,r,{});e.featureIndex.insert(t[a].feature,i,a,o,this.index)}}update(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)}addFeatures(t,e,r){for(let t of this.patternFeatures)this.addFeature(t,t.geometry,t.index,e,r)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Gs),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(t,e,r,n,i){for(let t of Ar(e,500)){let e=0;for(let r of t)e+=r.length;let r=this.segments.prepareSegment(e,this.layoutVertexArray,this.indexArray),n=r.vertexLength,i=[],a=[];for(let e of t){if(0===e.length)continue;e!==t[0]&&a.push(i.length/2);let r=this.segments2.prepareSegment(e.length,this.layoutVertexArray,this.indexArray2),n=r.vertexLength;this.layoutVertexArray.emplaceBack(e[0].x,e[0].y),this.indexArray2.emplaceBack(n+e.length-1,n),i.push(e[0].x),i.push(e[0].y);for(let t=1;t>3}if(i--,1===n||2===n)a+=t.readSVarint(),o+=t.readSVarint(),1===n&&(e&&s.push(e),e=[]),e.push(new Ml(a,o));else{if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone())}}return e&&s.push(e),s},El.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,n=0,i=0,a=0,o=1/0,s=-1/0,l=1/0,c=-1/0;t.pos>3}if(n--,1===r||2===r)(i+=t.readSVarint())s&&(s=i),(a+=t.readSVarint())c&&(c=a);else if(7!==r)throw new Error("unknown command "+r)}return[o,l,s,c]},El.prototype.toGeoJSON=function(t,e,r){var n,i,a=this.extent*Math.pow(2,r),o=this.extent*t,s=this.extent*e,l=this.loadGeometry(),c=El.types[this.type];function u(t){for(var e=0;e>3;e=1===n?t.readString():2===n?t.readFloat():3===n?t.readDouble():4===n?t.readVarint64():5===n?t.readVarint():6===n?t.readSVarint():7===n?t.readBoolean():null}return e}(r))}zl.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new Ll(this._pbf,e,this.extent,this._keys,this._values)};var Ol=Pl;function Rl(t,e,r){if(3===t){var n=new Ol(r,r.readVarint()+r.pos);n.length&&(e[n.name]=n)}}kl.VectorTile=function(t,e){this.layers=t.readFields(Rl,{},e)},kl.VectorTileFeature=Sl,kl.VectorTileLayer=Pl;let Fl,Bl=kl.VectorTileFeature.types,jl=Math.pow(2,13);function Nl(t,e,r,n,i,a,o,s){t.emplaceBack(e,r,2*Math.floor(n*jl)+o,i*jl*2,a*jl*2,Math.round(s))}class Ul{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((t=>t.id)),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new co,this.centroidVertexArray=new oo,this.indexArray=new xo,this.programConfigurations=new Wo(t.layers,t.zoom),this.segments=new To,this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id))}populate(t,e,r){this.features=[],this.hasPattern=yl("fill-extrusion",this.layers,e);for(let{feature:n,id:i,index:a,sourceLayerIndex:o}of t){let t=this.layers[0]._featureFilter.needGeometry,s=es(n,t);if(!this.layers[0]._featureFilter.filter(new na(this.zoom),s,r))continue;let l={id:i,sourceLayerIndex:o,index:a,geometry:t?s.geometry:ts(n),properties:n.properties,type:n.type,patterns:{}};this.hasPattern?this.features.push(vl("fill-extrusion",this.layers,l,this.zoom,e)):this.addFeature(l,l.geometry,a,r,{}),e.featureIndex.insert(n,l.geometry,a,o,this.index,!0)}}addFeatures(t,e,r){for(let t of this.features){let{geometry:n}=t;this.addFeature(t,n,t.index,e,r)}}update(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.centroidVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Al),this.centroidVertexBuffer=t.createVertexBuffer(this.centroidVertexArray,Tl.members,!0),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(t,e,r,n,i){for(let r of Ar(e,500)){let e={x:0,y:0,vertexCount:0},n=0;for(let t of r)n+=t.length;let i=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(let t of r){if(0===t.length||ql(t))continue;let r=0;for(let n=0;n=1){let o=t[n-1];if(!Vl(a,o)){i.vertexLength+4>To.MAX_VERTEX_ARRAY_LENGTH&&(i=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));let t=a.sub(o)._perp()._unit(),n=o.dist(a);r+n>32768&&(r=0),Nl(this.layoutVertexArray,a.x,a.y,t.x,t.y,0,0,r),Nl(this.layoutVertexArray,a.x,a.y,t.x,t.y,0,1,r),e.x+=2*a.x,e.y+=2*a.y,e.vertexCount+=2,r+=n,Nl(this.layoutVertexArray,o.x,o.y,t.x,t.y,0,0,r),Nl(this.layoutVertexArray,o.x,o.y,t.x,t.y,0,1,r),e.x+=2*o.x,e.y+=2*o.y,e.vertexCount+=2;let s=i.vertexLength;this.indexArray.emplaceBack(s,s+2,s+1),this.indexArray.emplaceBack(s+1,s+2,s+3),i.vertexLength+=4,i.primitiveLength+=2}}}}if(i.vertexLength+n>To.MAX_VERTEX_ARRAY_LENGTH&&(i=this.segments.prepareSegment(n,this.layoutVertexArray,this.indexArray)),"Polygon"!==Bl[t.type])continue;let a=[],o=[],s=i.vertexLength;for(let t of r)if(0!==t.length){t!==r[0]&&o.push(a.length/2);for(let r=0;rKo)||t.y===e.y&&(t.y<0||t.y>Ko)}function ql(t){return t.every((t=>t.x<0))||t.every((t=>t.x>Ko))||t.every((t=>t.y<0))||t.every((t=>t.y>Ko))}Si("FillExtrusionBucket",Ul,{omit:["layers","features"]});var Hl={get paint(){return Fl=Fl||new ya({"fill-extrusion-opacity":new pa(J["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new fa(J["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new pa(J["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new pa(J["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new da(J["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new fa(J["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new fa(J["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new pa(J["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class Gl extends xa{constructor(t){super(t,Hl)}createBucket(t){return new Ul(t)}queryRadius(){return gs(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(t,e,r,n,i,a,o,s){let l=ys(t,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),a.angle,o),u=this.paint.get("fill-extrusion-height").evaluate(e,r),h=this.paint.get("fill-extrusion-base").evaluate(e,r),p=function(t,e){let r=[];for(let n of t){let t=[n.x,n.y,0,1];ks(t,t,e),r.push(new c(t[0]/t[3],t[1]/t[3]))}return r}(l,s),f=function(t,e,r,n){let i=[],a=[],o=n[8]*e,s=n[9]*e,l=n[10]*e,u=n[11]*e,h=n[8]*r,p=n[9]*r,f=n[10]*r,d=n[11]*r;for(let e of t){let t=[],r=[];for(let i of e){let e=i.x,a=i.y,m=n[0]*e+n[4]*a+n[12],g=n[1]*e+n[5]*a+n[13],y=n[2]*e+n[6]*a+n[14],v=n[3]*e+n[7]*a+n[15],x=y+l,_=v+u,b=m+h,w=g+p,T=y+f,A=v+d,k=new c((m+o)/_,(g+s)/_);k.z=x/_,t.push(k);let M=new c(b/A,w/A);M.z=T/A,r.push(M)}i.push(t),a.push(r)}return[i,a]}(n,h,u,s);return function(t,e,r){let n=1/0;os(r,e)&&(n=Zl(r,e[0]));for(let i=0;it.id)),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach((t=>{this.gradients[t.id]={}})),this.layoutVertexArray=new uo,this.layoutVertexArray2=new ho,this.indexArray=new xo,this.programConfigurations=new Wo(t.layers,t.zoom),this.segments=new To,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id))}populate(t,e,r){this.hasPattern=yl("line",this.layers,e);let n=this.layers[0].layout.get("line-sort-key"),i=!n.isConstant(),a=[];for(let{feature:e,id:o,index:s,sourceLayerIndex:l}of t){let t=this.layers[0]._featureFilter.needGeometry,c=es(e,t);if(!this.layers[0]._featureFilter.filter(new na(this.zoom),c,r))continue;let u=i?n.evaluate(c,{},r):void 0,h={id:o,properties:e.properties,type:e.type,sourceLayerIndex:l,index:s,geometry:t?c.geometry:ts(e),patterns:{},sortKey:u};a.push(h)}i&&a.sort(((t,e)=>t.sortKey-e.sortKey));for(let n of a){let{geometry:i,index:a,sourceLayerIndex:o}=n;if(this.hasPattern){let t=vl("line",this.layers,n,this.zoom,e);this.patternFeatures.push(t)}else this.addFeature(n,i,a,r,{});e.featureIndex.insert(t[a].feature,i,a,o,this.index)}}update(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)}addFeatures(t,e,r){for(let t of this.patternFeatures)this.addFeature(t,t.geometry,t.index,e,r)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=t.createVertexBuffer(this.layoutVertexArray2,Ql)),this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Kl),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(t){if(t.properties&&Object.prototype.hasOwnProperty.call(t.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(t.properties,"mapbox_clip_end"))return{start:+t.properties.mapbox_clip_start,end:+t.properties.mapbox_clip_end}}addFeature(t,e,r,n,i){let a=this.layers[0].layout,o=a.get("line-join").evaluate(t,{}),s=a.get("line-cap"),l=a.get("line-miter-limit"),c=a.get("line-round-limit");this.lineClips=this.lineFeatureClips(t);for(let r of e)this.addLine(r,t,o,s,l,c);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,i,n)}addLine(t,e,r,n,i,a){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let e=0;e=2&&t[s-1].equals(t[s-2]);)s--;let l=0;for(;l0;if(b&&e>l){let t=c.dist(u);if(t>2*d){let e=c.sub(c.sub(u)._mult(d/t)._round());this.updateDistance(u,e),this.addCurrentVertex(e,p,0,0,m),u=e}}let T=u&&h,A=T?r:o?"butt":n;if(T&&"round"===A&&(xi&&(A="bevel"),"bevel"===A&&(x>2&&(A="flipbevel"),x100)g=f.mult(-1);else{let t=x*p.add(f).mag()/p.sub(f).mag();g._perp()._mult(t*(w?-1:1))}this.addCurrentVertex(c,g,0,0,m),this.addCurrentVertex(c,g.mult(-1),0,0,m)}else if("bevel"===A||"fakeround"===A){let t=-Math.sqrt(x*x-1),e=w?t:0,r=w?0:t;if(u&&this.addCurrentVertex(c,p,e,r,m),"fakeround"===A){let t=Math.round(180*_/Math.PI/20);for(let e=1;e2*d){let e=c.add(h.sub(c)._mult(d/t)._round());this.updateDistance(c,e),this.addCurrentVertex(e,f,0,0,m),c=e}}}}addCurrentVertex(t,e,r,n,i,a=!1){let o=e.y*n-e.x,s=-e.y-e.x*n;this.addHalfVertex(t,e.x+e.y*r,e.y-e.x*r,a,!1,r,i),this.addHalfVertex(t,o,s,a,!0,-n,i),this.distance>rc/2&&0===this.totalDistance&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(t,e,r,n,i,a))}addHalfVertex({x:t,y:e},r,n,i,a,o,s){let l=.5*(this.lineClips?this.scaledDistance*(rc-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((t<<1)+(i?1:0),(e<<1)+(a?1:0),Math.round(63*r)+128,Math.round(63*n)+128,1+(0===o?0:o<0?-1:1)|(63&l)<<2,l>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);let c=s.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,c),s.primitiveLength++),a?this.e2=c:this.e1=c}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(t,e){this.distance+=t.dist(e),this.updateScaledDistance()}}Si("LineBucket",nc,{omit:["layers","patternFeatures"]});var ic={get paint(){return Xl=Xl||new ya({"line-opacity":new fa(J.paint_line["line-opacity"]),"line-color":new fa(J.paint_line["line-color"]),"line-translate":new pa(J.paint_line["line-translate"]),"line-translate-anchor":new pa(J.paint_line["line-translate-anchor"]),"line-width":new fa(J.paint_line["line-width"]),"line-gap-width":new fa(J.paint_line["line-gap-width"]),"line-offset":new fa(J.paint_line["line-offset"]),"line-blur":new fa(J.paint_line["line-blur"]),"line-dasharray":new ma(J.paint_line["line-dasharray"]),"line-pattern":new da(J.paint_line["line-pattern"]),"line-gradient":new ga(J.paint_line["line-gradient"])})},get layout(){return Yl=Yl||new ya({"line-cap":new pa(J.layout_line["line-cap"]),"line-join":new fa(J.layout_line["line-join"]),"line-miter-limit":new pa(J.layout_line["line-miter-limit"]),"line-round-limit":new pa(J.layout_line["line-round-limit"]),"line-sort-key":new fa(J.layout_line["line-sort-key"])})}};class ac extends fa{possiblyEvaluate(t,e){return e=new na(Math.floor(e.zoom),{now:e.now,fadeDuration:e.fadeDuration,zoomHistory:e.zoomHistory,transition:e.transition}),super.possiblyEvaluate(t,e)}evaluate(t,e,r,n){return e=T({},e,{zoom:Math.floor(e.zoom)}),super.evaluate(t,e,r,n)}}let oc;class sc extends xa{constructor(t){super(t,ic),this.gradientVersion=0,oc||(oc=new ac(ic.paint.properties["line-width"].specification),oc.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(t){if("line-gradient"===t){let t=this.gradientExpression();this.stepInterpolant=!(void 0===t._styleExpression)&&t._styleExpression.expression instanceof Ce,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(t,e){super.recalculate(t,e),this.paint._values["line-floorwidth"]=oc.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,t)}createBucket(t){return new nc(t)}queryRadius(t){let e=t,r=lc(ms("line-width",this,e),ms("line-gap-width",this,e)),n=ms("line-offset",this,e);return r/2+Math.abs(n)+gs(this.paint.get("line-translate"))}queryIntersectsFeature(t,e,r,n,i,a,o){let s=ys(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),a.angle,o),l=o/2*lc(this.paint.get("line-width").evaluate(e,r),this.paint.get("line-gap-width").evaluate(e,r)),u=this.paint.get("line-offset").evaluate(e,r);return u&&(n=function(t,e){let r=[];for(let n=0;n=3)for(let e=0;e0?e+2*t:t}let cc=Ta([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),uc=Ta([{name:"a_projected_pos",components:3,type:"Float32"}],4);Ta([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);let hc=Ta([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);Ta([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);let pc=Ta([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),fc=Ta([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function dc(t,e,r){return t.sections.forEach((t=>{t.text=function(t,e,r){let n=e.layout.get("text-transform").evaluate(r,{});return"uppercase"===n?t=t.toLocaleUpperCase():"lowercase"===n&&(t=t.toLocaleLowerCase()),ra.applyArabicShaping&&(t=ra.applyArabicShaping(t)),t}(t.text,e,r)})),t}Ta([{name:"triangle",components:3,type:"Uint16"}]),Ta([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),Ta([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",name:"collisionCircleDiameter"},{type:"Uint16",name:"textAnchorOffsetStartIndex"},{type:"Uint16",name:"textAnchorOffsetEndIndex"}]),Ta([{type:"Float32",name:"offsetX"}]),Ta([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),Ta([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);let mc={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};var gc=24,yc=_c,vc=function(t,e,r,n,i){var a,o,s=8*i-n-1,l=(1<>1,u=-7,h=r?i-1:0,p=r?-1:1,f=t[e+h];for(h+=p,a=f&(1<<-u)-1,f>>=-u,u+=s;u>0;a=256*a+t[e+h],h+=p,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=n;u>0;o=256*o+t[e+h],h+=p,u-=8);if(0===a)a=1-c;else{if(a===l)return o?NaN:1/0*(f?-1:1);o+=Math.pow(2,n),a-=c}return(f?-1:1)*o*Math.pow(2,a-n)},xc=function(t,e,r,n,i,a){var o,s,l,c=8*a-i-1,u=(1<>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:a-1,d=n?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=u):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),(e+=o+h>=1?p/l:p*Math.pow(2,1-h))*l>=2&&(o++,l/=2),o+h>=u?(s=0,o=u):o+h>=1?(s=(e*l-1)*Math.pow(2,i),o+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;t[r+f]=255&s,f+=d,s/=256,i-=8);for(o=o<0;t[r+f]=255&o,f+=d,o/=256,c-=8);t[r+f-d]|=128*m};function _c(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}_c.Varint=0,_c.Fixed64=1,_c.Bytes=2,_c.Fixed32=5;var bc=4294967296,wc=1/bc,Tc=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");function Ac(t){return t.type===_c.Bytes?t.readVarint()+t.pos:t.pos+1}function kc(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i]}function Mc(t,e){for(var r=0;r>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function Fc(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}_c.prototype={destroy:function(){this.buf=null},readFields:function(t,e,r){for(r=r||this.length;this.pos>3,a=this.pos;this.type=7&n,t(i,e,this),this.pos===a&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=Oc(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=Fc(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=Oc(this.buf,this.pos)+Oc(this.buf,this.pos+4)*bc;return this.pos+=8,t},readSFixed64:function(){var t=Oc(this.buf,this.pos)+Fc(this.buf,this.pos+4)*bc;return this.pos+=8,t},readFloat:function(){var t=vc(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=vc(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,r,n=this.buf;return e=127&(r=n[this.pos++]),r<128?e:(e|=(127&(r=n[this.pos++]))<<7,r<128?e:(e|=(127&(r=n[this.pos++]))<<14,r<128?e:(e|=(127&(r=n[this.pos++]))<<21,r<128?e:function(t,e,r){var n,i,a=r.buf;if(n=(112&(i=a[r.pos++]))>>4,i<128||(n|=(127&(i=a[r.pos++]))<<3,i<128)||(n|=(127&(i=a[r.pos++]))<<10,i<128)||(n|=(127&(i=a[r.pos++]))<<17,i<128)||(n|=(127&(i=a[r.pos++]))<<24,i<128)||(n|=(1&(i=a[r.pos++]))<<31,i<128))return function(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}(t,n,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=n[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var t,e,r,n=this.readVarint()+this.pos,i=this.pos;return this.pos=n,n-i>=12&&Tc?(t=this.buf,e=i,r=n,Tc.decode(t.subarray(e,r))):function(t,e,r){for(var n="",i=e;i239?4:l>223?3:l>191?2:1;if(i+u>r)break;1===u?l<128&&(c=l):2===u?128==(192&(a=t[i+1]))&&(c=(31&l)<<6|63&a)<=127&&(c=null):3===u?(o=t[i+2],128==(192&(a=t[i+1]))&&128==(192&o)&&((c=(15&l)<<12|(63&a)<<6|63&o)<=2047||c>=55296&&c<=57343)&&(c=null)):4===u&&(o=t[i+2],s=t[i+3],128==(192&(a=t[i+1]))&&128==(192&o)&&128==(192&s)&&((c=(15&l)<<18|(63&a)<<12|(63&o)<<6|63&s)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,u=1):c>65535&&(c-=65536,n+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),n+=String.fromCharCode(c),i+=u}return n}(this.buf,i,n)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==_c.Bytes)return t.push(this.readVarint(e));var r=Ac(this);for(t=t||[];this.pos127;);else if(e===_c.Bytes)this.pos=this.readVarint()+this.pos;else if(e===_c.Fixed32)this.pos+=4;else{if(e!==_c.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e268435455||t<0?function(t,e){var r,n,i,a;if(t>=0?(r=t%4294967296|0,n=t/4294967296|0):(n=~(-t/4294967296),4294967295^(r=~(-t%4294967296))?r=r+1|0:(r=0,n=n+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),i=r,(a=e).buf[a.pos++]=127&i|128,i>>>=7,a.buf[a.pos++]=127&i|128,i>>>=7,a.buf[a.pos++]=127&i|128,i>>>=7,a.buf[a.pos++]=127&i|128,a.buf[a.pos]=127&(i>>>=7),function(t,e){var r=(7&t)<<4;e.buf[e.pos++]|=r|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t)))))}(n,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(!!t)},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,r){for(var n,i,a=0;a55295&&n<57344){if(!i){n>56319||a+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):i=n;continue}if(n<56320){t[r++]=239,t[r++]=191,t[r++]=189,i=n;continue}n=i-55296<<10|n-56320|65536,i=null}else i&&(t[r++]=239,t[r++]=191,t[r++]=189,i=null);n<128?t[r++]=n:(n<2048?t[r++]=n>>6|192:(n<65536?t[r++]=n>>12|224:(t[r++]=n>>18|240,t[r++]=n>>12&63|128),t[r++]=n>>6&63|128),t[r++]=63&n|128)}return r}(this.buf,t,this.pos);var r=this.pos-e;r>=128&&kc(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),xc(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),xc(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r=128&&kc(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,_c.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,Mc,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,Sc,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,Ic,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,Ec,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,Cc,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,Lc,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,Pc,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,zc,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,Dc,e)},writeBytesField:function(t,e){this.writeTag(t,_c.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,_c.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,_c.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,_c.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,_c.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,_c.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,_c.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,_c.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,_c.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,_c.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,!!e)}};var Bc,jc=n(yc);function Nc(t,e,r){1===t&&r.readMessage(Uc,e)}function Uc(t,e,r){if(3===t){let{id:t,bitmap:n,width:i,height:a,left:o,top:s,advance:l}=r.readMessage(Vc,{});e.push({id:t,bitmap:new Ds({width:i+6,height:a+6},n),metrics:{width:i,height:a,left:o,top:s,advance:l}})}}function Vc(t,e,r){1===t?e.id=r.readVarint():2===t?e.bitmap=r.readBytes():3===t?e.width=r.readVarint():4===t?e.height=r.readVarint():5===t?e.left=r.readSVarint():6===t?e.top=r.readSVarint():7===t&&(e.advance=r.readVarint())}function qc(t){let e=0,r=0;for(let n of t)e+=n.w*n.h,r=Math.max(r,n.w);t.sort(((t,e)=>e.h-t.h));let n=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),r),h:1/0}],i=0,a=0;for(let e of t)for(let t=n.length-1;t>=0;t--){let r=n[t];if(!(e.w>r.w||e.h>r.h)){if(e.x=r.x,e.y=r.y,a=Math.max(a,e.y+e.h),i=Math.max(i,e.x+e.w),e.w===r.w&&e.h===r.h){let e=n.pop();t=0&&r>=t&&$c[this.text.charCodeAt(r)];r--)e--;this.text=this.text.substring(t,e),this.sectionIndex=this.sectionIndex.slice(t,e)}substring(t,e){let r=new Yc;return r.text=this.text.substring(t,e),r.sectionIndex=this.sectionIndex.slice(t,e),r.sections=this.sections,r}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce(((t,e)=>Math.max(t,this.sections[e].scale)),0)}addTextSection(t,e){this.text+=t.text,this.sections.push(Zc.forText(t.scale,t.fontStack||e));let r=this.sections.length-1;for(let e=0;e=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function Xc(e,r,n,i,a,o,s,l,c,u,h,p,f,d,m){let g,y=Yc.fromFeature(e,a);p===t.ah.vertical&&y.verticalizePunctuation();let{processBidirectionalText:v,processStyledBidirectionalText:x}=ra;if(v&&1===y.sections.length){g=[];let t=v(y.toString(),iu(y,u,o,r,i,d));for(let e of t){let t=new Yc;t.text=e,t.sections=y.sections;for(let r=0;r0&&n>w&&(w=n)}else{let t=n[m.fontStack],e=t&&t[y];if(e&&e.rect)T=e.rect,_=e.metrics;else{let t=r[m.fontStack],e=t&&t[y];if(!e)continue;_=e.metrics}v=(a-m.scale)*gc}M?(e.verticalizable=!0,b.push({glyph:y,imageName:A,x:f,y:d+v,vertical:M,scale:m.scale,fontStack:m.fontStack,sectionIndex:g,metrics:_,rect:T}),f+=k*m.scale+u):(b.push({glyph:y,imageName:A,x:f,y:d+v,vertical:M,scale:m.scale,fontStack:m.fontStack,sectionIndex:g,metrics:_,rect:T}),f+=_.advance*m.scale+u)}0!==b.length&&(m=Math.max(f-u,m),ou(b,0,b.length-1,y,w)),f=0;let T=o*a+w;_.lineOffset=Math.max(w,l),d+=T,g=Math.max(T,g),++v}var x;let _=d-Wc,{horizontalAlign:b,verticalAlign:w}=au(s);(function(t,e,r,n,i,a,o,s,l){let c=(e-r)*i,u=0;u=a!==o?-s*n-Wc:(-n*l+.5)*o;for(let e of t)for(let t of e.positionedGlyphs)t.x+=c,t.y+=u})(e.positionedLines,y,b,w,m,g,o,_,a.length),e.top+=-w*_,e.bottom=e.top+_,e.left+=-b*m,e.right=e.left+m}(b,r,n,i,g,s,l,c,p,u,f,m),!function(t){for(let e of t)if(0!==e.positionedGlyphs.length)return!1;return!0}(_)&&b}let $c={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Kc={10:!0,32:!0,38:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0},Jc={40:!0};function Qc(t,e,r,n,i,a){if(e.imageName){let t=n[e.imageName];return t?t.displaySize[0]*e.scale*gc/a+i:0}{let n=r[e.fontStack],a=n&&n[t];return a?a.metrics.advance*e.scale+i:0}}function tu(t,e,r,n){let i=Math.pow(t-e,2);return n?t=0,c=0;for(let r=0;rc){let t=Math.ceil(a/c);i*=t/o,o=t}return{x1:n,y1:i,x2:n+a,y2:i+o}}function cu(t,e,r,n,i,a){let o,s=t.image;if(s.content){let t=s.content,e=s.pixelRatio||1;o=[t[0]/e,t[1]/e,s.displaySize[0]-t[2]/e,s.displaySize[1]-t[3]/e]}let l,c,u,h,p=e.left*a,f=e.right*a;"width"===r||"both"===r?(h=i[0]+p-n[3],c=i[0]+f+n[1]):(h=i[0]+(p+f-s.displaySize[0])/2,c=h+s.displaySize[0]);let d=e.top*a,m=e.bottom*a;return"height"===r||"both"===r?(l=i[1]+d-n[0],u=i[1]+m+n[2]):(l=i[1]+(d+m-s.displaySize[1])/2,u=l+s.displaySize[1]),{image:s,top:l,right:c,bottom:u,left:h,collisionPadding:o}}let uu=128,hu=32640;function pu(t,e){let{expression:r}=e;if("constant"===r.kind)return{kind:"constant",layoutSize:r.evaluate(new na(t+1))};if("source"===r.kind)return{kind:"source"};{let{zoomStops:e,interpolationType:n}=r,i=0;for(;it.id)),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=bs([]),this.placementViewportMatrix=bs([]);let r=this.layers[0]._unevaluatedLayout._values;this.textSizeData=pu(this.zoom,r["text-size"]),this.iconSizeData=pu(this.zoom,r["icon-size"]);let n=this.layers[0].layout,i=n.get("symbol-sort-key"),a=n.get("symbol-z-order");this.canOverlap="never"!==fu(n,"text-overlap","text-allow-overlap")||"never"!==fu(n,"icon-overlap","icon-allow-overlap")||n.get("text-ignore-placement")||n.get("icon-ignore-placement"),this.sortFeaturesByKey="viewport-y"!==a&&!i.isConstant(),this.sortFeaturesByY=("viewport-y"===a||"auto"===a&&!this.sortFeaturesByKey)&&this.canOverlap,"point"===n.get("symbol-placement")&&(this.writingModes=n.get("text-writing-mode").map((e=>t.ah[e]))),this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id)),this.sourceID=e.sourceID}createArrays(){this.text=new bu(new Wo(this.layers,this.zoom,(t=>/^text/.test(t)))),this.icon=new bu(new Wo(this.layers,this.zoom,(t=>/^icon/.test(t)))),this.glyphOffsetArray=new to,this.lineVertexArray=new eo,this.symbolInstances=new Qa,this.textAnchorOffsets=new no}calculateGlyphDependencies(t,e,r,n,i){for(let a=0;a0)&&("constant"!==o.value.kind||o.value.value.length>0),u="constant"!==l.value.kind||!!l.value.value||Object.keys(l.parameters).length>0,h=a.get("symbol-sort-key");if(this.features=[],!c&&!u)return;let p=r.iconDependencies,f=r.glyphDependencies,d=r.availableImages,m=new na(this.zoom);for(let{feature:r,id:s,index:l,sourceLayerIndex:g}of e){let e,y,v=i._featureFilter.needGeometry,x=es(r,v);if(!i._featureFilter.filter(m,x,n))continue;if(v||(x.geometry=ts(r)),c){let t=i.getValueAndResolveTokens("text-field",x,n,d),r=re.factory(t),a=this.hasRTLText=this.hasRTLText||_u(r);(!a||"unavailable"===ra.getRTLTextPluginStatus()||a&&ra.isParsed())&&(e=dc(r,i,x))}if(u){let t=i.getValueAndResolveTokens("icon-image",x,n,d);y=t instanceof oe?t:oe.fromString(t)}if(!e&&!y)continue;let _=this.sortFeaturesByKey?h.evaluate(x,{},n):void 0;if(this.features.push({id:s,text:e,icon:y,index:l,sourceLayerIndex:g,geometry:x.geometry,properties:r.properties,type:gu[r.type],sortKey:_}),y&&(p[y.name]=!0),e){let r=o.evaluate(x,{},n).join(","),i="viewport"!==a.get("text-rotation-alignment")&&"point"!==a.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(t.ah.vertical)>=0;for(let t of e.sections)if(t.image)p[t.image.name]=!0;else{let n=Hi(e.toString()),a=t.fontStack||r,o=f[a]=f[a]||{};this.calculateGlyphDependencies(t.text,o,i,this.allowVerticalPlacement,n)}}}"line"===a.get("symbol-placement")&&(this.features=function(t){let e={},r={},n=[],i=0;function a(e){n.push(t[e]),i++}function o(t,e,i){let a=r[t];return delete r[t],r[e]=a,n[a].geometry[0].pop(),n[a].geometry[0]=n[a].geometry[0].concat(i[0]),a}function s(t,r,i){let a=e[r];return delete e[r],e[t]=a,n[a].geometry[0].shift(),n[a].geometry[0]=i[0].concat(n[a].geometry[0]),a}function l(t,e,r){let n=r?e[0][e[0].length-1]:e[0][0];return`${t}:${n.x}:${n.y}`}for(let c=0;ct.geometry))}(this.features)),this.sortFeaturesByKey&&this.features.sort(((t,e)=>t.sortKey-e.sortKey))}update(t,e,r){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,e,this.layers,r),this.icon.programConfigurations.updatePaintArrays(t,e,this.layers,r))}isEmpty(){return 0===this.symbolInstances.length&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(t){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(t),this.iconCollisionBox.upload(t)),this.text.upload(t,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(t,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(t,e){let r=this.lineVertexArray.length;if(void 0!==t.segment){let r=t.dist(e[t.segment+1]),n=t.dist(e[t.segment]),i={};for(let n=t.segment+1;n=0;r--)i[r]={x:e[r].x,y:e[r].y,tileUnitDistanceFromAnchor:n},r>0&&(n+=e[r-1].dist(e[r]));for(let t=0;t0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(t,e){let r=t.placedSymbolArray.get(e),n=r.vertexStartIndex+4*r.numGlyphs;for(let e=r.vertexStartIndex;en[t]-n[e]||i[e]-i[t])),a}addToSortKeyRanges(t,e){let r=this.sortKeyRanges[this.sortKeyRanges.length-1];r&&r.sortKey===e?r.symbolInstanceEnd=t+1:this.sortKeyRanges.push({sortKey:e,symbolInstanceStart:t,symbolInstanceEnd:t+1})}sortFeatures(t){if(this.sortFeaturesByY&&this.sortedAngle!==t&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(let t of this.symbolInstanceIndexes){let e=this.symbolInstances.get(t);this.featureSortOrder.push(e.featureIndex),[e.rightJustifiedTextSymbolIndex,e.centerJustifiedTextSymbolIndex,e.leftJustifiedTextSymbolIndex].forEach(((t,e,r)=>{t>=0&&r.indexOf(t)===e&&this.addIndicesForPlacedSymbol(this.text,t)})),e.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,e.verticalPlacedTextSymbolIndex),e.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,e.placedIconSymbolIndex),e.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,e.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}Si("SymbolBucket",Tu,{omit:["layers","collisionBoxArray","features","compareText"]}),Tu.MAX_GLYPHS=65535,Tu.addDynamicAttributes=xu;var Au={get paint(){return mu=mu||new ya({"icon-opacity":new fa(J.paint_symbol["icon-opacity"]),"icon-color":new fa(J.paint_symbol["icon-color"]),"icon-halo-color":new fa(J.paint_symbol["icon-halo-color"]),"icon-halo-width":new fa(J.paint_symbol["icon-halo-width"]),"icon-halo-blur":new fa(J.paint_symbol["icon-halo-blur"]),"icon-translate":new pa(J.paint_symbol["icon-translate"]),"icon-translate-anchor":new pa(J.paint_symbol["icon-translate-anchor"]),"text-opacity":new fa(J.paint_symbol["text-opacity"]),"text-color":new fa(J.paint_symbol["text-color"],{runtimeType:vt,getOverride:t=>t.textColor,hasOverride:t=>!!t.textColor}),"text-halo-color":new fa(J.paint_symbol["text-halo-color"]),"text-halo-width":new fa(J.paint_symbol["text-halo-width"]),"text-halo-blur":new fa(J.paint_symbol["text-halo-blur"]),"text-translate":new pa(J.paint_symbol["text-translate"]),"text-translate-anchor":new pa(J.paint_symbol["text-translate-anchor"])})},get layout(){return du=du||new ya({"symbol-placement":new pa(J.layout_symbol["symbol-placement"]),"symbol-spacing":new pa(J.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new pa(J.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new fa(J.layout_symbol["symbol-sort-key"]),"symbol-z-order":new pa(J.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new pa(J.layout_symbol["icon-allow-overlap"]),"icon-overlap":new pa(J.layout_symbol["icon-overlap"]),"icon-ignore-placement":new pa(J.layout_symbol["icon-ignore-placement"]),"icon-optional":new pa(J.layout_symbol["icon-optional"]),"icon-rotation-alignment":new pa(J.layout_symbol["icon-rotation-alignment"]),"icon-size":new fa(J.layout_symbol["icon-size"]),"icon-text-fit":new pa(J.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new pa(J.layout_symbol["icon-text-fit-padding"]),"icon-image":new fa(J.layout_symbol["icon-image"]),"icon-rotate":new fa(J.layout_symbol["icon-rotate"]),"icon-padding":new fa(J.layout_symbol["icon-padding"]),"icon-keep-upright":new pa(J.layout_symbol["icon-keep-upright"]),"icon-offset":new fa(J.layout_symbol["icon-offset"]),"icon-anchor":new fa(J.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new pa(J.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new pa(J.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new pa(J.layout_symbol["text-rotation-alignment"]),"text-field":new fa(J.layout_symbol["text-field"]),"text-font":new fa(J.layout_symbol["text-font"]),"text-size":new fa(J.layout_symbol["text-size"]),"text-max-width":new fa(J.layout_symbol["text-max-width"]),"text-line-height":new pa(J.layout_symbol["text-line-height"]),"text-letter-spacing":new fa(J.layout_symbol["text-letter-spacing"]),"text-justify":new fa(J.layout_symbol["text-justify"]),"text-radial-offset":new fa(J.layout_symbol["text-radial-offset"]),"text-variable-anchor":new pa(J.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new fa(J.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new fa(J.layout_symbol["text-anchor"]),"text-max-angle":new pa(J.layout_symbol["text-max-angle"]),"text-writing-mode":new pa(J.layout_symbol["text-writing-mode"]),"text-rotate":new fa(J.layout_symbol["text-rotate"]),"text-padding":new pa(J.layout_symbol["text-padding"]),"text-keep-upright":new pa(J.layout_symbol["text-keep-upright"]),"text-transform":new fa(J.layout_symbol["text-transform"]),"text-offset":new fa(J.layout_symbol["text-offset"]),"text-allow-overlap":new pa(J.layout_symbol["text-allow-overlap"]),"text-overlap":new pa(J.layout_symbol["text-overlap"]),"text-ignore-placement":new pa(J.layout_symbol["text-ignore-placement"]),"text-optional":new pa(J.layout_symbol["text-optional"])})}};class ku{constructor(t){if(void 0===t.property.overrides)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=t.property.overrides?t.property.overrides.runtimeType:dt,this.defaultValue=t}evaluate(t){if(t.formattedSection){let e=this.defaultValue.property.overrides;if(e&&e.hasOverride(t.formattedSection))return e.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default}eachChild(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}Si("FormatSectionOverride",ku,{omit:["defaultValue"]});class Mu extends xa{constructor(t){super(t,Au)}recalculate(t,e){if(super.recalculate(t,e),"auto"===this.layout.get("icon-rotation-alignment")&&(this.layout._values["icon-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-rotation-alignment")&&(this.layout._values["text-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]="map"===this.layout.get("text-rotation-alignment")?"map":"viewport"),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),"point"===this.layout.get("symbol-placement")){let t=this.layout.get("text-writing-mode");if(t){let e=[];for(let r of t)e.indexOf(r)<0&&e.push(r);this.layout._values["text-writing-mode"]=e}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(t,e,r,n){let i=this.layout.get(t).evaluate(e,{},r,n),a=this._unevaluatedLayout._values[t];return a.isDataDriven()||kn(a.value)||!i?i:(o=e.properties,i.replace(/{([^{}]+)}/g,((t,e)=>o&&e in o?String(o[e]):"")));var o}createBucket(t){return new Tu(t)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(let t of Au.paint.overridableProperties){if(!Mu.hasPaintOverride(this.layout,t))continue;let e=this.paint.get(t),r=new ku(e),n=new An(r,e.property.specification),i=null;i="constant"===e.value.kind||"source"===e.value.kind?new Sn("source",n):new En("composite",n,e.value.zoomStops),this.paint._values[t]=new ua(e.property,i,e.parameters)}}_handleOverridablePaintPropertyUpdate(t,e,r){return!(!this.layout||e.isDataDriven()||r.isDataDriven())&&Mu.hasPaintOverride(this.layout,t)}static hasPaintOverride(t,e){let r=t.get("text-field"),n=Au.paint.properties[e],i=!1,a=t=>{for(let e of t)if(n.overrides&&n.overrides.hasOverride(e))return void(i=!0)};if("constant"===r.value.kind&&r.value.value instanceof re)a(r.value.value.sections);else if("source"===r.value.kind){let t=e=>{i||(e instanceof he&&ce(e.value)===wt?a(e.value.sections):e instanceof Ke?a(e.sections):e.eachChild(t))},e=r.value;e._styleExpression&&t(e._styleExpression.expression)}return i}}let Su;var Eu={get paint(){return Su=Su||new ya({"background-color":new pa(J.paint_background["background-color"]),"background-pattern":new ma(J.paint_background["background-pattern"]),"background-opacity":new pa(J.paint_background["background-opacity"])})}};class Cu extends xa{constructor(t){super(t,Eu)}}let Iu;var Lu={get paint(){return Iu=Iu||new ya({"raster-opacity":new pa(J.paint_raster["raster-opacity"]),"raster-hue-rotate":new pa(J.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new pa(J.paint_raster["raster-brightness-min"]),"raster-brightness-max":new pa(J.paint_raster["raster-brightness-max"]),"raster-saturation":new pa(J.paint_raster["raster-saturation"]),"raster-contrast":new pa(J.paint_raster["raster-contrast"]),"raster-resampling":new pa(J.paint_raster["raster-resampling"]),"raster-fade-duration":new pa(J.paint_raster["raster-fade-duration"])})}};class Pu extends xa{constructor(t){super(t,Lu)}}class zu extends xa{constructor(t){super(t,{}),this.onAdd=t=>{this.implementation.onAdd&&this.implementation.onAdd(t,t.painter.context.gl)},this.onRemove=t=>{this.implementation.onRemove&&this.implementation.onRemove(t,t.painter.context.gl)},this.implementation=t}is3D(){return"3d"===this.implementation.renderingMode}hasOffscreenPass(){return void 0!==this.implementation.prerender}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}class Du{constructor(t){this._methodToThrottle=t,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout((()=>{this._triggered=!1,this._methodToThrottle()}),0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}}let Ou=6371008.8;class Ru{constructor(t,e){if(isNaN(t)||isNaN(e))throw new Error(`Invalid LngLat object: (${t}, ${e})`);if(this.lng=+t,this.lat=+e,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new Ru(w(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(t){let e=Math.PI/180,r=this.lat*e,n=t.lat*e,i=Math.sin(r)*Math.sin(n)+Math.cos(r)*Math.cos(n)*Math.cos((t.lng-this.lng)*e);return Ou*Math.acos(Math.min(i,1))}static convert(t){if(t instanceof Ru)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new Ru(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new Ru(Number("lng"in t?t.lng:t.lon),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")}}let Fu=2*Math.PI*Ou;function Bu(t){return Fu*Math.cos(t*Math.PI/180)}function ju(t){return(180+t)/360}function Nu(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function Uu(t,e){return t/Bu(e)}function Vu(t){return 360/Math.PI*Math.atan(Math.exp((180-360*t)*Math.PI/180))-90}class qu{constructor(t,e,r=0){this.x=+t,this.y=+e,this.z=+r}static fromLngLat(t,e=0){let r=Ru.convert(t);return new qu(ju(r.lng),Nu(r.lat),Uu(e,r.lat))}toLngLat(){return new Ru(360*this.x-180,Vu(this.y))}toAltitude(){return this.z*Bu(Vu(this.y))}meterInMercatorCoordinateUnits(){return 1/Fu*(t=Vu(this.y),1/Math.cos(t*Math.PI/180));var t}}function Hu(t,e,r){var n=2*Math.PI*6378137/256/Math.pow(2,r);return[t*n-2*Math.PI*6378137/2,e*n-2*Math.PI*6378137/2]}class Gu{constructor(t,e,r){if(i=e,a=r,(n=t)<0||n>25||a<0||a>=Math.pow(2,n)||i<0||i>=Math.pow(2,n))throw new Error(`x=${e}, y=${r}, z=${t} outside of bounds. 0<=x<${Math.pow(2,t)}, 0<=y<${Math.pow(2,t)} 0<=z<=25 `);var n,i,a;this.z=t,this.x=e,this.y=r,this.key=Yu(0,t,t,e,r)}equals(t){return this.z===t.z&&this.x===t.x&&this.y===t.y}url(t,e,r){let n=(a=this.y,o=this.z,s=Hu(256*(i=this.x),256*(a=Math.pow(2,o)-a-1),o),l=Hu(256*(i+1),256*(a+1),o),s[0]+","+s[1]+","+l[0]+","+l[1]);var i,a,o,s,l;let c=function(t,e,r){let n,i="";for(let a=t;a>0;a--)n=1<1?"@2x":"").replace(/{quadkey}/g,c).replace(/{bbox-epsg-3857}/g,n)}isChildOf(t){let e=this.z-t.z;return e>0&&t.x===this.x>>e&&t.y===this.y>>e}getTilePoint(t){let e=Math.pow(2,this.z);return new c((t.x*e-this.x)*Ko,(t.y*e-this.y)*Ko)}toString(){return`${this.z}/${this.x}/${this.y}`}}class Wu{constructor(t,e){this.wrap=t,this.canonical=e,this.key=Yu(t,e.z,e.z,e.x,e.y)}}class Zu{constructor(t,e,r,n,i){if(t= z; overscaledZ = ${t}; z = ${r}`);this.overscaledZ=t,this.wrap=e,this.canonical=new Gu(r,+n,+i),this.key=Yu(e,t,r,n,i)}clone(){return new Zu(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(t){return this.overscaledZ===t.overscaledZ&&this.wrap===t.wrap&&this.canonical.equals(t.canonical)}scaledTo(t){if(t>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${t}; overscaledZ = ${this.overscaledZ}`);let e=this.canonical.z-t;return t>this.canonical.z?new Zu(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Zu(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)}calculateScaledKey(t,e){if(t>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${t}; overscaledZ = ${this.overscaledZ}`);let r=this.canonical.z-t;return t>this.canonical.z?Yu(this.wrap*+e,t,this.canonical.z,this.canonical.x,this.canonical.y):Yu(this.wrap*+e,t,t,this.canonical.x>>r,this.canonical.y>>r)}isChildOf(t){if(t.wrap!==this.wrap)return!1;let e=this.canonical.z-t.canonical.z;return 0===t.overscaledZ||t.overscaledZ>e&&t.canonical.y===this.canonical.y>>e}children(t){if(this.overscaledZ>=t)return[new Zu(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];let e=this.canonical.z+1,r=2*this.canonical.x,n=2*this.canonical.y;return[new Zu(e,this.wrap,e,r,n),new Zu(e,this.wrap,e,r+1,n),new Zu(e,this.wrap,e,r,n+1),new Zu(e,this.wrap,e,r+1,n+1)]}isLessThan(t){return this.wrapt.wrap)&&(this.overscaledZt.overscaledZ)&&(this.canonical.xt.canonical.x)&&this.canonical.ythis.max&&(this.max=r),r=this.dim+1||e<-1||e>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(e+1)*this.stride+(t+1)}unpack(t,e,r){return t*this.redFactor+e*this.greenFactor+r*this.blueFactor-this.baseShift}getPixels(){return new Os({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(t,e,r){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");let n=e*this.dim,i=e*this.dim+this.dim,a=r*this.dim,o=r*this.dim+this.dim;switch(e){case-1:n=i-1;break;case 1:i=n+1}switch(r){case-1:a=o-1;break;case 1:o=a+1}let s=-e*this.dim,l=-r*this.dim;for(let e=a;e=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${t} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[t]}}class Ku{constructor(t,e,r,n,i){this.type="Feature",this._vectorTileFeature=t,t._z=e,t._x=r,t._y=n,this.properties=t.properties,this.id=i}get geometry(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(t){this._geometry=t}toJSON(){let t={geometry:this.geometry};for(let e in this)"_geometry"!==e&&"_vectorTileFeature"!==e&&(t[e]=this[e]);return t}}class Ju{constructor(t,e){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=new ki(Ko,16,0),this.grid3D=new ki(Ko,16,0),this.featureIndexArray=new ao,this.promoteId=e}insert(t,e,r,n,i,a){let o=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,n,i);let s=a?this.grid3D:this.grid;for(let t=0;t=0&&n[3]>=0&&s.insert(o,n[0],n[1],n[2],n[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new kl.VectorTile(new jc(this.rawTileData)).layers,this.sourceLayerCoder=new $u(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(t,e,r,n){this.loadVTLayers();let i=t.params||{},a=Ko/t.tileSize/t.scale,o=Dn(i.filter),s=t.queryGeometry,l=t.queryPadding*a,u=th(s),h=this.grid.query(u.minX-l,u.minY-l,u.maxX+l,u.maxY+l),p=th(t.cameraQueryGeometry),f=this.grid3D.query(p.minX-l,p.minY-l,p.maxX+l,p.maxY+l,((e,r,n,i)=>function(t,e,r,n,i){for(let a of t)if(e<=a.x&&r<=a.y&&n>=a.x&&i>=a.y)return!0;let a=[new c(e,r),new c(e,i),new c(n,i),new c(n,r)];if(t.length>2)for(let e of a)if(fs(t,e))return!0;for(let e=0;e(p||(p=ts(e)),r.queryIntersectsFeature(s,e,n,p,this.z,t.transform,a,t.pixelPosMatrix))))}return m}loadMatchingFeature(t,e,r,n,i,a,o,s,l,c,u){let h=this.bucketLayerIDs[e];if(a&&!function(t,e){for(let r=0;r=0)return!0;return!1}(a,h))return;let p=this.sourceLayerCoder.decode(r),f=this.vtLayers[p].feature(n);if(i.needGeometry){let t=es(f,!0);if(!i.filter(new na(this.tileID.overscaledZ),t,this.tileID.canonical))return}else if(!i.filter(new na(this.tileID.overscaledZ),f))return;let d=this.getId(f,p);for(let e=0;e{let o=e instanceof ha?e.get(a):null;return o&&o.evaluate?o.evaluate(r,n,i):o}))}function th(t){let e=1/0,r=1/0,n=-1/0,i=-1/0;for(let a of t)e=Math.min(e,a.x),r=Math.min(r,a.y),n=Math.max(n,a.x),i=Math.max(i,a.y);return{minX:e,minY:r,maxX:n,maxY:i}}function eh(t,e){return e-t}function rh(t,e,r,n,i){let a=[];for(let o=0;o=n&&u.x>=n||(o.x>=n?o=new c(n,o.y+(n-o.x)/(u.x-o.x)*(u.y-o.y))._round():u.x>=n&&(u=new c(n,o.y+(n-o.x)/(u.x-o.x)*(u.y-o.y))._round()),o.y>=i&&u.y>=i||(o.y>=i?o=new c(o.x+(i-o.y)/(u.y-o.y)*(u.x-o.x),i)._round():u.y>=i&&(u=new c(o.x+(i-o.y)/(u.y-o.y)*(u.x-o.x),i)._round()),s&&o.equals(s[s.length-1])||(s=[o],a.push(s)),s.push(u)))))}}return a}Si("FeatureIndex",Ju,{omit:["rawTileData","sourceLayerCoder"]});class nh extends c{constructor(t,e,r,n){super(t,e),this.angle=r,void 0!==n&&(this.segment=n)}clone(){return new nh(this.x,this.y,this.angle,this.segment)}}function ih(t,e,r,n,i){if(void 0===e.segment||0===r)return!0;let a=e,o=e.segment+1,s=0;for(;s>-r/2;){if(o--,o<0)return!1;s-=t[o].dist(a),a=t[o]}s+=t[o].dist(t[o+1]),o++;let l=[],c=0;for(;sn;)c-=l.shift().angleDelta;if(c>i)return!1;o++,s+=e.dist(r)}return!0}function ah(t){let e=0;for(let r=0;rc){let u=(c-l)/a,h=Re.number(n.x,i.x,u),p=Re.number(n.y,i.y,u),f=new nh(h,p,i.angleTo(n),r);return f._round(),!o||ih(t,f,s,o,e)?f:void 0}l+=a}}function ch(t,e,r,n,i,a,o,s,l){let c=oh(n,a,o),u=sh(n,i),h=u*o,p=0===t[0].x||t[0].x===l||0===t[0].y||t[0].y===l;return e-h=0&&y=0&&v=0&&p+c<=u){let r=new nh(y,v,m,e);r._round(),n&&!ih(t,r,a,n,i)||f.push(r)}}h+=d}return s||f.length||o||(f=uh(t,h/2,r,n,i,a,o,!0,l)),f}function hh(t,e,r,n){let i=[],a=t.image,o=a.pixelRatio,s=a.paddedRect.w-2,l=a.paddedRect.h-2,u={x1:t.left,y1:t.top,x2:t.right,y2:t.bottom},h=a.stretchX||[[0,s]],p=a.stretchY||[[0,l]],f=(t,e)=>t+e[1]-e[0],d=h.reduce(f,0),m=p.reduce(f,0),g=s-d,y=l-m,v=0,x=d,_=0,b=m,w=0,T=g,A=0,k=y;if(a.content&&n){let e=a.content,r=e[2]-e[0],n=e[3]-e[1];(a.textFitWidth||a.textFitHeight)&&(u=lu(t)),v=ph(h,0,e[0]),_=ph(p,0,e[1]),x=ph(h,e[0],e[2]),b=ph(p,e[1],e[3]),w=e[0]-v,A=e[1]-_,T=r-x,k=n-b}let M=u.x1,S=u.y1,E=u.x2-M,C=u.y2-S,I=(t,n,i,s)=>{let l=dh(t.stretch-v,x,E,M),u=mh(t.fixed-w,T,t.stretch,d),h=dh(n.stretch-_,b,C,S),p=mh(n.fixed-A,k,n.stretch,m),f=dh(i.stretch-v,x,E,M),g=mh(i.fixed-w,T,i.stretch,d),y=dh(s.stretch-_,b,C,S),I=mh(s.fixed-A,k,s.stretch,m),L=new c(l,h),P=new c(f,h),z=new c(f,y),D=new c(l,y),O=new c(u/o,p/o),R=new c(g/o,I/o),F=e*Math.PI/180;if(F){let t=Math.sin(F),e=Math.cos(F),r=[e,-t,t,e];L._matMult(r),P._matMult(r),D._matMult(r),z._matMult(r)}let B=t.stretch+t.fixed,j=n.stretch+n.fixed;return{tl:L,tr:P,bl:D,br:z,tex:{x:a.paddedRect.x+1+B,y:a.paddedRect.y+1+j,w:i.stretch+i.fixed-B,h:s.stretch+s.fixed-j},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:O,pixelOffsetBR:R,minFontScaleX:T/o/E,minFontScaleY:k/o/C,isSDF:r}};if(n&&(a.stretchX||a.stretchY)){let t=fh(h,g,d),e=fh(p,y,m);for(let r=0;r0&&(n=Math.max(10,n),this.circleDiameter=n)}else{let l=null!==(h=a.image)&&void 0!==h&&h.content&&(a.image.textFitWidth||a.image.textFitHeight)?lu(a):{x1:a.left,y1:a.top,x2:a.right,y2:a.bottom};l.y1=l.y1*o-s[0],l.y2=l.y2*o+s[2],l.x1=l.x1*o-s[3],l.x2=l.x2*o+s[1];let p=a.collisionPadding;if(p&&(l.x1-=p[0]*o,l.y1-=p[1]*o,l.x2+=p[2]*o,l.y2+=p[3]*o),u){let t=new c(l.x1,l.y1),e=new c(l.x2,l.y1),r=new c(l.x1,l.y2),n=new c(l.x2,l.y2),i=u*Math.PI/180;t._rotate(i),e._rotate(i),r._rotate(i),n._rotate(i),l.x1=Math.min(t.x,e.x,r.x,n.x),l.x2=Math.max(t.x,e.x,r.x,n.x),l.y1=Math.min(t.y,e.y,r.y,n.y),l.y2=Math.max(t.y,e.y,r.y,n.y)}t.emplaceBack(e.x,e.y,l.x1,l.y1,l.x2,l.y2,r,n,i)}this.boxEndIndex=t.length}}class yh{constructor(t=[],e=(t,e)=>te?1:0){if(this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(let t=(this.length>>1)-1;t>=0;t--)this._down(t)}push(t){this.data.push(t),this._up(this.length++)}pop(){if(0===this.length)return;let t=this.data[0],e=this.data.pop();return--this.length>0&&(this.data[0]=e,this._down(0)),t}peek(){return this.data[0]}_up(t){let{data:e,compare:r}=this,n=e[t];for(;t>0;){let i=t-1>>1,a=e[i];if(r(n,a)>=0)break;e[t]=a,t=i}e[t]=n}_down(t){let{data:e,compare:r}=this,n=this.length>>1,i=e[t];for(;t=0)break;e[t]=e[n],t=n}e[t]=i}}function vh(t,e=1,r=!1){let n=1/0,i=1/0,a=-1/0,o=-1/0,s=t[0];for(let t=0;ta)&&(a=e.x),(!t||e.y>o)&&(o=e.y)}let l=Math.min(a-n,o-i),u=l/2,h=new yh([],xh);if(0===l)return new c(n,i);for(let e=n;ep.d||!p.d)&&(p=n,r&&console.log("found best %d after %d probes",Math.round(1e4*n.d)/1e4,f)),n.max-p.d<=e||(u=n.h/2,h.push(new _h(n.p.x-u,n.p.y-u,u,t)),h.push(new _h(n.p.x+u,n.p.y-u,u,t)),h.push(new _h(n.p.x-u,n.p.y+u,u,t)),h.push(new _h(n.p.x+u,n.p.y+u,u,t)),f+=4)}return r&&(console.log(`num probes: ${f}`),console.log(`best distance: ${p.d}`)),p.p}function xh(t,e){return e.max-t.max}function _h(t,e,r,n){this.p=new c(t,e),this.h=r,this.d=function(t,e){let r=!1,n=1/0;for(let i=0;it.y!=s.y>t.y&&t.x<(s.x-i.x)*(t.y-i.y)/(s.y-i.y)+i.x&&(r=!r),n=Math.min(n,hs(t,i,s))}}return(r?1:-1)*Math.sqrt(n)}(this.p,n),this.max=this.d+this.h*Math.SQRT2}var bh;t.aq=void 0,(bh=t.aq||(t.aq={}))[bh.center=1]="center",bh[bh.left=2]="left",bh[bh.right=3]="right",bh[bh.top=4]="top",bh[bh.bottom=5]="bottom",bh[bh["top-left"]=6]="top-left",bh[bh["top-right"]=7]="top-right",bh[bh["bottom-left"]=8]="bottom-left",bh[bh["bottom-right"]=9]="bottom-right";let wh=Number.POSITIVE_INFINITY;function Th(t,e){return e[1]!==wh?function(t,e,r){let n=0,i=0;switch(e=Math.abs(e),r=Math.abs(r),t){case"top-right":case"top-left":case"top":i=r-7;break;case"bottom-right":case"bottom-left":case"bottom":i=7-r}switch(t){case"top-right":case"bottom-right":case"right":n=-e;break;case"top-left":case"bottom-left":case"left":n=e}return[n,i]}(t,e[0],e[1]):function(t,e){let r=0,n=0;e<0&&(e=0);let i=e/Math.SQRT2;switch(t){case"top-right":case"top-left":n=i-7;break;case"bottom-right":case"bottom-left":n=7-i;break;case"bottom":n=7-e;break;case"top":n=e-7}switch(t){case"top-right":case"bottom-right":r=-i;break;case"top-left":case"bottom-left":r=i;break;case"left":r=e;break;case"right":r=-e}return[r,n]}(t,e[0])}function Ah(t,e,r){var n;let i=t.layout,a=null===(n=i.get("text-variable-anchor-offset"))||void 0===n?void 0:n.evaluate(e,{},r);if(a){let t=a.values,e=[];for(let r=0;rt*gc));n.startsWith("top")?i[1]-=7:n.startsWith("bottom")&&(i[1]+=7),e[r+1]=i}return new ae(e)}let o=i.get("text-variable-anchor");if(o){let n;n=void 0!==t._unevaluatedLayout.getValue("text-radial-offset")?[i.get("text-radial-offset").evaluate(e,{},r)*gc,wh]:i.get("text-offset").evaluate(e,{},r).map((t=>t*gc));let a=[];for(let t of o)a.push(t,Th(t,n));return new ae(a)}return null}function kh(t){switch(t){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function Mh(e,r,n,i,a,o,s,l,c,u,h){let p=o.textMaxSize.evaluate(r,{});void 0===p&&(p=s);let f,d=e.layers[0].layout,m=d.get("icon-offset").evaluate(r,{},h),g=Eh(n.horizontal),y=s/24,v=e.tilePixelRatio*y,x=e.tilePixelRatio*p/24,_=e.tilePixelRatio*l,b=e.tilePixelRatio*d.get("symbol-spacing"),w=d.get("text-padding")*e.tilePixelRatio,T=function(t,e,r,n=1){let i=t.get("icon-padding").evaluate(e,{},r),a=i&&i.values;return[a[0]*n,a[1]*n,a[2]*n,a[3]*n]}(d,r,h,e.tilePixelRatio),A=d.get("text-max-angle")/180*Math.PI,k="viewport"!==d.get("text-rotation-alignment")&&"point"!==d.get("symbol-placement"),M="map"===d.get("icon-rotation-alignment")&&"point"!==d.get("symbol-placement"),S=d.get("symbol-placement"),E=b/2,I=d.get("icon-text-fit");i&&"none"!==I&&(e.allowVerticalPlacement&&n.vertical&&(f=cu(i,n.vertical,I,d.get("icon-text-fit-padding"),m,y)),g&&(i=cu(i,g,I,d.get("icon-text-fit-padding"),m,y)));let L=(l,p)=>{p.x<0||p.x>=Ko||p.y<0||p.y>=Ko||function(e,r,n,i,a,o,s,l,c,u,h,p,f,d,m,g,y,v,x,_,b,w,T,A,k){let M,S,E,I,L=e.addToLineVertexArray(r,n),P=0,z=0,D=0,O=0,R=-1,F=-1,B={},j=Co("");if(e.allowVerticalPlacement&&i.vertical){let t=l.layout.get("text-rotate").evaluate(b,{},A)+90;E=new gh(c,r,u,h,p,i.vertical,f,d,m,t),s&&(I=new gh(c,r,u,h,p,s,y,v,m,t))}if(a){let n=l.layout.get("icon-rotate").evaluate(b,{}),i="none"!==l.layout.get("icon-text-fit"),o=hh(a,n,T,i),f=s?hh(s,n,T,i):void 0;S=new gh(c,r,u,h,p,a,y,v,!1,n),P=4*o.length;let d=e.iconSizeData,m=null;"source"===d.kind?(m=[uu*l.layout.get("icon-size").evaluate(b,{})],m[0]>hu&&C(`${e.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)):"composite"===d.kind&&(m=[uu*w.compositeIconSizes[0].evaluate(b,{},A),uu*w.compositeIconSizes[1].evaluate(b,{},A)],(m[0]>hu||m[1]>hu)&&C(`${e.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)),e.addSymbols(e.icon,o,m,_,x,b,t.ah.none,r,L.lineStartIndex,L.lineLength,-1,A),R=e.icon.placedSymbolArray.length-1,f&&(z=4*f.length,e.addSymbols(e.icon,f,m,_,x,b,t.ah.vertical,r,L.lineStartIndex,L.lineLength,-1,A),F=e.icon.placedSymbolArray.length-1)}let N=Object.keys(i.horizontal);for(let n of N){let a=i.horizontal[n];if(!M){j=Co(a.text);let t=l.layout.get("text-rotate").evaluate(b,{},A);M=new gh(c,r,u,h,p,a,f,d,m,t)}let s=1===a.positionedLines.length;if(D+=Sh(e,r,a,o,l,m,b,g,L,i.vertical?t.ah.horizontal:t.ah.horizontalOnly,s?N:[n],B,R,w,A),s)break}i.vertical&&(O+=Sh(e,r,i.vertical,o,l,m,b,g,L,t.ah.vertical,["vertical"],B,F,w,A));let U=M?M.boxStartIndex:e.collisionBoxArray.length,V=M?M.boxEndIndex:e.collisionBoxArray.length,q=E?E.boxStartIndex:e.collisionBoxArray.length,H=E?E.boxEndIndex:e.collisionBoxArray.length,G=S?S.boxStartIndex:e.collisionBoxArray.length,W=S?S.boxEndIndex:e.collisionBoxArray.length,Z=I?I.boxStartIndex:e.collisionBoxArray.length,Y=I?I.boxEndIndex:e.collisionBoxArray.length,X=-1,$=(t,e)=>t&&t.circleDiameter?Math.max(t.circleDiameter,e):e;X=$(M,X),X=$(E,X),X=$(S,X),X=$(I,X);let K=X>-1?1:0;K&&(X*=k/gc),e.glyphOffsetArray.length>=Tu.MAX_GLYPHS&&C("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==b.sortKey&&e.addToSortKeyRanges(e.symbolInstances.length,b.sortKey);let J=Ah(l,b,A),[Q,tt]=function(e,r){let n=e.length,i=r?.values;if(i?.length>0)for(let r=0;r=0?B.right:-1,B.center>=0?B.center:-1,B.left>=0?B.left:-1,B.vertical||-1,R,F,j,U,V,q,H,G,W,Z,Y,u,D,O,P,z,K,0,f,X,Q,tt)}(e,p,l,n,i,a,f,e.layers[0],e.collisionBoxArray,r.index,r.sourceLayerIndex,e.index,v,[w,w,w,w],k,c,_,T,M,m,r,o,u,h,s)};if("line"===S)for(let t of rh(r.geometry,0,0,Ko,Ko)){let r=ch(t,b,A,n.vertical||g,i,24,x,e.overscaling,Ko);for(let n of r)g&&Ch(e,g.text,E,n)||L(t,n)}else if("line-center"===S){for(let t of r.geometry)if(t.length>1){let e=lh(t,A,n.vertical||g,i,24,x);e&&L(t,e)}}else if("Polygon"===r.type)for(let t of Ar(r.geometry,0)){let e=vh(t,16);L(t[0],new nh(e.x,e.y,0))}else if("LineString"===r.type)for(let t of r.geometry)L(t,new nh(t[0].x,t[0].y,0));else if("Point"===r.type)for(let t of r.geometry)for(let e of t)L([e],new nh(e.x,e.y,0))}function Sh(t,e,r,n,i,a,o,s,l,u,h,p,f,d,m){let g=function(t,e,r,n,i,a,o,s){let l=n.layout.get("text-rotate").evaluate(a,{})*Math.PI/180,u=[];for(let t of e.positionedLines)for(let n of t.positionedGlyphs){if(!n.rect)continue;let a=n.rect||{},h=4,p=!0,f=1,d=0,m=(i||s)&&n.vertical,g=n.metrics.advance*n.scale/2;if(s&&e.verticalizable&&(d=t.lineOffset/2-(n.imageName?-(gc-n.metrics.width*n.scale)/2:(n.scale-1)*gc)),n.imageName){let t=o[n.imageName];p=t.sdf,f=t.pixelRatio,h=1/f}let y=i?[n.x+g,n.y]:[0,0],v=i?[0,0]:[n.x+g+r[0],n.y+r[1]-d],x=[0,0];m&&(x=v,v=[0,0]);let _=n.metrics.isDoubleResolution?2:1,b=(n.metrics.left-h)*n.scale-g+v[0],w=(-n.metrics.top-h)*n.scale+v[1],T=b+a.w/_*n.scale/f,A=w+a.h/_*n.scale/f,k=new c(b,w),M=new c(T,w),S=new c(b,A),E=new c(T,A);if(m){let t=new c(-g,g-Wc),e=-Math.PI/2,r=12-g,i=new c(22-r,-(n.imageName?r:0)),a=new c(...x);k._rotateAround(e,t)._add(i)._add(a),M._rotateAround(e,t)._add(i)._add(a),S._rotateAround(e,t)._add(i)._add(a),E._rotateAround(e,t)._add(i)._add(a)}if(l){let t=Math.sin(l),e=Math.cos(l),r=[e,-t,t,e];k._matMult(r),M._matMult(r),S._matMult(r),E._matMult(r)}let C=new c(0,0),I=new c(0,0);u.push({tl:k,tr:M,bl:S,br:E,tex:a,writingMode:e.writingMode,glyphOffset:y,sectionIndex:n.sectionIndex,isSDF:p,pixelOffsetTL:C,pixelOffsetBR:I,minFontScaleX:0,minFontScaleY:0})}return u}(0,r,s,i,a,o,n,t.allowVerticalPlacement),y=t.textSizeData,v=null;"source"===y.kind?(v=[uu*i.layout.get("text-size").evaluate(o,{})],v[0]>hu&&C(`${t.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)):"composite"===y.kind&&(v=[uu*d.compositeTextSizes[0].evaluate(o,{},m),uu*d.compositeTextSizes[1].evaluate(o,{},m)],(v[0]>hu||v[1]>hu)&&C(`${t.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)),t.addSymbols(t.text,g,v,s,a,o,u,e,l.lineStartIndex,l.lineLength,f,m);for(let e of h)p[e]=t.text.placedSymbolArray.length-1;return 4*g.length}function Eh(t){for(let e in t)return t[e];return null}function Ch(t,e,r,n){let i=t.compareText;if(e in i){let t=i[e];for(let e=t.length-1;e>=0;e--)if(n.dist(t[e])>4;if(1!==n)throw new Error(`Got v${n} data when expected v1.`);let i=Ih[15&r];if(!i)throw new Error("Unrecognized array type.");let[a]=new Uint16Array(t,2,1),[o]=new Uint32Array(t,4,1);return new Lh(o,a,i,t)}constructor(t,e=64,r=Float64Array,n){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+e,2),65535),this.ArrayType=r,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;let i=Ih.indexOf(this.ArrayType),a=2*t*this.ArrayType.BYTES_PER_ELEMENT,o=t*this.IndexArrayType.BYTES_PER_ELEMENT,s=(8-o%8)%8;if(i<0)throw new Error(`Unexpected typed array class: ${r}.`);n&&n instanceof ArrayBuffer?(this.data=n,this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+o+s,2*t),this._pos=2*t,this._finished=!0):(this.data=new ArrayBuffer(8+a+o+s),this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+o+s,2*t),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+i]),new Uint16Array(this.data,2,1)[0]=e,new Uint32Array(this.data,4,1)[0]=t)}add(t,e){let r=this._pos>>1;return this.ids[r]=r,this.coords[this._pos++]=t,this.coords[this._pos++]=e,r}finish(){let t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return Ph(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,e,r,n){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:i,coords:a,nodeSize:o}=this,s=[0,i.length-1,0],l=[];for(;s.length;){let c=s.pop()||0,u=s.pop()||0,h=s.pop()||0;if(u-h<=o){for(let o=h;o<=u;o++){let s=a[2*o],c=a[2*o+1];s>=t&&s<=r&&c>=e&&c<=n&&l.push(i[o])}continue}let p=h+u>>1,f=a[2*p],d=a[2*p+1];f>=t&&f<=r&&d>=e&&d<=n&&l.push(i[p]),(0===c?t<=f:e<=d)&&(s.push(h),s.push(p-1),s.push(1-c)),(0===c?r>=f:n>=d)&&(s.push(p+1),s.push(u),s.push(1-c))}return l}within(t,e,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:n,coords:i,nodeSize:a}=this,o=[0,n.length-1,0],s=[],l=r*r;for(;o.length;){let c=o.pop()||0,u=o.pop()||0,h=o.pop()||0;if(u-h<=a){for(let r=h;r<=u;r++)Rh(i[2*r],i[2*r+1],t,e)<=l&&s.push(n[r]);continue}let p=h+u>>1,f=i[2*p],d=i[2*p+1];Rh(f,d,t,e)<=l&&s.push(n[p]),(0===c?t-r<=f:e-r<=d)&&(o.push(h),o.push(p-1),o.push(1-c)),(0===c?t+r>=f:e+r>=d)&&(o.push(p+1),o.push(u),o.push(1-c))}return s}}function Ph(t,e,r,n,i,a){if(i-n<=r)return;let o=n+i>>1;zh(t,e,o,n,i,a),Ph(t,e,r,n,o-1,1-a),Ph(t,e,r,o+1,i,1-a)}function zh(t,e,r,n,i,a){for(;i>n;){if(i-n>600){let o=i-n+1,s=r-n+1,l=Math.log(o),c=.5*Math.exp(2*l/3),u=.5*Math.sqrt(l*c*(o-c)/o)*(s-o/2<0?-1:1);zh(t,e,r,Math.max(n,Math.floor(r-s*c/o+u)),Math.min(i,Math.floor(r+(o-s)*c/o+u)),a)}let o=e[2*r+a],s=n,l=i;for(Dh(t,e,n,r),e[2*i+a]>o&&Dh(t,e,n,i);so;)l--}e[2*n+a]===o?Dh(t,e,n,l):(l++,Dh(t,e,l,i)),l<=r&&(n=l+1),r<=l&&(i=l-1)}}function Dh(t,e,r,n){Oh(t,r,n),Oh(e,2*r,2*n),Oh(e,2*r+1,2*n+1)}function Oh(t,e,r){let n=t[e];t[e]=t[r],t[r]=n}function Rh(t,e,r,n){let i=t-r,a=e-n;return i*i+a*a}var Fh;t.bg=void 0,(Fh=t.bg||(t.bg={})).create="create",Fh.load="load",Fh.fullLoad="fullLoad";let Bh=null,jh=[],Nh=1e3/60,Uh="loadTime",Vh="fullLoadTime",qh={mark(t){performance.mark(t)},frame(t){let e=t;null!=Bh&&jh.push(e-Bh),Bh=e},clearMetrics(){Bh=null,jh=[],performance.clearMeasures(Uh),performance.clearMeasures(Vh);for(let e in t.bg)performance.clearMarks(t.bg[e])},getPerformanceMetrics(){performance.measure(Uh,t.bg.create,t.bg.load),performance.measure(Vh,t.bg.create,t.bg.fullLoad);let e=performance.getEntriesByName(Uh)[0].duration,r=performance.getEntriesByName(Vh)[0].duration,n=jh.length,i=1/(jh.reduce(((t,e)=>t+e),0)/n/1e3),a=jh.filter((t=>t>Nh)).reduce(((t,e)=>t+(e-Nh)/Nh),0);return{loadTime:e,fullLoadTime:r,fps:i,percentDroppedFrames:a/(n+a)*100,totalFrames:n}}};t.$=class extends Sa{},t.A=_s,t.B=bi,t.C=function(t){if(null==P){let e=t.navigator?t.navigator.userAgent:null;P=!!t.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return P},t.D=pa,t.E=K,t.F=class{constructor(t,e){var r,n,i;this.target=t,this.mapId=e,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new Du((()=>this.process())),this.subscription=(r=this.target,n="message",i=t=>this.receive(t),r.addEventListener(n,i,!1),{unsubscribe:()=>{r.removeEventListener(n,i,!1)}}),this.globalScope=L(self)?t:window}registerMessageHandler(t,e){this.messageHandlers[t]=e}sendAsync(t,e){return new Promise(((r,n)=>{let i=Math.round(1e18*Math.random()).toString(36).substring(0,10);this.resolveRejects[i]={resolve:r,reject:n},e&&e.signal.addEventListener("abort",(()=>{delete this.resolveRejects[i];let e={id:i,type:"",origin:location.origin,targetMapId:t.targetMapId,sourceMapId:this.mapId};this.target.postMessage(e)}),{once:!0});let a=[],o=Object.assign(Object.assign({},t),{id:i,sourceMapId:this.mapId,origin:location.origin,data:Li(t.data,a)});this.target.postMessage(o,{transfer:a})}))}receive(t){let e=t.data,r=e.id;if(!("file://"!==e.origin&&"file://"!==location.origin&&"resource://android"!==e.origin&&"resource://android"!==location.origin&&e.origin!==location.origin||e.targetMapId&&this.mapId!==e.targetMapId)){if(""===e.type){delete this.tasks[r];let t=this.abortControllers[r];return delete this.abortControllers[r],void(t&&t.abort())}if(L(self)||e.mustQueue)return this.tasks[r]=e,this.taskQueue.push(r),void this.invoker.trigger();this.processTask(r,e)}}process(){if(0===this.taskQueue.length)return;let t=this.taskQueue.shift(),e=this.tasks[t];delete this.tasks[t],this.taskQueue.length>0&&this.invoker.trigger(),e&&this.processTask(t,e)}processTask(t,r){return e(this,void 0,void 0,(function*(){if(""===r.type){let e=this.resolveRejects[t];return delete this.resolveRejects[t],e?void(r.error?e.reject(Pi(r.error)):e.resolve(Pi(r.data))):void 0}if(!this.messageHandlers[r.type])return void this.completeTask(t,new Error(`Could not find a registered handler for ${r.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(", ")}`));let e=Pi(r.data),n=new AbortController;this.abortControllers[t]=n;try{let i=yield this.messageHandlers[r.type](r.sourceMapId,e,n);this.completeTask(t,null,i)}catch(e){this.completeTask(t,e)}}))}completeTask(t,e,r){let n=[];delete this.abortControllers[t];let i={id:t,type:"",sourceMapId:this.mapId,origin:location.origin,error:e?Li(e):null,data:Li(r,n)};this.target.postMessage(i,{transfer:n})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},t.G=V,t.H=function(){var t=new _s(16);return _s!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},t.I=Hc,t.J=function(t,e,r){var n,i,a,o,s,l,c,u,h,p,f,d,m=r[0],g=r[1],y=r[2];return e===t?(t[12]=e[0]*m+e[4]*g+e[8]*y+e[12],t[13]=e[1]*m+e[5]*g+e[9]*y+e[13],t[14]=e[2]*m+e[6]*g+e[10]*y+e[14],t[15]=e[3]*m+e[7]*g+e[11]*y+e[15]):(i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],c=e[6],u=e[7],h=e[8],p=e[9],f=e[10],d=e[11],t[0]=n=e[0],t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=l,t[6]=c,t[7]=u,t[8]=h,t[9]=p,t[10]=f,t[11]=d,t[12]=n*m+s*g+h*y+e[12],t[13]=i*m+l*g+p*y+e[13],t[14]=a*m+c*g+f*y+e[14],t[15]=o*m+u*g+d*y+e[15]),t},t.K=function(t,e,r){var n=r[0],i=r[1],a=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11]*a,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},t.L=ws,t.M=function(t,e){let r={};for(let n=0;n{let e=window.document.createElement("video");return e.muted=!0,new Promise((r=>{e.onloadstart=()=>{r(e)};for(let r of t){let t=window.document.createElement("source");W(r)||(e.crossOrigin="Anonymous"),t.src=r,e.appendChild(t)}}))},t.a4=function(){return A++},t.a5=Xa,t.a6=Tu,t.a7=Dn,t.a8=es,t.a9=Ku,t.aA=function(t){if("custom"===t.type)return new zu(t);switch(t.type){case"background":return new Cu(t);case"circle":return new Ms(t);case"fill":return new bl(t);case"fill-extrusion":return new Gl(t);case"heatmap":return new js(t);case"hillshade":return new Us(t);case"line":return new sc(t);case"raster":return new Pu(t);case"symbol":return new Mu(t)}},t.aB=S,t.aC=function(t,e){if(!t)return[{command:"setStyle",args:[e]}];let r=[];try{if(!et(t.version,e.version))return[{command:"setStyle",args:[e]}];et(t.center,e.center)||r.push({command:"setCenter",args:[e.center]}),et(t.zoom,e.zoom)||r.push({command:"setZoom",args:[e.zoom]}),et(t.bearing,e.bearing)||r.push({command:"setBearing",args:[e.bearing]}),et(t.pitch,e.pitch)||r.push({command:"setPitch",args:[e.pitch]}),et(t.sprite,e.sprite)||r.push({command:"setSprite",args:[e.sprite]}),et(t.glyphs,e.glyphs)||r.push({command:"setGlyphs",args:[e.glyphs]}),et(t.transition,e.transition)||r.push({command:"setTransition",args:[e.transition]}),et(t.light,e.light)||r.push({command:"setLight",args:[e.light]}),et(t.terrain,e.terrain)||r.push({command:"setTerrain",args:[e.terrain]}),et(t.sky,e.sky)||r.push({command:"setSky",args:[e.sky]}),et(t.projection,e.projection)||r.push({command:"setProjection",args:[e.projection]});let n={},i=[];!function(t,e,r,n){let i;for(i in e=e||{},t=t||{})Object.prototype.hasOwnProperty.call(t,i)&&(Object.prototype.hasOwnProperty.call(e,i)||it(i,r,n));for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&(Object.prototype.hasOwnProperty.call(t,i)?et(t[i],e[i])||("geojson"===t[i].type&&"geojson"===e[i].type&&ot(t,e,i)?rt(r,{command:"setGeoJSONSourceData",args:[i,e[i].data]}):at(i,e,r,n)):nt(i,e,r))}(t.sources,e.sources,i,n);let a=[];t.layers&&t.layers.forEach((t=>{"source"in t&&n[t.source]?r.push({command:"removeLayer",args:[t.id]}):a.push(t)})),r=r.concat(i),function(t,e,r){e=e||[];let n,i,a,o,s,l=(t=t||[]).map(lt),c=e.map(lt),u=t.reduce(ct,{}),h=e.reduce(ct,{}),p=l.slice(),f=Object.create(null);for(let t=0,e=0;t@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,((t,r,n,i)=>{let a=n||i;return e[r]=!a||a.toLowerCase(),""})),e["max-age"]){let t=parseInt(e["max-age"],10);isNaN(t)?delete e["max-age"]:e["max-age"]=t}return e},t.ab=function(t,e){let r=[];for(let n in t)n in e||r.push(n);return r},t.ac=b,t.ad=function(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[0],o=e[1],s=e[2],l=e[3],c=e[4],u=e[5],h=e[6],p=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*i+c*n,t[1]=o*i+u*n,t[2]=s*i+h*n,t[3]=l*i+p*n,t[4]=c*i-a*n,t[5]=u*i-o*n,t[6]=h*i-s*n,t[7]=p*i-l*n,t},t.ae=function(t){var e=new _s(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},t.af=ks,t.ag=function(t,e){let r=0,n=0;if("constant"===t.kind)n=t.layoutSize;else if("source"!==t.kind){let{interpolationType:i,minZoom:a,maxZoom:o}=t,s=i?b(Fe.interpolationFactor(i,e,a,o),0,1):0;"camera"===t.kind?n=Re.number(t.minSize,t.maxSize,s):r=s}return{uSizeT:r,uSize:n}},t.ai=function(t,{uSize:e,uSizeT:r},{lowerSize:n,upperSize:i}){return"source"===t.kind?n/uu:"composite"===t.kind?Re.number(n/uu,i/uu,r):e},t.aj=xu,t.ak=function(t,e,r,n){let i=e.y-t.y,a=e.x-t.x,o=n.y-r.y,s=n.x-r.x,l=o*a-s*i;if(0===l)return null;let u=(s*(t.y-r.y)-o*(t.x-r.x))/l;return new c(t.x+u*a,t.y+u*i)},t.al=rh,t.am=is,t.an=bs,t.ao=function(t){let e=1/0,r=1/0,n=-1/0,i=-1/0;for(let a of t)e=Math.min(e,a.x),r=Math.min(r,a.y),n=Math.max(n,a.x),i=Math.max(i,a.y);return[e,r,n,i]},t.ap=gc,t.ar=fu,t.as=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],c=e[7],u=e[8],h=e[9],p=e[10],f=e[11],d=e[12],m=e[13],g=e[14],y=e[15],v=r*s-n*o,x=r*l-i*o,_=r*c-a*o,b=n*l-i*s,w=n*c-a*s,T=i*c-a*l,A=u*m-h*d,k=u*g-p*d,M=u*y-f*d,S=h*g-p*m,E=h*y-f*m,C=p*y-f*g,I=v*C-x*E+_*S+b*M-w*k+T*A;return I?(t[0]=(s*C-l*E+c*S)*(I=1/I),t[1]=(i*E-n*C-a*S)*I,t[2]=(m*T-g*w+y*b)*I,t[3]=(p*w-h*T-f*b)*I,t[4]=(l*M-o*C-c*k)*I,t[5]=(r*C-i*M+a*k)*I,t[6]=(g*_-d*T-y*x)*I,t[7]=(u*T-p*_+f*x)*I,t[8]=(o*E-s*M+c*A)*I,t[9]=(n*M-r*E-a*A)*I,t[10]=(d*w-m*_+y*v)*I,t[11]=(h*_-u*w-f*v)*I,t[12]=(s*k-o*S-l*A)*I,t[13]=(r*S-n*k+i*A)*I,t[14]=(m*x-d*b-g*v)*I,t[15]=(u*b-h*x+p*v)*I,t):null},t.at=kh,t.au=au,t.av=Lh,t.aw=function(){let t={},e=J.$version;for(let r in J.$root){let n=J.$root[r];if(n.required){let i=null;i="version"===r?e:"array"===n.type?[]:{},null!=i&&(t[r]=i)}}return t},t.ax=zi,t.ay=H,t.az=function(t){t=t.slice();let e=Object.create(null);for(let r=0;r25||n<0||n>=1||r<0||r>=1)},t.bc=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},t.bd=class extends Ma{},t.be=Ou,t.bf=qh,t.bh=q,t.bi=function(t,e){N.REGISTERED_PROTOCOLS[t]=e},t.bj=function(t){delete N.REGISTERED_PROTOCOLS[t]},t.bk=function(t,e){let r={};for(let n=0;nt*gc))}let x=s?"center":n.get("text-justify").evaluate(i,{},e.canonical),_="point"===n.get("symbol-placement")?n.get("text-max-width").evaluate(i,{},e.canonical)*gc:1/0,b=()=>{e.bucket.allowVerticalPlacement&&Hi(a)&&(m.vertical=Xc(g,e.glyphMap,e.glyphPositions,e.imagePositions,h,_,o,d,"left",u,y,t.ah.vertical,!0,f,p))};if(!s&&v){let r=new Set;if("auto"===x)for(let t=0;te(void 0,void 0,void 0,(function*(){if(0===t.byteLength)return createImageBitmap(new ImageData(1,1));let e=new Blob([new Uint8Array(t)],{type:"image/png"});try{return createImageBitmap(e)}catch(t){throw new Error(`Could not load image because of ${t.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}})),t.e=T,t.f=t=>new Promise(((e,r)=>{let n=new Image;n.onload=()=>{e(n),URL.revokeObjectURL(n.src),n.onload=null,window.requestAnimationFrame((()=>{n.src=D}))},n.onerror=()=>r(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));let i=new Blob([new Uint8Array(t)],{type:"image/png"});n.src=t.byteLength?URL.createObjectURL(i):D})),t.g=U,t.h=(t,e)=>G(T(t,{type:"json"}),e),t.i=L,t.j=$,t.k=X,t.l=(t,e)=>G(T(t,{type:"arrayBuffer"}),e),t.m=G,t.n=function(t){return new jc(t).readFields(Nc,[])},t.o=Ds,t.p=qc,t.q=ya,t.r=_i,t.s=W,t.t=Ai,t.u=xi,t.v=J,t.w=C,t.x=function([t,e,r]){return e+=90,e*=Math.PI/180,r*=Math.PI/180,{x:t*Math.cos(e)*Math.sin(r),y:t*Math.sin(e)*Math.sin(r),z:t*Math.cos(r)}},t.y=Re,t.z=na})),n("worker",0,(function(t){class e{constructor(t){this.keyCache={},t&&this.replace(t)}replace(t){this._layerConfigs={},this._layers={},this.update(t,[])}update(e,r){for(let r of e){this._layerConfigs[r.id]=r;let e=this._layers[r.id]=t.aA(r);e._featureFilter=t.a7(e.filter),this.keyCache[r.id]&&delete this.keyCache[r.id]}for(let t of r)delete this.keyCache[t],delete this._layerConfigs[t],delete this._layers[t];this.familiesBySource={};let n=t.bk(Object.values(this._layerConfigs),this.keyCache);for(let t of n){let e=t.map((t=>this._layers[t.id])),r=e[0];if("none"===r.visibility)continue;let n=r.source||"",i=this.familiesBySource[n];i||(i=this.familiesBySource[n]={});let a=r.sourceLayer||"_geojsonTileLayer",o=i[a];o||(o=i[a]=[]),o.push(e)}}}class r{constructor(e){let r={},n=[];for(let t in e){let i=e[t],a=r[t]={};for(let t in i){let e=i[+t];if(!e||0===e.bitmap.width||0===e.bitmap.height)continue;let r={x:0,y:0,w:e.bitmap.width+2,h:e.bitmap.height+2};n.push(r),a[t]={rect:r,metrics:e.metrics}}}let{w:i,h:a}=t.p(n),o=new t.o({width:i||1,height:a||1});for(let n in e){let i=e[n];for(let e in i){let a=i[+e];if(!a||0===a.bitmap.width||0===a.bitmap.height)continue;let s=r[n][e].rect;t.o.copy(a.bitmap,o,{x:0,y:0},{x:s.x+1,y:s.y+1},a.bitmap)}}this.image=o,this.positions=r}}t.bl("GlyphAtlas",r);class n{constructor(e){this.tileID=new t.S(e.tileID.overscaledZ,e.tileID.wrap,e.tileID.canonical.z,e.tileID.canonical.x,e.tileID.canonical.y),this.uid=e.uid,this.zoom=e.zoom,this.pixelRatio=e.pixelRatio,this.tileSize=e.tileSize,this.source=e.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=e.showCollisionBoxes,this.collectResourceTiming=!!e.collectResourceTiming,this.returnDependencies=!!e.returnDependencies,this.promoteId=e.promoteId,this.inFlightDependencies=[]}parse(e,n,a,o){return t._(this,void 0,void 0,(function*(){this.status="parsing",this.data=e,this.collisionBoxArray=new t.a5;let s=new t.bm(Object.keys(e.layers).sort()),l=new t.bn(this.tileID,this.promoteId);l.bucketLayerIDs=[];let c={},u={featureIndex:l,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:a},h=n.familiesBySource[this.source];for(let r in h){let n=e.layers[r];if(!n)continue;1===n.version&&t.w(`Vector tile source "${this.source}" layer "${r}" does not use vector tile spec v2 and therefore may have some rendering errors.`);let o=s.encode(r),p=[];for(let t=0;t=r.maxzoom||"none"!==r.visibility&&(i(e,this.zoom,a),(c[r.id]=r.createBucket({index:l.bucketLayerIDs.length,layers:e,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:o,sourceID:this.source})).populate(p,u,this.tileID.canonical),l.bucketLayerIDs.push(e.map((t=>t.id))))}}let p=t.aF(u.glyphDependencies,(t=>Object.keys(t).map(Number)));this.inFlightDependencies.forEach((t=>t?.abort())),this.inFlightDependencies=[];let f=Promise.resolve({});if(Object.keys(p).length){let t=new AbortController;this.inFlightDependencies.push(t),f=o.sendAsync({type:"GG",data:{stacks:p,source:this.source,tileID:this.tileID,type:"glyphs"}},t)}let d=Object.keys(u.iconDependencies),m=Promise.resolve({});if(d.length){let t=new AbortController;this.inFlightDependencies.push(t),m=o.sendAsync({type:"GI",data:{icons:d,source:this.source,tileID:this.tileID,type:"icons"}},t)}let g=Object.keys(u.patternDependencies),y=Promise.resolve({});if(g.length){let t=new AbortController;this.inFlightDependencies.push(t),y=o.sendAsync({type:"GI",data:{icons:g,source:this.source,tileID:this.tileID,type:"patterns"}},t)}let[v,x,_]=yield Promise.all([f,m,y]),b=new r(v),w=new t.bo(x,_);for(let e in c){let r=c[e];r instanceof t.a6?(i(r.layers,this.zoom,a),t.bp({bucket:r,glyphMap:v,glyphPositions:b.positions,imageMap:x,imagePositions:w.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):r.hasPattern&&(r instanceof t.bq||r instanceof t.br||r instanceof t.bs)&&(i(r.layers,this.zoom,a),r.addFeatures(u,this.tileID.canonical,w.patternPositions))}return this.status="done",{buckets:Object.values(c).filter((t=>!t.isEmpty())),featureIndex:l,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:b.image,imageAtlas:w,glyphMap:this.returnDependencies?v:null,iconMap:this.returnDependencies?x:null,glyphPositions:this.returnDependencies?b.positions:null}}))}}function i(e,r,n){let i=new t.z(r);for(let t of e)t.recalculate(i,n)}class a{constructor(t,e,r){this.actor=t,this.layerIndex=e,this.availableImages=r,this.fetching={},this.loading={},this.loaded={}}loadVectorTile(e,r){return t._(this,void 0,void 0,(function*(){let n=yield t.l(e.request,r);try{return{vectorTile:new t.bt.VectorTile(new t.bu(n.data)),rawData:n.data,cacheControl:n.cacheControl,expires:n.expires}}catch(t){let r=new Uint8Array(n.data),i=`Unable to parse the tile at ${e.request.url}, `;throw i+=31===r[0]&&139===r[1]?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${t.message}`,new Error(i)}}))}loadTile(e){return t._(this,void 0,void 0,(function*(){let r=e.uid,i=!!(e&&e.request&&e.request.collectResourceTiming)&&new t.bv(e.request),a=new n(e);this.loading[r]=a;let o=new AbortController;a.abort=o;try{let n=yield this.loadVectorTile(e,o);if(delete this.loading[r],!n)return null;let s=n.rawData,l={};n.expires&&(l.expires=n.expires),n.cacheControl&&(l.cacheControl=n.cacheControl);let c={};if(i){let t=i.finish();t&&(c.resourceTiming=JSON.parse(JSON.stringify(t)))}a.vectorTile=n.vectorTile;let u=a.parse(n.vectorTile,this.layerIndex,this.availableImages,this.actor);this.loaded[r]=a,this.fetching[r]={rawTileData:s,cacheControl:l,resourceTiming:c};try{let e=yield u;return t.e({rawTileData:s.slice(0)},e,l,c)}finally{delete this.fetching[r]}}catch(t){throw delete this.loading[r],a.status="done",this.loaded[r]=a,t}}))}reloadTile(e){return t._(this,void 0,void 0,(function*(){let r=e.uid;if(!this.loaded||!this.loaded[r])throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");let n=this.loaded[r];if(n.showCollisionBoxes=e.showCollisionBoxes,"parsing"===n.status){let e,i=yield n.parse(n.vectorTile,this.layerIndex,this.availableImages,this.actor);if(this.fetching[r]){let{rawTileData:n,cacheControl:a,resourceTiming:o}=this.fetching[r];delete this.fetching[r],e=t.e({rawTileData:n.slice(0)},i,a,o)}else e=i;return e}if("done"===n.status&&n.vectorTile)return n.parse(n.vectorTile,this.layerIndex,this.availableImages,this.actor)}))}abortTile(e){return t._(this,void 0,void 0,(function*(){let t=this.loading,r=e.uid;t&&t[r]&&t[r].abort&&(t[r].abort.abort(),delete t[r])}))}removeTile(e){return t._(this,void 0,void 0,(function*(){this.loaded&&this.loaded[e.uid]&&delete this.loaded[e.uid]}))}}class o{constructor(){this.loaded={}}loadTile(e){return t._(this,void 0,void 0,(function*(){let{uid:r,encoding:n,rawImageData:i,redFactor:a,greenFactor:o,blueFactor:s,baseShift:l}=e,c=i.width+2,u=i.height+2,h=t.b(i)?new t.R({width:c,height:u},yield t.bw(i,-1,-1,c,u)):i,p=new t.bx(r,h,n,a,o,s,l);return this.loaded=this.loaded||{},this.loaded[r]=p,p}))}removeTile(t){let e=this.loaded,r=t.uid;e&&e[r]&&delete e[r]}}function s(t,e){if(0!==t.length){l(t[0],e);for(var r=1;r=Math.abs(s)?r-l+s:s-l+r,r=l}r+n>=0!=!!e&&t.reverse()}var c=t.by((function t(e,r){var n,i=e&&e.type;if("FeatureCollection"===i)for(n=0;n>31}function k(t,e){for(var r=t.loadGeometry(),n=t.type,i=0,a=0,o=r.length,s=0;st},C=Math.fround||(I=new Float32Array(1),t=>(I[0]=+t,I[0]));var I;class L{constructor(t){this.options=Object.assign(Object.create(E),t),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(t){let{log:e,minZoom:r,maxZoom:n}=this.options;e&&console.time("total time");let i=`prepare ${t.length} points`;e&&console.time(i),this.points=t;let a=[];for(let e=0;e=r;t--){let r=+Date.now();o=this.trees[t]=this._createTree(this._cluster(o,t)),e&&console.log("z%d: %d clusters in %dms",t,o.numItems,+Date.now()-r)}return e&&console.timeEnd("total time"),this}getClusters(t,e){let r=((t[0]+180)%360+360)%360-180,n=Math.max(-90,Math.min(90,t[1])),i=180===t[2]?180:((t[2]+180)%360+360)%360-180,a=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)r=-180,i=180;else if(r>i){let t=this.getClusters([r,n,180,a],e),o=this.getClusters([-180,n,i,a],e);return t.concat(o)}let o=this.trees[this._limitZoom(e)],s=o.range(D(r),O(a),D(i),O(n)),l=o.data,c=[];for(let t of s){let e=this.stride*t;c.push(l[e+5]>1?P(l,e,this.clusterProps):this.points[l[e+3]])}return c}getChildren(t){let e=this._getOriginId(t),r=this._getOriginZoom(t),n="No cluster with the specified id.",i=this.trees[r];if(!i)throw new Error(n);let a=i.data;if(e*this.stride>=a.length)throw new Error(n);let o=this.options.radius/(this.options.extent*Math.pow(2,r-1)),s=i.within(a[e*this.stride],a[e*this.stride+1],o),l=[];for(let e of s){let r=e*this.stride;a[r+4]===t&&l.push(a[r+5]>1?P(a,r,this.clusterProps):this.points[a[r+3]])}if(0===l.length)throw new Error(n);return l}getLeaves(t,e,r){let n=[];return this._appendLeaves(n,t,e=e||10,r=r||0,0),n}getTile(t,e,r){let n=this.trees[this._limitZoom(t)],i=Math.pow(2,t),{extent:a,radius:o}=this.options,s=o/a,l=(r-s)/i,c=(r+1+s)/i,u={features:[]};return this._addTileFeatures(n.range((e-s)/i,l,(e+1+s)/i,c),n.data,e,r,i,u),0===e&&this._addTileFeatures(n.range(1-s/i,l,1,c),n.data,i,r,i,u),e===i-1&&this._addTileFeatures(n.range(0,l,s/i,c),n.data,-1,r,i,u),u.features.length?u:null}getClusterExpansionZoom(t){let e=this._getOriginZoom(t)-1;for(;e<=this.options.maxZoom;){let r=this.getChildren(t);if(e++,1!==r.length)break;t=r[0].properties.cluster_id}return e}_appendLeaves(t,e,r,n,i){let a=this.getChildren(e);for(let e of a){let a=e.properties;if(a&&a.cluster?i+a.point_count<=n?i+=a.point_count:i=this._appendLeaves(t,a.cluster_id,r,n,i):i1;if(u)t=z(e,c,this.clusterProps),s=e[c],l=e[c+1];else{let r=this.points[e[c+3]];t=r.properties;let[n,i]=r.geometry.coordinates;s=D(n),l=O(i)}let h,p={type:1,geometry:[[Math.round(this.options.extent*(s*i-r)),Math.round(this.options.extent*(l*i-n))]],tags:t};h=u||this.options.generateId?e[c+3]:this.points[e[c+3]].id,void 0!==h&&(p.id=h),a.features.push(p)}}_limitZoom(t){return Math.max(this.options.minZoom,Math.min(Math.floor(+t),this.options.maxZoom+1))}_cluster(t,e){let{radius:r,extent:n,reduce:i,minPoints:a}=this.options,o=r/(n*Math.pow(2,e)),s=t.data,l=[],c=this.stride;for(let r=0;re&&(f+=s[r+5])}if(f>p&&f>=a){let t,a=n*p,o=u*p,d=-1,m=(r/c<<5)+(e+1)+this.points.length;for(let n of h){let l=n*c;if(s[l+2]<=e)continue;s[l+2]=e;let u=s[l+5];a+=s[l]*u,o+=s[l+1]*u,s[l+4]=m,i&&(t||(t=this._map(s,r,!0),d=this.clusterProps.length,this.clusterProps.push(t)),i(t,this._map(s,l)))}s[r+4]=m,l.push(a/f,o/f,1/0,m,-1,f),i&&l.push(d)}else{for(let t=0;t1)for(let t of h){let r=t*c;if(!(s[r+2]<=e)){s[r+2]=e;for(let t=0;t>5}_getOriginZoom(t){return(t-this.points.length)%32}_map(t,e,r){if(t[e+5]>1){let n=this.clusterProps[t[e+6]];return r?Object.assign({},n):n}let n=this.points[t[e+3]].properties,i=this.options.map(n);return r&&i===n?Object.assign({},i):i}}function P(t,e,r){return{type:"Feature",id:t[e+3],properties:z(t,e,r),geometry:{type:"Point",coordinates:[(n=t[e],360*(n-.5)),R(t[e+1])]}};var n}function z(t,e,r){let n=t[e+5],i=n>=1e4?`${Math.round(n/1e3)}k`:n>=1e3?Math.round(n/100)/10+"k":n,a=t[e+6],o=-1===a?{}:Object.assign({},r[a]);return Object.assign(o,{cluster:!0,cluster_id:t[e+3],point_count:n,point_count_abbreviated:i})}function D(t){return t/360+.5}function O(t){let e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function R(t){let e=(180-360*t)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}function F(t,e,r,n){let i,a=n,o=e+(r-e>>1),s=r-e,l=t[e],c=t[e+1],u=t[r],h=t[r+1];for(let n=e+3;na)i=n,a=e;else if(e===a){let t=Math.abs(n-o);tn&&(i-e>3&&F(t,e,i,n),t[i+2]=a,r-i>3&&F(t,i,r,n))}function B(t,e,r,n,i,a){let o=i-r,s=a-n;if(0!==o||0!==s){let l=((t-r)*o+(e-n)*s)/(o*o+s*s);l>1?(r=i,n=a):l>0&&(r+=o*l,n+=s*l)}return o=t-r,s=e-n,o*o+s*s}function j(t,e,r,n){let i={id:t??null,type:e,geometry:r,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if("Point"===e||"MultiPoint"===e||"LineString"===e)N(i,r);else if("Polygon"===e)N(i,r[0]);else if("MultiLineString"===e)for(let t of r)N(i,t);else if("MultiPolygon"===e)for(let t of r)N(i,t[0]);return i}function N(t,e){for(let r=0;r0&&(o+=n?(i*l-s*a)/2:Math.sqrt(Math.pow(s-i,2)+Math.pow(l-a,2))),i=s,a=l}let s=e.length-3;e[2]=1,F(e,0,s,r),e[s+2]=1,e.size=Math.abs(o),e.start=0,e.end=e.size}function H(t,e,r,n){for(let i=0;i1?1:r}function Z(t,e,r,n,i,a,o,s){if(n/=e,a>=(r/=e)&&o=n)return null;let l=[];for(let e of t){let t=e.geometry,a=e.type,o=0===i?e.minX:e.minY,c=0===i?e.maxX:e.maxY;if(o>=r&&c=n)continue;let u=[];if("Point"===a||"MultiPoint"===a)Y(t,u,r,n,i);else if("LineString"===a)X(t,u,r,n,i,!1,s.lineMetrics);else if("MultiLineString"===a)K(t,u,r,n,i,!1);else if("Polygon"===a)K(t,u,r,n,i,!0);else if("MultiPolygon"===a)for(let e of t){let t=[];K(e,t,r,n,i,!0),t.length&&u.push(t)}if(u.length){if(s.lineMetrics&&"LineString"===a){for(let t of u)l.push(j(e.id,a,t,e.tags));continue}"LineString"!==a&&"MultiLineString"!==a||(1===u.length?(a="LineString",u=u[0]):a="MultiLineString"),"Point"!==a&&"MultiPoint"!==a||(a=3===u.length?"Point":"MultiPoint"),l.push(j(e.id,a,u,e.tags))}}return l.length?l:null}function Y(t,e,r,n,i){for(let a=0;a=r&&o<=n&&J(e,t[a],t[a+1],t[a+2])}}function X(t,e,r,n,i,a,o){let s,l,c=$(t),u=0===i?Q:tt,h=t.start;for(let p=0;pr&&(l=u(c,f,d,g,y,r),o&&(c.start=h+s*l)):v>n?x=r&&(l=u(c,f,d,g,y,r),_=!0),x>n&&v<=n&&(l=u(c,f,d,g,y,n),_=!0),!a&&_&&(o&&(c.end=h+s*l),e.push(c),c=$(t)),o&&(h+=s)}let p=t.length-3,f=t[p],d=t[p+1],m=0===i?f:d;m>=r&&m<=n&&J(c,f,d,t[p+2]),p=c.length-3,a&&p>=3&&(c[p]!==c[0]||c[p+1]!==c[1])&&J(c,c[0],c[1],c[2]),c.length&&e.push(c)}function $(t){let e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function K(t,e,r,n,i,a){for(let o of t)X(o,e,r,n,i,a,!1)}function J(t,e,r,n){t.push(e,r,n)}function Q(t,e,r,n,i,a){let o=(a-e)/(n-e);return J(t,a,r+(i-r)*o,1),o}function tt(t,e,r,n,i,a){let o=(a-r)/(i-r);return J(t,e+(n-e)*o,a,1),o}function et(t,e){let r=[];for(let n=0;n0&&e.size<(i?o:n))return void(r.numPoints+=e.length/3);let s=[];for(let t=0;to)&&(r.numSimplified++,s.push(e[t],e[t+1])),r.numPoints++;i&&function(t,e){let r=0;for(let e=0,n=t.length,i=n-2;e0===e)for(let e=0,r=t.length;e24)throw new Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw new Error("promoteId and generateId cannot be used together.");let n=function(t,e){let r=[];if("FeatureCollection"===t.type)for(let n=0;n1&&console.time("creation"),p=this.tiles[h]=at(t,e,r,n,l),this.tileCoords.push({z:e,x:r,y:n}),c)){c>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,r,n,p.numFeatures,p.numPoints,p.numSimplified),console.timeEnd("creation"));let t=`z${e}`;this.stats[t]=(this.stats[t]||0)+1,this.total++}if(p.source=t,null==i){if(e===l.indexMaxZoom||p.numPoints<=l.indexMaxPoints)continue}else{if(e===l.maxZoom||e===i)continue;if(null!=i){let t=i-e;if(r!==a>>t||n!==o>>t)continue}}if(p.source=null,0===t.length)continue;c>1&&console.time("clipping");let f=.5*l.buffer/l.extent,d=.5-f,m=.5+f,g=1+f,y=null,v=null,x=null,_=null,b=Z(t,u,r-f,r+m,0,p.minX,p.maxX,l),w=Z(t,u,r+d,r+g,0,p.minX,p.maxX,l);t=null,b&&(y=Z(b,u,n-f,n+m,1,p.minY,p.maxY,l),v=Z(b,u,n+d,n+g,1,p.minY,p.maxY,l),b=null),w&&(x=Z(w,u,n-f,n+m,1,p.minY,p.maxY,l),_=Z(w,u,n+d,n+g,1,p.minY,p.maxY,l),w=null),c>1&&console.timeEnd("clipping"),s.push(y||[],e+1,2*r,2*n),s.push(v||[],e+1,2*r,2*n+1),s.push(x||[],e+1,2*r+1,2*n),s.push(_||[],e+1,2*r+1,2*n+1)}}getTile(t,e,r){t=+t,e=+e,r=+r;let n=this.options,{extent:i,debug:a}=n;if(t<0||t>24)return null;let o=1<1&&console.log("drilling down to z%d-%d-%d",t,e,r);let l,c=t,u=e,h=r;for(;!l&&c>0;)c--,u>>=1,h>>=1,l=this.tiles[ut(c,u,h)];return l&&l.source?(a>1&&(console.log("found parent tile z%d-%d-%d",c,u,h),console.time("drilling down")),this.splitTile(l.source,c,u,h,t,e,r),a>1&&console.timeEnd("drilling down"),this.tiles[s]?nt(this.tiles[s],i):null):null}}function ut(t,e,r){return 32*((1<{o.properties=t;let e={};for(let t of s)e[t]=n[t].evaluate(a,o);return e},e.reduce=(t,e)=>{o.properties=e;for(let e of s)a.accumulated=t[e],t[e]=i[e].evaluate(a,o)},e}(e)).load((yield this._pendingData).features):(i=yield this._pendingData,new ct(i,e.geojsonVtOptions)),this.loaded={};let r={};if(n){let t=n.finish();t&&(r.resourceTiming={},r.resourceTiming[e.source]=JSON.parse(JSON.stringify(t)))}return r}catch(e){if(delete this._pendingRequest,t.bB(e))return{abandoned:!0};throw e}var i}))}getData(){return t._(this,void 0,void 0,(function*(){return this._pendingData}))}reloadTile(t){let e=this.loaded;return e&&e[t.uid]?super.reloadTile(t):this.loadTile(t)}loadAndProcessGeoJSON(e,r){return t._(this,void 0,void 0,(function*(){let n=yield this.loadGeoJSON(e,r);if(delete this._pendingRequest,"object"!=typeof n)throw new Error(`Input data given to '${e.source}' is not a valid GeoJSON object.`);if(c(n,!0),e.filter){let r=t.bC(e.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if("error"===r.result)throw new Error(r.value.map((t=>`${t.key}: ${t.message}`)).join(", "));n={type:"FeatureCollection",features:n.features.filter((t=>r.value.evaluate({zoom:0},t)))}}return n}))}loadGeoJSON(e,r){return t._(this,void 0,void 0,(function*(){let{promoteId:n}=e;if(e.request){let i=yield t.h(e.request,r);return this._dataUpdateable=pt(i.data,n)?ft(i.data,n):void 0,i.data}if("string"==typeof e.data)try{let t=JSON.parse(e.data);return this._dataUpdateable=pt(t,n)?ft(t,n):void 0,t}catch{throw new Error(`Input data given to '${e.source}' is not a valid GeoJSON object.`)}if(!e.dataDiff)throw new Error(`Input data given to '${e.source}' is not a valid GeoJSON object.`);if(!this._dataUpdateable)throw new Error(`Cannot update existing geojson data in ${e.source}`);return function(t,e,r){var n,i,a,o;if(e.removeAll&&t.clear(),e.remove)for(let r of e.remove)t.delete(r);if(e.add)for(let n of e.add){let e=ht(n,r);null!=e&&t.set(e,n)}if(e.update)for(let r of e.update){let e=t.get(r.id);if(null==e)continue;let s=!r.removeAllProperties&&((null===(n=r.removeProperties)||void 0===n?void 0:n.length)>0||(null===(i=r.addOrUpdateProperties)||void 0===i?void 0:i.length)>0);if((r.newGeometry||r.removeAllProperties||s)&&(e=Object.assign({},e),t.set(r.id,e),s&&(e.properties=Object.assign({},e.properties))),r.newGeometry&&(e.geometry=r.newGeometry),r.removeAllProperties)e.properties={};else if((null===(a=r.removeProperties)||void 0===a?void 0:a.length)>0)for(let t of r.removeProperties)Object.prototype.hasOwnProperty.call(e.properties,t)&&delete e.properties[t];if((null===(o=r.addOrUpdateProperties)||void 0===o?void 0:o.length)>0)for(let{key:t,value:n}of r.addOrUpdateProperties)e.properties[t]=n}}(this._dataUpdateable,e.dataDiff,n),{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())}}))}removeSource(e){return t._(this,void 0,void 0,(function*(){this._pendingRequest&&this._pendingRequest.abort()}))}getClusterExpansionZoom(t){return this._geoJSONIndex.getClusterExpansionZoom(t.clusterId)}getClusterChildren(t){return this._geoJSONIndex.getChildren(t.clusterId)}getClusterLeaves(t){return this._geoJSONIndex.getLeaves(t.clusterId,t.limit,t.offset)}}class mt{constructor(e){this.self=e,this.actor=new t.F(e),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.self.registerWorkerSource=(t,e)=>{if(this.externalWorkerSourceTypes[t])throw new Error(`Worker source with name "${t}" already registered.`);this.externalWorkerSourceTypes[t]=e},this.self.addProtocol=t.bi,this.self.removeProtocol=t.bj,this.self.registerRTLTextPlugin=e=>{if(t.bD.isParsed())throw new Error("RTL text plugin already registered.");t.bD.setMethods(e)},this.actor.registerMessageHandler("LDT",((t,e)=>this._getDEMWorkerSource(t,e.source).loadTile(e))),this.actor.registerMessageHandler("RDT",((e,r)=>t._(this,void 0,void 0,(function*(){this._getDEMWorkerSource(e,r.source).removeTile(r)})))),this.actor.registerMessageHandler("GCEZ",((e,r)=>t._(this,void 0,void 0,(function*(){return this._getWorkerSource(e,r.type,r.source).getClusterExpansionZoom(r)})))),this.actor.registerMessageHandler("GCC",((e,r)=>t._(this,void 0,void 0,(function*(){return this._getWorkerSource(e,r.type,r.source).getClusterChildren(r)})))),this.actor.registerMessageHandler("GCL",((e,r)=>t._(this,void 0,void 0,(function*(){return this._getWorkerSource(e,r.type,r.source).getClusterLeaves(r)})))),this.actor.registerMessageHandler("LD",((t,e)=>this._getWorkerSource(t,e.type,e.source).loadData(e))),this.actor.registerMessageHandler("GD",((t,e)=>this._getWorkerSource(t,e.type,e.source).getData())),this.actor.registerMessageHandler("LT",((t,e)=>this._getWorkerSource(t,e.type,e.source).loadTile(e))),this.actor.registerMessageHandler("RT",((t,e)=>this._getWorkerSource(t,e.type,e.source).reloadTile(e))),this.actor.registerMessageHandler("AT",((t,e)=>this._getWorkerSource(t,e.type,e.source).abortTile(e))),this.actor.registerMessageHandler("RMT",((t,e)=>this._getWorkerSource(t,e.type,e.source).removeTile(e))),this.actor.registerMessageHandler("RS",((e,r)=>t._(this,void 0,void 0,(function*(){if(!this.workerSources[e]||!this.workerSources[e][r.type]||!this.workerSources[e][r.type][r.source])return;let t=this.workerSources[e][r.type][r.source];delete this.workerSources[e][r.type][r.source],void 0!==t.removeSource&&t.removeSource(r)})))),this.actor.registerMessageHandler("RM",(e=>t._(this,void 0,void 0,(function*(){delete this.layerIndexes[e],delete this.availableImages[e],delete this.workerSources[e],delete this.demWorkerSources[e]})))),this.actor.registerMessageHandler("SR",((e,r)=>t._(this,void 0,void 0,(function*(){this.referrer=r})))),this.actor.registerMessageHandler("SRPS",((t,e)=>this._syncRTLPluginState(t,e))),this.actor.registerMessageHandler("IS",((e,r)=>t._(this,void 0,void 0,(function*(){this.self.importScripts(r)})))),this.actor.registerMessageHandler("SI",((t,e)=>this._setImages(t,e))),this.actor.registerMessageHandler("UL",((e,r)=>t._(this,void 0,void 0,(function*(){this._getLayerIndex(e).update(r.layers,r.removedIds)})))),this.actor.registerMessageHandler("SL",((e,r)=>t._(this,void 0,void 0,(function*(){this._getLayerIndex(e).replace(r)}))))}_setImages(e,r){return t._(this,void 0,void 0,(function*(){this.availableImages[e]=r;for(let t in this.workerSources[e]){let n=this.workerSources[e][t];for(let t in n)n[t].availableImages=r}}))}_syncRTLPluginState(e,r){return t._(this,void 0,void 0,(function*(){if(t.bD.isParsed())return t.bD.getState();if("loading"!==r.pluginStatus)return t.bD.setState(r),r;let e=r.pluginURL;if(this.self.importScripts(e),t.bD.isParsed()){let r={pluginStatus:"loaded",pluginURL:e};return t.bD.setState(r),r}throw t.bD.setState({pluginStatus:"error",pluginURL:""}),new Error(`RTL Text Plugin failed to import scripts from ${e}`)}))}_getAvailableImages(t){let e=this.availableImages[t];return e||(e=[]),e}_getLayerIndex(t){let r=this.layerIndexes[t];return r||(r=this.layerIndexes[t]=new e),r}_getWorkerSource(t,e,r){if(this.workerSources[t]||(this.workerSources[t]={}),this.workerSources[t][e]||(this.workerSources[t][e]={}),!this.workerSources[t][e][r]){let n={sendAsync:(e,r)=>(e.targetMapId=t,this.actor.sendAsync(e,r))};switch(e){case"vector":this.workerSources[t][e][r]=new a(n,this._getLayerIndex(t),this._getAvailableImages(t));break;case"geojson":this.workerSources[t][e][r]=new dt(n,this._getLayerIndex(t),this._getAvailableImages(t));break;default:this.workerSources[t][e][r]=new this.externalWorkerSourceTypes[e](n,this._getLayerIndex(t),this._getAvailableImages(t))}}return this.workerSources[t][e][r]}_getDEMWorkerSource(t,e){return this.demWorkerSources[t]||(this.demWorkerSources[t]={}),this.demWorkerSources[t][e]||(this.demWorkerSources[t][e]=new o),this.demWorkerSources[t][e]}}return t.i(self)&&(self.worker=new mt(self)),mt})),n("index",0,(function(t,e){var r="4.7.1";let n,i,a={now:typeof performance<"u"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frameAsync:t=>new Promise(((r,n)=>{let i=requestAnimationFrame(r);t.signal.addEventListener("abort",(()=>{cancelAnimationFrame(i),n(e.c())}))})),getImageData(t,e=0){return this.getImageCanvasContext(t).getImageData(-e,-e,t.width+2*e,t.height+2*e)},getImageCanvasContext(t){let e=window.document.createElement("canvas"),r=e.getContext("2d",{willReadFrequently:!0});if(!r)throw new Error("failed to create canvas 2d context");return e.width=t.width,e.height=t.height,r.drawImage(t,0,0,t.width,t.height),r},resolveURL:t=>(n||(n=document.createElement("a")),n.href=t,n.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(null==i&&(i=matchMedia("(prefers-reduced-motion: reduce)")),i.matches)}};class o{static testProp(t){if(!o.docStyle)return t[0];for(let e=0;e{window.removeEventListener("click",o.suppressClickInternal,!0)}),0)}static getScale(t){let e=t.getBoundingClientRect();return{x:e.width/t.offsetWidth||1,y:e.height/t.offsetHeight||1,boundingClientRect:e}}static getPoint(t,r,n){let i=r.boundingClientRect;return new e.P((n.clientX-i.left)/r.x-t.clientLeft,(n.clientY-i.top)/r.y-t.clientTop)}static mousePos(t,e){let r=o.getScale(t);return o.getPoint(t,r,e)}static touchPos(t,e){let r=[],n=o.getScale(t);for(let i=0;i{s&&p(s),s=null,h=!0},l.onerror=()=>{u=!0,s=null},l.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="),function(t){let r,n,i,a;t.resetRequestQueue=()=>{r=[],n=0,i=0,a={}},t.addThrottleControl=t=>{let e=i++;return a[e]=t,e},t.removeThrottleControl=t=>{delete a[t],s()},t.getImage=(t,n,i=!0)=>new Promise(((a,o)=>{c.supported&&(t.headers||(t.headers={}),t.headers.accept="image/webp,*/*"),e.e(t,{type:"image"}),r.push({abortController:n,requestParameters:t,supportImageRefresh:i,state:"queued",onError:t=>{o(t)},onSuccess:t=>{a(t)}}),s()}));let o=t=>e._(this,void 0,void 0,(function*(){t.state="running";let{requestParameters:r,supportImageRefresh:i,onError:a,onSuccess:o,abortController:c}=t,u=!1===i&&!e.i(self)&&!e.g(r.url)&&(!r.headers||Object.keys(r.headers).reduce(((t,e)=>t&&"accept"===e),!0));n++;let h=u?l(r,c):e.m(r,c);try{let r=yield h;delete t.abortController,t.state="completed",r.data instanceof HTMLImageElement||e.b(r.data)?o(r):r.data&&o({data:yield(p=r.data,"function"==typeof createImageBitmap?e.d(p):e.f(p)),cacheControl:r.cacheControl,expires:r.expires})}catch(e){delete t.abortController,a(e)}finally{n--,s()}var p})),s=()=>{let t=(()=>{for(let t of Object.keys(a))if(a[t]())return!0;return!1})()?e.a.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:e.a.MAX_PARALLEL_IMAGE_REQUESTS;for(let e=n;e0;e++){let t=r.shift();t.abortController.signal.aborted?e--:o(t)}},l=(t,r)=>new Promise(((n,i)=>{let a=new Image,o=t.url,s=t.credentials;s&&"include"===s?a.crossOrigin="use-credentials":(s&&"same-origin"===s||!e.s(o))&&(a.crossOrigin="anonymous"),r.signal.addEventListener("abort",(()=>{a.src="",i(e.c())})),a.fetchPriority="high",a.onload=()=>{a.onerror=a.onload=null,n({data:a})},a.onerror=()=>{a.onerror=a.onload=null,r.signal.aborted||i(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))},a.src=o}))}(f||(f={})),f.resetRequestQueue();class d{constructor(t){this._transformRequestFn=t}transformRequest(t,e){return this._transformRequestFn&&this._transformRequestFn(t,e)||{url:t}}setTransformRequest(t){this._transformRequestFn=t}}function m(t){var r=new e.A(3);return r[0]=t[0],r[1]=t[1],r[2]=t[2],r}var g,y=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t};g=new e.A(3),e.A!=Float32Array&&(g[0]=0,g[1]=0,g[2]=0);var v,x=function(t){var e=t[0],r=t[1];return e*e+r*r};function _(t){let e=[];if("string"==typeof t)e.push({id:"default",url:t});else if(t&&t.length>0){let r=[];for(let{id:n,url:i}of t){let t=`${n}${i}`;-1===r.indexOf(t)&&(r.push(t),e.push({id:n,url:i}))}}return e}function b(t,e,r){let n=t.split("?");return n[0]+=`${e}${r}`,n.join("?")}v=new e.A(2),e.A!=Float32Array&&(v[0]=0,v[1]=0);class w{constructor(t,e,r,n){this.context=t,this.format=r,this.texture=t.gl.createTexture(),this.update(e,n)}update(t,r,n){let{width:i,height:a}=t,o=!(this.size&&this.size[0]===i&&this.size[1]===a||n),{context:s}=this,{gl:l}=s;if(this.useMipmap=!(!r||!r.useMipmap),l.bindTexture(l.TEXTURE_2D,this.texture),s.pixelStoreUnpackFlipY.set(!1),s.pixelStoreUnpack.set(1),s.pixelStoreUnpackPremultiplyAlpha.set(this.format===l.RGBA&&(!r||!1!==r.premultiply)),o)this.size=[i,a],t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageData||e.b(t)?l.texImage2D(l.TEXTURE_2D,0,this.format,this.format,l.UNSIGNED_BYTE,t):l.texImage2D(l.TEXTURE_2D,0,this.format,i,a,0,this.format,l.UNSIGNED_BYTE,t.data);else{let{x:r,y:o}=n||{x:0,y:0};t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageData||e.b(t)?l.texSubImage2D(l.TEXTURE_2D,0,r,o,l.RGBA,l.UNSIGNED_BYTE,t):l.texSubImage2D(l.TEXTURE_2D,0,r,o,i,a,l.RGBA,l.UNSIGNED_BYTE,t.data)}this.useMipmap&&this.isSizePowerOfTwo()&&l.generateMipmap(l.TEXTURE_2D)}bind(t,e,r){let{context:n}=this,{gl:i}=n;i.bindTexture(i.TEXTURE_2D,this.texture),r!==i.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(r=i.LINEAR),t!==this.filter&&(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,t),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,r||t),this.filter=t),e!==this.wrap&&(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,e),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,e),this.wrap=e)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){let{gl:t}=this.context;t.deleteTexture(this.texture),this.texture=null}}function T(t){let{userImage:e}=t;return!!(e&&e.render&&e.render())&&(t.data.replace(new Uint8Array(e.data.buffer)),!0)}class A extends e.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new e.R({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(t){if(this.loaded!==t&&(this.loaded=t,t)){for(let{ids:t,promiseResolve:e}of this.requestors)e(this._getImagesForIds(t));this.requestors=[]}}getImage(t){let r=this.images[t];if(r&&!r.data&&r.spriteData){let t=r.spriteData;r.data=new e.R({width:t.width,height:t.height},t.context.getImageData(t.x,t.y,t.width,t.height).data),r.spriteData=null}return r}addImage(t,e){if(this.images[t])throw new Error(`Image id ${t} already exist, use updateImage instead`);this._validate(t,e)&&(this.images[t]=e)}_validate(t,r){let n=!0,i=r.data||r.spriteData;return this._validateStretch(r.stretchX,i&&i.width)||(this.fire(new e.j(new Error(`Image "${t}" has invalid "stretchX" value`))),n=!1),this._validateStretch(r.stretchY,i&&i.height)||(this.fire(new e.j(new Error(`Image "${t}" has invalid "stretchY" value`))),n=!1),this._validateContent(r.content,r)||(this.fire(new e.j(new Error(`Image "${t}" has invalid "content" value`))),n=!1),n}_validateStretch(t,e){if(!t)return!0;let r=0;for(let n of t){if(n[0]{let n=!0;if(!this.isLoaded())for(let e of t)this.images[e]||(n=!1);this.isLoaded()||n?e(this._getImagesForIds(t)):this.requestors.push({ids:t,promiseResolve:e})}))}_getImagesForIds(t){let r={};for(let n of t){let t=this.getImage(n);t||(this.fire(new e.k("styleimagemissing",{id:n})),t=this.getImage(n)),t?r[n]={data:t.data.clone(),pixelRatio:t.pixelRatio,sdf:t.sdf,version:t.version,stretchX:t.stretchX,stretchY:t.stretchY,content:t.content,textFitWidth:t.textFitWidth,textFitHeight:t.textFitHeight,hasRenderCallback:!(!t.userImage||!t.userImage.render)}:e.w(`Image "${n}" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.`)}return r}getPixelSize(){let{width:t,height:e}=this.atlasImage;return{width:t,height:e}}getPattern(t){let r=this.patterns[t],n=this.getImage(t);if(!n)return null;if(r&&r.position.version===n.version)return r.position;if(r)r.position.version=n.version;else{let r={w:n.data.width+2,h:n.data.height+2,x:0,y:0},i=new e.I(r,n);this.patterns[t]={bin:r,position:i}}return this._updatePatternAtlas(),this.patterns[t].position}bind(t){let e=t.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new w(t,this.atlasImage,e.RGBA),this.atlasTexture.bind(e.LINEAR,e.CLAMP_TO_EDGE)}_updatePatternAtlas(){let t=[];for(let e in this.patterns)t.push(this.patterns[e].bin);let{w:r,h:n}=e.p(t),i=this.atlasImage;i.resize({width:r||1,height:n||1});for(let t in this.patterns){let{bin:r}=this.patterns[t],n=r.x+1,a=r.y+1,o=this.getImage(t).data,s=o.width,l=o.height;e.R.copy(o,i,{x:0,y:0},{x:n,y:a},{width:s,height:l}),e.R.copy(o,i,{x:0,y:l-1},{x:n,y:a-1},{width:s,height:1}),e.R.copy(o,i,{x:0,y:0},{x:n,y:a+l},{width:s,height:1}),e.R.copy(o,i,{x:s-1,y:0},{x:n-1,y:a},{width:1,height:l}),e.R.copy(o,i,{x:0,y:0},{x:n+s,y:a},{width:1,height:l})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(t){for(let r of t){if(this.callbackDispatchedThisFrame[r])continue;this.callbackDispatchedThisFrame[r]=!0;let t=this.getImage(r);t||e.w(`Image with ID: "${r}" was not found`),T(t)&&this.updateImage(r,t)}}}let k,M=1e20;function S(t,e,r,n,i,a,o,s,l){for(let c=e;c-1);l++,a[l]=s,o[l]=c,o[l+1]=M}for(let s=0,l=0;s65535)throw new Error("glyphs > 65535 not supported");if(e.ranges[i])return{stack:t,id:r,glyph:n};if(!this.url)throw new Error("glyphsUrl is not set");if(!e.requests[i]){let r=C.loadGlyphRange(t,i,this.url,this.requestManager);e.requests[i]=r}let a=yield e.requests[i];for(let t in a)this._doesCharSupportLocalGlyph(+t)||(e.glyphs[+t]=a[+t]);return e.ranges[i]=!0,{stack:t,id:r,glyph:a[r]||null}}))}_doesCharSupportLocalGlyph(t){return!!this.localIdeographFontFamily&&new RegExp("\\p{Ideo}|\\p{sc=Hang}|\\p{sc=Hira}|\\p{sc=Kana}","u").test(String.fromCodePoint(t))}_tinySDF(t,r,n){let i=this.localIdeographFontFamily;if(!i||!this._doesCharSupportLocalGlyph(n))return;let a=t.tinySDF;if(!a){let e="400";/bold/i.test(r)?e="900":/medium/i.test(r)?e="500":/light/i.test(r)&&(e="200"),a=t.tinySDF=new C.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:i,fontWeight:e})}let o=a.draw(String.fromCharCode(n));return{id:n,bitmap:new e.o({width:o.width||60,height:o.height||60},o.data),metrics:{width:o.glyphWidth/2||24,height:o.glyphHeight/2||24,left:o.glyphLeft/2+.5||0,top:o.glyphTop/2-27.5||-8,advance:o.glyphAdvance/2||24,isDoubleResolution:!0}}}}C.loadGlyphRange=function(t,r,n,i){return e._(this,void 0,void 0,(function*(){let a=256*r,o=a+255,s=i.transformRequest(n.replace("{fontstack}",t).replace("{range}",`${a}-${o}`),"Glyphs"),l=yield e.l(s,new AbortController);if(!l||!l.data)throw new Error(`Could not load glyph range. range: ${r}, ${a}-${o}`);let c={};for(let t of e.n(l.data))c[t.id]=t;return c}))},C.TinySDF=class{constructor({fontSize:t=24,buffer:e=3,radius:r=8,cutoff:n=.25,fontFamily:i="sans-serif",fontWeight:a="normal",fontStyle:o="normal"}={}){this.buffer=e,this.cutoff=n,this.radius=r;let s=this.size=t+4*e,l=this._createCanvas(s),c=this.ctx=l.getContext("2d",{willReadFrequently:!0});c.font=`${o} ${a} ${t}px ${i}`,c.textBaseline="alphabetic",c.textAlign="left",c.fillStyle="black",this.gridOuter=new Float64Array(s*s),this.gridInner=new Float64Array(s*s),this.f=new Float64Array(s),this.z=new Float64Array(s+1),this.v=new Uint16Array(s)}_createCanvas(t){let e=document.createElement("canvas");return e.width=e.height=t,e}draw(t){let{width:e,actualBoundingBoxAscent:r,actualBoundingBoxDescent:n,actualBoundingBoxLeft:i,actualBoundingBoxRight:a}=this.ctx.measureText(t),o=Math.ceil(r),s=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(a-i))),l=Math.min(this.size-this.buffer,o+Math.ceil(n)),c=s+2*this.buffer,u=l+2*this.buffer,h=Math.max(c*u,0),p=new Uint8ClampedArray(h),f={data:p,width:c,height:u,glyphWidth:s,glyphHeight:l,glyphTop:o,glyphLeft:0,glyphAdvance:e};if(0===s||0===l)return f;let{ctx:d,buffer:m,gridInner:g,gridOuter:y}=this;d.clearRect(m,m,s,l),d.fillText(t,m,m+o);let v=d.getImageData(m,m,s,l);y.fill(M,0,h),g.fill(0,0,h);for(let t=0;t0?t*t:0,g[n]=t<0?t*t:0}}S(y,0,0,c,u,c,this.f,this.v,this.z),S(g,m,m,s,l,c,this.f,this.v,this.z);for(let t=0;t1&&(o=t[++a]);let l,c=Math.abs(s-o.left),u=Math.abs(s-o.right),h=Math.min(c,u),p=e/r*(n+1);if(o.isDash){let t=n-Math.abs(p);l=Math.sqrt(h*h+t*t)}else l=n-Math.sqrt(h*h+p*p);this.data[i+s]=Math.max(0,Math.min(255,l+128))}}}addRegularDash(t){for(let e=t.length-1;e>=0;--e){let r=t[e],n=t[e+1];r.zeroLength?t.splice(e,1):n&&n.isDash===r.isDash&&(n.left=r.left,t.splice(e,1))}let e=t[0],r=t[t.length-1];e.isDash===r.isDash&&(e.left=r.left-this.width,r.right=e.right+this.width);let n=this.width*this.nextRow,i=0,a=t[i];for(let e=0;e1&&(a=t[++i]);let r=Math.abs(e-a.left),o=Math.abs(e-a.right),s=Math.min(r,o);this.data[n+e]=Math.max(0,Math.min(255,(a.isDash?s:-s)+128))}}addDash(t,r){let n=r?7:0,i=2*n+1;if(this.nextRow+i>this.height)return e.w("LineAtlas out of space"),null;let a=0;for(let e=0;e{t.terminate()})),this.workers=null)}isPreloaded(){return!!this.active[O]}numActive(){return Object.keys(this.active).length}}let F,B,j=Math.floor(a.hardwareConcurrency/2);function N(){return F||(F=new R),F}R.workerCount=e.C(globalThis)?Math.max(Math.min(j,3),1):1;class U{constructor(t,r){this.workerPool=t,this.actors=[],this.currentActor=0,this.id=r;let n=this.workerPool.acquire(r);for(let t=0;t{t.remove()})),this.actors=[],t&&this.workerPool.release(this.id)}registerMessageHandler(t,e){for(let r of this.actors)r.registerMessageHandler(t,e)}}function V(){return B||(B=new U(N(),e.G),B.registerMessageHandler("GR",((t,r,n)=>e.m(r,n)))),B}function q(t,r){let n=e.H();return e.J(n,n,[1,1,0]),e.K(n,n,[.5*t.width,.5*t.height,1]),e.L(n,n,t.calculatePosMatrix(r.toUnwrapped()))}function H(t,e,r,n,i,a){let o=function(t,e,r){if(t)for(let n of t){let t=e[n];if(t&&t.source===r&&"fill-extrusion"===t.type)return!0}else for(let t in e){let n=e[t];if(n.source===r&&"fill-extrusion"===n.type)return!0}return!1}(i&&i.layers,e,t.id),s=a.maxPitchScaleFactor(),l=t.tilesIn(n,s,o);l.sort(G);let c=[];for(let n of l)c.push({wrappedTileID:n.tileID.wrapped().key,queryResults:n.tile.queryRenderedFeatures(e,r,t._state,n.queryGeometry,n.cameraQueryGeometry,n.scale,i,a,s,q(t.transform,n.tileID))});let u=function(t){let e={},r={};for(let n of t){let t=n.queryResults,i=n.wrappedTileID,a=r[i]=r[i]||{};for(let r in t){let n=t[r],i=a[r]=a[r]||{},o=e[r]=e[r]||[];for(let t of n)i[t.featureIndex]||(i[t.featureIndex]=!0,o.push(t))}}return e}(c);for(let e in u)u[e].forEach((e=>{let r=e.feature,n=t.getFeatureState(r.layer["source-layer"],r.id);r.source=r.layer.source,r.layer["source-layer"]&&(r.sourceLayer=r.layer["source-layer"]),r.state=n}));return u}function G(t,e){let r=t.tileID,n=e.tileID;return r.overscaledZ-n.overscaledZ||r.canonical.y-n.canonical.y||r.wrap-n.wrap||r.canonical.x-n.canonical.x}function W(t,r,n){return e._(this,void 0,void 0,(function*(){let i=t;if(t.url?i=(yield e.h(r.transformRequest(t.url,"Source"),n)).data:yield a.frameAsync(n),!i)return null;let o=e.M(e.e(i,t),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in i&&i.vector_layers&&(o.vectorLayerIds=i.vector_layers.map((t=>t.id))),o}))}class Z{constructor(t,e){t&&(e?this.setSouthWest(t).setNorthEast(e):Array.isArray(t)&&(4===t.length?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1])))}setNorthEast(t){return this._ne=t instanceof e.N?new e.N(t.lng,t.lat):e.N.convert(t),this}setSouthWest(t){return this._sw=t instanceof e.N?new e.N(t.lng,t.lat):e.N.convert(t),this}extend(t){let r,n,i=this._sw,a=this._ne;if(t instanceof e.N)r=t,n=t;else{if(!(t instanceof Z))return Array.isArray(t)?4===t.length||t.every(Array.isArray)?this.extend(Z.convert(t)):this.extend(e.N.convert(t)):t&&("lng"in t||"lon"in t)&&"lat"in t?this.extend(e.N.convert(t)):this;if(r=t._sw,n=t._ne,!r||!n)return this}return i||a?(i.lng=Math.min(r.lng,i.lng),i.lat=Math.min(r.lat,i.lat),a.lng=Math.max(n.lng,a.lng),a.lat=Math.max(n.lat,a.lat)):(this._sw=new e.N(r.lng,r.lat),this._ne=new e.N(n.lng,n.lat)),this}getCenter(){return new e.N((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new e.N(this.getWest(),this.getNorth())}getSouthEast(){return new e.N(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(t){let{lng:r,lat:n}=e.N.convert(t),i=this._sw.lng<=r&&r<=this._ne.lng;return this._sw.lng>this._ne.lng&&(i=this._sw.lng>=r&&r>=this._ne.lng),this._sw.lat<=n&&n<=this._ne.lat&&i}static convert(t){return t instanceof Z?t:t&&new Z(t)}static fromLngLat(t,r=0){let n=360*r/40075017,i=n/Math.cos(Math.PI/180*t.lat);return new Z(new e.N(t.lng-i,t.lat-n),new e.N(t.lng+i,t.lat+n))}adjustAntiMeridian(){let t=new e.N(this._sw.lng,this._sw.lat),r=new e.N(this._ne.lng,this._ne.lat);return new Z(t,t.lng>r.lng?new e.N(r.lng+360,r.lat):r)}}class Y{constructor(t,e,r){this.bounds=Z.convert(this.validateBounds(t)),this.minzoom=e||0,this.maxzoom=r||24}validateBounds(t){return Array.isArray(t)&&4===t.length?[Math.max(-180,t[0]),Math.max(-90,t[1]),Math.min(180,t[2]),Math.min(90,t[3])]:[-180,-90,180,90]}contains(t){let r=Math.pow(2,t.z),n=Math.floor(e.O(this.bounds.getWest())*r),i=Math.floor(e.Q(this.bounds.getNorth())*r),a=Math.ceil(e.O(this.bounds.getEast())*r),o=Math.ceil(e.Q(this.bounds.getSouth())*r);return t.x>=n&&t.x=i&&t.y{this._options.tiles=t})),this}setUrl(t){return this.setSourceProperty((()=>{this.url=t,this._options.url=t})),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}serialize(){return e.e({},this._options)}loadTile(t){return e._(this,void 0,void 0,(function*(){let e=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),r={request:this.map._requestManager.transformRequest(e,"Tile"),uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,tileSize:this.tileSize*t.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};r.request.collectResourceTiming=this._collectResourceTiming;let n="RT";if(t.actor&&"expired"!==t.state){if("loading"===t.state)return new Promise(((e,r)=>{t.reloadPromise={resolve:e,reject:r}}))}else t.actor=this.dispatcher.getActor(),n="LT";t.abortController=new AbortController;try{let e=yield t.actor.sendAsync({type:n,data:r},t.abortController);if(delete t.abortController,t.aborted)return;this._afterTileLoadWorkerResponse(t,e)}catch(e){if(delete t.abortController,t.aborted)return;if(e&&404!==e.status)throw e;this._afterTileLoadWorkerResponse(t,null)}}))}_afterTileLoadWorkerResponse(t,e){if(e&&e.resourceTiming&&(t.resourceTiming=e.resourceTiming),e&&this.map._refreshExpiredTiles&&t.setExpiryData(e),t.loadVectorData(e,this.map.painter),t.reloadPromise){let e=t.reloadPromise;t.reloadPromise=null,this.loadTile(t).then(e.resolve).catch(e.reject)}}abortTile(t){return e._(this,void 0,void 0,(function*(){t.abortController&&(t.abortController.abort(),delete t.abortController),t.actor&&(yield t.actor.sendAsync({type:"AT",data:{uid:t.uid,type:this.type,source:this.id}}))}))}unloadTile(t){return e._(this,void 0,void 0,(function*(){t.unloadVectorData(),t.actor&&(yield t.actor.sendAsync({type:"RMT",data:{uid:t.uid,type:this.type,source:this.id}}))}))}hasTransition(){return!1}}class $ extends e.E{constructor(t,r,n,i){super(),this.id=t,this.dispatcher=n,this.setEventedParent(i),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=e.e({type:"raster"},r),e.e(this,e.M(r,["url","scheme","tileSize"]))}load(){return e._(this,void 0,void 0,(function*(){this._loaded=!1,this.fire(new e.k("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{let t=yield W(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,t&&(e.e(this,t),t.bounds&&(this.tileBounds=new Y(t.bounds,this.minzoom,this.maxzoom)),this.fire(new e.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new e.k("data",{dataType:"source",sourceDataType:"content"})))}catch(t){this._tileJSONRequest=null,this.fire(new e.j(t))}}))}loaded(){return this._loaded}onAdd(t){this.map=t,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}setSourceProperty(t){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null),t(),this.load()}setTiles(t){return this.setSourceProperty((()=>{this._options.tiles=t})),this}setUrl(t){return this.setSourceProperty((()=>{this.url=t,this._options.url=t})),this}serialize(){return e.e({},this._options)}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}loadTile(t){return e._(this,void 0,void 0,(function*(){let e=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);t.abortController=new AbortController;try{let r=yield f.getImage(this.map._requestManager.transformRequest(e,"Tile"),t.abortController,this.map._refreshExpiredTiles);if(delete t.abortController,t.aborted)return void(t.state="unloaded");if(r&&r.data){this.map._refreshExpiredTiles&&r.cacheControl&&r.expires&&t.setExpiryData({cacheControl:r.cacheControl,expires:r.expires});let e=this.map.painter.context,n=e.gl,i=r.data;t.texture=this.map.painter.getTileTexture(i.width),t.texture?t.texture.update(i,{useMipmap:!0}):(t.texture=new w(e,i,n.RGBA,{useMipmap:!0}),t.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE,n.LINEAR_MIPMAP_NEAREST)),t.state="loaded"}}catch(e){if(delete t.abortController,t.aborted)t.state="unloaded";else if(e)throw t.state="errored",e}}))}abortTile(t){return e._(this,void 0,void 0,(function*(){t.abortController&&(t.abortController.abort(),delete t.abortController)}))}unloadTile(t){return e._(this,void 0,void 0,(function*(){t.texture&&this.map.painter.saveTileTexture(t.texture)}))}hasTransition(){return!1}}class K extends ${constructor(t,r,n,i){super(t,r,n,i),this.type="raster-dem",this.maxzoom=22,this._options=e.e({type:"raster-dem"},r),this.encoding=r.encoding||"mapbox",this.redFactor=r.redFactor,this.greenFactor=r.greenFactor,this.blueFactor=r.blueFactor,this.baseShift=r.baseShift}loadTile(t){return e._(this,void 0,void 0,(function*(){let r=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),n=this.map._requestManager.transformRequest(r,"Tile");t.neighboringTiles=this._getNeighboringTiles(t.tileID),t.abortController=new AbortController;try{let r=yield f.getImage(n,t.abortController,this.map._refreshExpiredTiles);if(delete t.abortController,t.aborted)return void(t.state="unloaded");if(r&&r.data){let n=r.data;this.map._refreshExpiredTiles&&r.cacheControl&&r.expires&&t.setExpiryData({cacheControl:r.cacheControl,expires:r.expires});let i=e.b(n)&&e.U()?n:yield this.readImageNow(n),a={type:this.type,uid:t.uid,source:this.id,rawImageData:i,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(!t.actor||"expired"===t.state){t.actor=this.dispatcher.getActor();let e=yield t.actor.sendAsync({type:"LDT",data:a});t.dem=e,t.needsHillshadePrepare=!0,t.needsTerrainPrepare=!0,t.state="loaded"}}}catch(e){if(delete t.abortController,t.aborted)t.state="unloaded";else if(e)throw t.state="errored",e}}))}readImageNow(t){return e._(this,void 0,void 0,(function*(){if(typeof VideoFrame<"u"&&e.V()){let r=t.width+2,n=t.height+2;try{return new e.R({width:r,height:n},yield e.W(t,-1,-1,r,n))}catch{}}return a.getImageData(t,1)}))}_getNeighboringTiles(t){let r=t.canonical,n=Math.pow(2,r.z),i=(r.x-1+n)%n,a=0===r.x?t.wrap-1:t.wrap,o=(r.x+1+n)%n,s=r.x+1===n?t.wrap+1:t.wrap,l={};return l[new e.S(t.overscaledZ,a,r.z,i,r.y).key]={backfilled:!1},l[new e.S(t.overscaledZ,s,r.z,o,r.y).key]={backfilled:!1},r.y>0&&(l[new e.S(t.overscaledZ,a,r.z,i,r.y-1).key]={backfilled:!1},l[new e.S(t.overscaledZ,t.wrap,r.z,r.x,r.y-1).key]={backfilled:!1},l[new e.S(t.overscaledZ,s,r.z,o,r.y-1).key]={backfilled:!1}),r.y+10&&e.e(i,{resourceTiming:n}),this.fire(new e.k("data",Object.assign(Object.assign({},i),{sourceDataType:"metadata"}))),this.fire(new e.k("data",Object.assign(Object.assign({},i),{sourceDataType:"content"})))}catch(t){if(this._pendingLoads--,this._removed)return void this.fire(new e.k("dataabort",{dataType:"source"}));this.fire(new e.j(t))}}))}loaded(){return 0===this._pendingLoads}loadTile(t){return e._(this,void 0,void 0,(function*(){let e=t.actor?"RT":"LT";t.actor=this.actor;let r={type:this.type,uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};t.abortController=new AbortController;let n=yield this.actor.sendAsync({type:e,data:r},t.abortController);delete t.abortController,t.unloadVectorData(),t.aborted||t.loadVectorData(n,this.map.painter,"RT"===e)}))}abortTile(t){return e._(this,void 0,void 0,(function*(){t.abortController&&(t.abortController.abort(),delete t.abortController),t.aborted=!0}))}unloadTile(t){return e._(this,void 0,void 0,(function*(){t.unloadVectorData(),yield this.actor.sendAsync({type:"RMT",data:{uid:t.uid,type:this.type,source:this.id}})}))}onRemove(){this._removed=!0,this.actor.sendAsync({type:"RS",data:{type:this.type,source:this.id}})}serialize(){return e.e({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}var Q=e.Y([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class tt extends e.E{constructor(t,e,r,n){super(),this.id=t,this.dispatcher=r,this.coordinates=e.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(n),this.options=e}load(t){return e._(this,void 0,void 0,(function*(){this._loaded=!1,this.fire(new e.k("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=new AbortController;try{let e=yield f.getImage(this.map._requestManager.transformRequest(this.url,"Image"),this._request);this._request=null,this._loaded=!0,e&&e.data&&(this.image=e.data,t&&(this.coordinates=t),this._finishLoading())}catch(t){this._request=null,this._loaded=!0,this.fire(new e.j(t))}}))}loaded(){return this._loaded}updateImage(t){return t.url?(this._request&&(this._request.abort(),this._request=null),this.options.url=t.url,this.load(t.coordinates).finally((()=>{this.texture=null})),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new e.k("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(t){this.map=t,this.load()}onRemove(){this._request&&(this._request.abort(),this._request=null)}setCoordinates(t){this.coordinates=t;let r=t.map(e.Z.fromLngLat);this.tileID=function(t){let r=1/0,n=1/0,i=-1/0,a=-1/0;for(let e of t)r=Math.min(r,e.x),n=Math.min(n,e.y),i=Math.max(i,e.x),a=Math.max(a,e.y);let o=Math.max(i-r,a-n),s=Math.max(0,Math.floor(-Math.log(o)/Math.LN2)),l=Math.pow(2,s);return new e.a1(s,Math.floor((r+i)/2*l),Math.floor((n+a)/2*l))}(r),this.minzoom=this.maxzoom=this.tileID.z;let n=r.map((t=>this.tileID.getTilePoint(t)._round()));return this._boundsArray=new e.$,this._boundsArray.emplaceBack(n[0].x,n[0].y,0,0),this._boundsArray.emplaceBack(n[1].x,n[1].y,e.X,0),this._boundsArray.emplaceBack(n[3].x,n[3].y,0,e.X),this._boundsArray.emplaceBack(n[2].x,n[2].y,e.X,e.X),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new e.k("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(0===Object.keys(this.tiles).length||!this.image)return;let t=this.map.painter.context,r=t.gl;this.boundsBuffer||(this.boundsBuffer=t.createVertexBuffer(this._boundsArray,Q.members)),this.boundsSegments||(this.boundsSegments=e.a0.simpleSegment(0,0,4,2)),this.texture||(this.texture=new w(t,this.image,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE));let n=!1;for(let t in this.tiles){let e=this.tiles[t];"loaded"!==e.state&&(e.state="loaded",e.texture=this.texture,n=!0)}n&&this.fire(new e.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}loadTile(t){return e._(this,void 0,void 0,(function*(){this.tileID&&this.tileID.equals(t.tileID.canonical)?(this.tiles[String(t.tileID.wrap)]=t,t.buckets={}):t.state="errored"}))}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}class et extends tt{constructor(t,e,r,n){super(t,e,r,n),this.roundZoom=!0,this.type="video",this.options=e}load(){return e._(this,void 0,void 0,(function*(){this._loaded=!1;let t=this.options;this.urls=[];for(let e of t.urls)this.urls.push(this.map._requestManager.transformRequest(e,"Source").url);try{let t=yield e.a3(this.urls);if(this._loaded=!0,!t)return;this.video=t,this.video.loop=!0,this.video.addEventListener("playing",(()=>{this.map.triggerRepaint()})),this.map&&this.video.play(),this._finishLoading()}catch(t){this.fire(new e.j(t))}}))}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(t){if(this.video){let r=this.video.seekable;tr.end(0)?this.fire(new e.j(new e.a2(`sources.${this.id}`,null,`Playback for this video can be set only between the ${r.start(0)} and ${r.end(0)}-second mark.`))):this.video.currentTime=t}}getVideo(){return this.video}onAdd(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(0===Object.keys(this.tiles).length||this.video.readyState<2)return;let t=this.map.painter.context,r=t.gl;this.boundsBuffer||(this.boundsBuffer=t.createVertexBuffer(this._boundsArray,Q.members)),this.boundsSegments||(this.boundsSegments=e.a0.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE),r.texSubImage2D(r.TEXTURE_2D,0,0,0,r.RGBA,r.UNSIGNED_BYTE,this.video)):(this.texture=new w(t,this.video,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE));let n=!1;for(let t in this.tiles){let e=this.tiles[t];"loaded"!==e.state&&(e.state="loaded",e.texture=this.texture,n=!0)}n&&this.fire(new e.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}}class rt extends tt{constructor(t,r,n,i){super(t,r,n,i),r.coordinates?Array.isArray(r.coordinates)&&4===r.coordinates.length&&!r.coordinates.some((t=>!Array.isArray(t)||2!==t.length||t.some((t=>"number"!=typeof t))))||this.fire(new e.j(new e.a2(`sources.${t}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new e.j(new e.a2(`sources.${t}`,null,'missing required property "coordinates"'))),r.animate&&"boolean"!=typeof r.animate&&this.fire(new e.j(new e.a2(`sources.${t}`,null,'optional "animate" property must be a boolean value'))),r.canvas?"string"==typeof r.canvas||r.canvas instanceof HTMLCanvasElement||this.fire(new e.j(new e.a2(`sources.${t}`,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new e.j(new e.a2(`sources.${t}`,null,'missing required property "canvas"'))),this.options=r,this.animate=void 0===r.animate||r.animate}load(){return e._(this,void 0,void 0,(function*(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new e.j(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())}))}getCanvas(){return this.canvas}onAdd(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let t=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,t=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,t=!0),this._hasInvalidDimensions()||0===Object.keys(this.tiles).length)return;let r=this.map.painter.context,n=r.gl;this.boundsBuffer||(this.boundsBuffer=r.createVertexBuffer(this._boundsArray,Q.members)),this.boundsSegments||(this.boundsSegments=e.a0.simpleSegment(0,0,4,2)),this.texture?(t||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new w(r,this.canvas,n.RGBA,{premultiply:!0});let i=!1;for(let t in this.tiles){let e=this.tiles[t];"loaded"!==e.state&&(e.state="loaded",e.texture=this.texture,i=!0)}i&&this.fire(new e.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(let t of[this.canvas.width,this.canvas.height])if(isNaN(t)||t<=0)return!0;return!1}}let nt={},it=t=>{switch(t){case"geojson":return J;case"image":return tt;case"raster":return $;case"raster-dem":return K;case"vector":return X;case"video":return et;case"canvas":return rt}return nt[t]},at="RTLPluginLoaded";class ot extends e.E{constructor(){super(...arguments),this.status="unavailable",this.url=null,this.dispatcher=V()}_syncState(t){return this.status=t,this.dispatcher.broadcast("SRPS",{pluginStatus:t,pluginURL:this.url}).catch((t=>{throw this.status="error",t}))}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status="unavailable",this.url=null}setRTLTextPlugin(t){return e._(this,arguments,void 0,(function*(t,e=!1){if(this.url)throw new Error("setRTLTextPlugin cannot be called multiple times.");if(this.url=a.resolveURL(t),!this.url)throw new Error(`requested url ${t} is invalid`);if("unavailable"===this.status){if(!e)return this._requestImport();this.status="deferred",this._syncState(this.status)}else if("requested"===this.status)return this._requestImport()}))}_requestImport(){return e._(this,void 0,void 0,(function*(){yield this._syncState("loading"),this.status="loaded",this.fire(new e.k(at))}))}lazyLoad(){"unavailable"===this.status?this.status="requested":"deferred"===this.status&&this._requestImport()}}let st=null;function lt(){return st||(st=new ot),st}class ct{constructor(t,r){this.timeAdded=0,this.fadeEndTime=0,this.tileID=t,this.uid=e.a4(),this.uses=0,this.tileSize=r,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rtt=[],this.rttCoords={},this.expiredRequestCount=0,this.state="loading"}registerFadeDuration(t){let e=t+this.timeAdded;ee.getLayer(t))).filter(Boolean);if(0!==t.length){n.layers=t,n.stateDependentLayerIds&&(n.stateDependentLayers=n.stateDependentLayerIds.map((e=>t.filter((t=>t.id===e))[0])));for(let e of t)r[e.id]=n}}return r}(t.buckets,r.style),this.hasSymbolBuckets=!1;for(let t in this.buckets){let r=this.buckets[t];if(r instanceof e.a6){if(this.hasSymbolBuckets=!0,!n)break;r.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(let t in this.buckets){let r=this.buckets[t];if(r instanceof e.a6&&r.hasRTLText){this.hasRTLText=!0,lt().lazyLoad();break}}this.queryPadding=0;for(let t in this.buckets){let e=this.buckets[t];this.queryPadding=Math.max(this.queryPadding,r.style.getLayer(t).queryRadius(e))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage)}else this.collisionBoxArray=new e.a5}unloadVectorData(){for(let t in this.buckets)this.buckets[t].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(t){return this.buckets[t.id]}upload(t){for(let e in this.buckets){let r=this.buckets[e];r.uploadPending()&&r.upload(t)}let e=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new w(t,this.imageAtlas.image,e.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new w(t,this.glyphAtlasImage,e.ALPHA),this.glyphAtlasImage=null)}prepare(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)}queryRenderedFeatures(t,e,r,n,i,a,o,s,l,c){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:n,cameraQueryGeometry:i,scale:a,tileSize:this.tileSize,pixelPosMatrix:c,transform:s,params:o,queryPadding:this.queryPadding*l},t,e,r):{}}querySourceFeatures(t,r){let n=this.latestFeatureIndex;if(!n||!n.rawTileData)return;let i=n.loadVTLayers(),a=r&&r.sourceLayer?r.sourceLayer:"",o=i._geojsonTileLayer||i[a];if(!o)return;let s=e.a7(r&&r.filter),{z:l,x:c,y:u}=this.tileID.canonical,h={z:l,x:c,y:u};for(let r=0;rt)e=!1;else if(r)if(this.expirationTime{this.remove(t,i)}),r)),this.data[n].push(i),this.order.push(n),this.order.length>this.max){let t=this._getAndRemoveByKey(this.order[0]);t&&this.onRemove(t)}return this}has(t){return t.wrapped().key in this.data}getAndRemove(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null}_getAndRemoveByKey(t){let e=this.data[t].shift();return e.timeout&&clearTimeout(e.timeout),0===this.data[t].length&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),e.value}getByKey(t){let e=this.data[t];return e?e[0].value:null}get(t){return this.has(t)?this.data[t.wrapped().key][0].value:null}remove(t,e){if(!this.has(t))return this;let r=t.wrapped().key,n=void 0===e?0:this.data[r].indexOf(e),i=this.data[r][n];return this.data[r].splice(n,1),i.timeout&&clearTimeout(i.timeout),0===this.data[r].length&&delete this.data[r],this.onRemove(i.value),this.order.splice(this.order.indexOf(r),1),this}setMaxSize(t){for(this.max=t;this.order.length>this.max;){let t=this._getAndRemoveByKey(this.order[0]);t&&this.onRemove(t)}return this}filter(t){let e=[];for(let r in this.data)for(let n of this.data[r])t(n.value)||e.push(n);for(let t of e)this.remove(t.value.tileID,t)}}class ht{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(t,r,n){let i=String(r);if(this.stateChanges[t]=this.stateChanges[t]||{},this.stateChanges[t][i]=this.stateChanges[t][i]||{},e.e(this.stateChanges[t][i],n),null===this.deletedStates[t]){this.deletedStates[t]={};for(let e in this.state[t])e!==i&&(this.deletedStates[t][e]=null)}else if(this.deletedStates[t]&&null===this.deletedStates[t][i]){this.deletedStates[t][i]={};for(let e in this.state[t][i])n[e]||(this.deletedStates[t][i][e]=null)}else for(let e in n)this.deletedStates[t]&&this.deletedStates[t][i]&&null===this.deletedStates[t][i][e]&&delete this.deletedStates[t][i][e]}removeFeatureState(t,e,r){if(null===this.deletedStates[t])return;let n=String(e);if(this.deletedStates[t]=this.deletedStates[t]||{},r&&void 0!==e)null!==this.deletedStates[t][n]&&(this.deletedStates[t][n]=this.deletedStates[t][n]||{},this.deletedStates[t][n][r]=null);else if(void 0!==e)if(this.stateChanges[t]&&this.stateChanges[t][n])for(r in this.deletedStates[t][n]={},this.stateChanges[t][n])this.deletedStates[t][n][r]=null;else this.deletedStates[t][n]=null;else this.deletedStates[t]=null}getState(t,r){let n=String(r),i=e.e({},(this.state[t]||{})[n],(this.stateChanges[t]||{})[n]);if(null===this.deletedStates[t])return{};if(this.deletedStates[t]){let e=this.deletedStates[t][r];if(null===e)return{};for(let t in e)delete i[t]}return i}initializeTileState(t,e){t.setFeatureState(this.state,e)}coalesceChanges(t,r){let n={};for(let t in this.stateChanges){this.state[t]=this.state[t]||{};let r={};for(let n in this.stateChanges[t])this.state[t][n]||(this.state[t][n]={}),e.e(this.state[t][n],this.stateChanges[t][n]),r[n]=this.state[t][n];n[t]=r}for(let t in this.deletedStates){this.state[t]=this.state[t]||{};let r={};if(null===this.deletedStates[t])for(let e in this.state[t])r[e]={},this.state[t][e]={};else for(let e in this.deletedStates[t]){if(null===this.deletedStates[t][e])this.state[t][e]={};else for(let r of Object.keys(this.deletedStates[t][e]))delete this.state[t][e][r];r[e]=this.state[t][e]}n[t]=n[t]||{},e.e(n[t],r)}if(this.stateChanges={},this.deletedStates={},0!==Object.keys(n).length)for(let e in t)t[e].setFeatureState(n,r)}}class pt extends e.E{constructor(t,e,r){super(),this.id=t,this.dispatcher=r,this.on("data",(t=>this._dataHandler(t))),this.on("dataloading",(()=>{this._sourceErrored=!1})),this.on("error",(()=>{this._sourceErrored=this._source.loaded()})),this._source=((t,e,r,n)=>{let i=new(it(e.type))(t,e,r,n);if(i.id!==t)throw new Error(`Expected Source id to be ${t} instead of ${i.id}`);return i})(t,e,r,this),this._tiles={},this._cache=new ut(0,(t=>this._unloadTile(t))),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new ht,this._didEmitContent=!1,this._updated=!1}onAdd(t){this.map=t,this._maxTileCacheSize=t?t._maxTileCacheSize:null,this._maxTileCacheZoomLevels=t?t._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(t)}onRemove(t){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(t)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;if(!(void 0===this.used&&void 0===this.usedForTerrain||this.used||this.usedForTerrain))return!0;if(!this._updated)return!1;for(let t in this._tiles){let e=this._tiles[t];if("loaded"!==e.state&&"errored"!==e.state)return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;let t=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,t&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(t,r,n){return e._(this,void 0,void 0,(function*(){try{yield this._source.loadTile(t),this._tileLoaded(t,r,n)}catch(r){t.state="errored",404!==r.status?this._source.fire(new e.j(r,{tile:t})):this.update(this.transform,this.terrain)}}))}_unloadTile(t){this._source.unloadTile&&this._source.unloadTile(t)}_abortTile(t){this._source.abortTile&&this._source.abortTile(t),this._source.fire(new e.k("dataabort",{tile:t,coord:t.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(t){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(let e in this._tiles){let r=this._tiles[e];r.upload(t),r.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map((t=>t.tileID)).sort(ft).map((t=>t.key))}getRenderableIds(t){let r=[];for(let e in this._tiles)this._isIdRenderable(e,t)&&r.push(this._tiles[e]);return t?r.sort(((t,r)=>{let n=t.tileID,i=r.tileID,a=new e.P(n.canonical.x,n.canonical.y)._rotate(this.transform.angle),o=new e.P(i.canonical.x,i.canonical.y)._rotate(this.transform.angle);return n.overscaledZ-i.overscaledZ||o.y-a.y||o.x-a.x})).map((t=>t.tileID.key)):r.map((t=>t.tileID)).sort(ft).map((t=>t.key))}hasRenderableParent(t){let e=this.findLoadedParent(t,0);return!!e&&this._isIdRenderable(e.tileID.key)}_isIdRenderable(t,e){return this._tiles[t]&&this._tiles[t].hasData()&&!this._coveredTiles[t]&&(e||!this._tiles[t].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(let t in this._tiles)"errored"!==this._tiles[t].state&&this._reloadTile(t,"reloading")}}_reloadTile(t,r){return e._(this,void 0,void 0,(function*(){let e=this._tiles[t];e&&("loading"!==e.state&&(e.state=r),yield this._loadTile(e,t,r))}))}_tileLoaded(t,r,n){t.timeAdded=a.now(),"expired"===n&&(t.refreshedUponExpiration=!0),this._setTileReloadTimer(r,t),"raster-dem"===this.getSource().type&&t.dem&&this._backfillDEM(t),this._state.initializeTileState(t,this.map?this.map.painter:null),t.aborted||this._source.fire(new e.k("data",{dataType:"source",tile:t,coord:t.tileID}))}_backfillDEM(t){let e=this.getRenderableIds();for(let n=0;n1||(Math.abs(r)>1&&(1===Math.abs(r+i)?r+=i:1===Math.abs(r-i)&&(r-=i)),e.dem&&t.dem&&(t.dem.backfillBorder(e.dem,r,n),t.neighboringTiles&&t.neighboringTiles[a]&&(t.neighboringTiles[a].backfilled=!0)))}}getTile(t){return this.getTileByID(t.key)}getTileByID(t){return this._tiles[t]}_retainLoadedChildren(t,e,r,n){for(let i in this._tiles){let a=this._tiles[i];if(n[i]||!a.hasData()||a.tileID.overscaledZ<=e||a.tileID.overscaledZ>r)continue;let o=a.tileID;for(;a&&a.tileID.overscaledZ>e+1;){let t=a.tileID.scaledTo(a.tileID.overscaledZ-1);a=this._tiles[t.key],a&&a.hasData()&&(o=t)}let s=o;for(;s.overscaledZ>e;)if(s=s.scaledTo(s.overscaledZ-1),t[s.key]){n[o.key]=o;break}}}findLoadedParent(t,e){if(t.key in this._loadedParentTiles){let r=this._loadedParentTiles[t.key];return r&&r.tileID.overscaledZ>=e?r:null}for(let r=t.overscaledZ-1;r>=e;r--){let e=t.scaledTo(r),n=this._getLoadedTile(e);if(n)return n}}findLoadedSibling(t){return this._getLoadedTile(t)}_getLoadedTile(t){let e=this._tiles[t.key];return e&&e.hasData()?e:this._cache.getByKey(t.wrapped().key)}updateCacheSize(t){let r=Math.ceil(t.width/this._source.tileSize)+1,n=Math.ceil(t.height/this._source.tileSize)+1,i=Math.floor(r*n*(null===this._maxTileCacheZoomLevels?e.a.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),a="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,i):i;this._cache.setMaxSize(a)}handleWrapJump(t){let e=Math.round((t-(void 0===this._prevLng?t:this._prevLng))/360);if(this._prevLng=t,e){let t={};for(let r in this._tiles){let n=this._tiles[r];n.tileID=n.tileID.unwrapTo(n.tileID.wrap+e),t[n.tileID.key]=n}this._tiles=t;for(let t in this._timers)clearTimeout(this._timers[t]),delete this._timers[t];for(let t in this._tiles)this._setTileReloadTimer(t,this._tiles[t])}}_updateCoveredAndRetainedTiles(t,e,r,n,i,o){let s={},l={},c=Object.keys(t),u=a.now();for(let r of c){let n=t[r],i=this._tiles[r];if(!i||0!==i.fadeEndTime&&i.fadeEndTime<=u)continue;let a=this.findLoadedParent(n,e),o=this.findLoadedSibling(n),c=a||o||null;c&&(this._addTile(c.tileID),s[c.tileID.key]=c.tileID),l[r]=n}this._retainLoadedChildren(l,n,r,t);for(let e in s)t[e]||(this._coveredTiles[e]=!0,t[e]=s[e]);if(o){let e={},r={};for(let t of i)this._tiles[t.key].hasData()?e[t.key]=t:r[t.key]=t;for(let n in r){let i=r[n].children(this._source.maxzoom);this._tiles[i[0].key]&&this._tiles[i[1].key]&&this._tiles[i[2].key]&&this._tiles[i[3].key]&&(e[i[0].key]=t[i[0].key]=i[0],e[i[1].key]=t[i[1].key]=i[1],e[i[2].key]=t[i[2].key]=i[2],e[i[3].key]=t[i[3].key]=i[3],delete r[n])}for(let n in r){let i=r[n],a=this.findLoadedParent(i,this._source.minzoom),o=this.findLoadedSibling(i),s=a||o||null;if(s){e[s.tileID.key]=t[s.tileID.key]=s.tileID;for(let t in e)e[t].isChildOf(s.tileID)&&delete e[t]}}for(let t in this._tiles)e[t]||(this._coveredTiles[t]=!0)}}update(t,r){if(!this._sourceLoaded||this._paused)return;let n;this.transform=t,this.terrain=r,this.updateCacheSize(t),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?n=t.getVisibleUnwrappedCoordinates(this._source.tileID).map((t=>new e.S(t.canonical.z,t.wrap,t.canonical.z,t.canonical.x,t.canonical.y))):(n=t.coveringTiles({tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:r}),this._source.hasTile&&(n=n.filter((t=>this._source.hasTile(t))))):n=[];let i=t.coveringZoomLevel(this._source),a=Math.max(i-pt.maxOverzooming,this._source.minzoom),o=Math.max(i+pt.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){let t={};for(let e of n)if(e.canonical.z>this._source.minzoom){let r=e.scaledTo(e.canonical.z-1);t[r.key]=r;let n=e.scaledTo(Math.max(this._source.minzoom,Math.min(e.canonical.z,5)));t[n.key]=n}n=n.concat(Object.values(t))}let s=0===n.length&&!this._updated&&this._didEmitContent;this._updated=!0,s&&this.fire(new e.k("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));let l=this._updateRetainedTiles(n,i);dt(this._source.type)&&this._updateCoveredAndRetainedTiles(l,a,o,i,n,r);for(let t in l)this._tiles[t].clearFadeHold();let c=e.ab(this._tiles,l);for(let t of c){let e=this._tiles[t];e.hasSymbolBuckets&&!e.holdingForFade()?e.setHoldDuration(this.map._fadeDuration):e.hasSymbolBuckets&&!e.symbolFadeFinished()||this._removeTile(t)}this._updateLoadedParentTileCache(),this._updateLoadedSiblingTileCache()}releaseSymbolFadeTiles(){for(let t in this._tiles)this._tiles[t].holdingForFade()&&this._removeTile(t)}_updateRetainedTiles(t,e){var r;let n={},i={},a=Math.max(e-pt.maxOverzooming,this._source.minzoom),o=Math.max(e+pt.maxUnderzooming,this._source.minzoom),s={};for(let r of t){let t=this._addTile(r);n[r.key]=r,t.hasData()||ethis._source.maxzoom){let t=o.children(this._source.maxzoom)[0],e=this.getTile(t);if(e&&e.hasData()){n[t.key]=t;continue}}else{let t=o.children(this._source.maxzoom);if(n[t[0].key]&&n[t[1].key]&&n[t[2].key]&&n[t[3].key])continue}let s=t.wasRequested();for(let e=o.overscaledZ-1;e>=a;--e){let a=o.scaledTo(e);if(i[a.key])break;if(i[a.key]=!0,t=this.getTile(a),!t&&s&&(t=this._addTile(a)),t){let e=t.hasData();if((e||!(null!==(r=this.map)&&void 0!==r&&r.cancelPendingTileRequestsWhileZooming)||s)&&(n[a.key]=a),s=t.wasRequested(),e)break}}}return n}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(let t in this._tiles){let e,r=[],n=this._tiles[t].tileID;for(;n.overscaledZ>0;){if(n.key in this._loadedParentTiles){e=this._loadedParentTiles[n.key];break}r.push(n.key);let t=n.scaledTo(n.overscaledZ-1);if(e=this._getLoadedTile(t),e)break;n=t}for(let t of r)this._loadedParentTiles[t]=e}}_updateLoadedSiblingTileCache(){this._loadedSiblingTiles={};for(let t in this._tiles){let e=this._tiles[t].tileID,r=this._getLoadedTile(e);this._loadedSiblingTiles[e.key]=r}}_addTile(t){let r=this._tiles[t.key];if(r)return r;r=this._cache.getAndRemove(t),r&&(this._setTileReloadTimer(t.key,r),r.tileID=t,this._state.initializeTileState(r,this.map?this.map.painter:null),this._cacheTimers[t.key]&&(clearTimeout(this._cacheTimers[t.key]),delete this._cacheTimers[t.key],this._setTileReloadTimer(t.key,r)));let n=r;return r||(r=new ct(t,this._source.tileSize*t.overscaleFactor()),this._loadTile(r,t.key,r.state)),r.uses++,this._tiles[t.key]=r,n||this._source.fire(new e.k("dataloading",{tile:r,coord:r.tileID,dataType:"source"})),r}_setTileReloadTimer(t,e){t in this._timers&&(clearTimeout(this._timers[t]),delete this._timers[t]);let r=e.getExpiryTimeout();r&&(this._timers[t]=setTimeout((()=>{this._reloadTile(t,"expired"),delete this._timers[t]}),r))}_removeTile(t){let e=this._tiles[t];e&&(e.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),delete this._timers[t]),e.uses>0||(e.hasData()&&"reloading"!==e.state?this._cache.add(e.tileID,e,e.getExpiryTimeout()):(e.aborted=!0,this._abortTile(e),this._unloadTile(e))))}_dataHandler(t){let e=t.sourceDataType;"source"===t.dataType&&"metadata"===e&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&"source"===t.dataType&&"content"===e&&(this.reload(),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(let t in this._tiles)this._removeTile(t);this._cache.reset()}tilesIn(t,r,n){let i=[],a=this.transform;if(!a)return i;let o=n?a.getCameraQueryGeometry(t):t,s=t.map((t=>a.pointCoordinate(t,this.terrain))),l=o.map((t=>a.pointCoordinate(t,this.terrain))),c=this.getIds(),u=1/0,h=1/0,p=-1/0,f=-1/0;for(let t of l)u=Math.min(u,t.x),h=Math.min(h,t.y),p=Math.max(p,t.x),f=Math.max(f,t.y);for(let t=0;t=0&&g[1].y+m>=0){let t=s.map((t=>o.getTilePoint(t))),e=l.map((t=>o.getTilePoint(t)));i.push({tile:n,tileID:o,queryGeometry:t,cameraQueryGeometry:e,scale:d})}}return i}getVisibleCoordinates(t){let e=this.getRenderableIds(t).map((t=>this._tiles[t].tileID));for(let t of e)t.posMatrix=this.transform.calculatePosMatrix(t.toUnwrapped());return e}hasTransition(){if(this._source.hasTransition())return!0;if(dt(this._source.type)){let t=a.now();for(let e in this._tiles)if(this._tiles[e].fadeEndTime>=t)return!0}return!1}setFeatureState(t,e,r){this._state.updateState(t=t||"_geojsonTileLayer",e,r)}removeFeatureState(t,e,r){this._state.removeFeatureState(t=t||"_geojsonTileLayer",e,r)}getFeatureState(t,e){return this._state.getState(t=t||"_geojsonTileLayer",e)}setDependencies(t,e,r){let n=this._tiles[t];n&&n.setDependencies(e,r)}reloadTilesForDependencies(t,e){for(let r in this._tiles)this._tiles[r].hasDependency(t,e)&&this._reloadTile(r,"reloading");this._cache.filter((r=>!r.hasDependency(t,e)))}}function ft(t,e){let r=Math.abs(2*t.wrap)-+(t.wrap<0),n=Math.abs(2*e.wrap)-+(e.wrap<0);return t.overscaledZ-e.overscaledZ||n-r||e.canonical.y-t.canonical.y||e.canonical.x-t.canonical.x}function dt(t){return"raster"===t||"image"===t||"video"===t}pt.maxOverzooming=10,pt.maxUnderzooming=3;class mt{constructor(t,e){this.reset(t,e)}reset(t,e){this.points=t||[],this._distances=[0];for(let t=1;t0?(i-o)/s:0;return this.points[a].mult(1-l).add(this.points[r].mult(l))}}function gt(t,e){let r=!0;return"always"===t||"never"!==t&&"never"!==e||(r=!1),r}class yt{constructor(t,e,r){let n=this.boxCells=[],i=this.circleCells=[];this.xCellCount=Math.ceil(t/r),this.yCellCount=Math.ceil(e/r);for(let t=0;tthis.width||n<0||e>this.height)return[];let s=[];if(t<=0&&e<=0&&this.width<=r&&this.height<=n){if(i)return[{key:null,x1:t,y1:e,x2:r,y2:n}];for(let t=0;t0}hitTestCircle(t,e,r,n,i){let a=t-r,o=t+r,s=e-r,l=e+r;if(o<0||a>this.width||l<0||s>this.height)return!1;let c=[];return this._forEachCell(a,s,o,l,this._queryCellCircle,c,{hitTest:!0,overlapMode:n,circle:{x:t,y:e,radius:r},seenUids:{box:{},circle:{}}},i),c.length>0}_queryCell(t,e,r,n,i,a,o,s){let{seenUids:l,hitTest:c,overlapMode:u}=o,h=this.boxCells[i];if(null!==h){let i=this.bboxes;for(let o of h)if(!l.box[o]){l.box[o]=!0;let h=4*o,p=this.boxKeys[o];if(t<=i[h+2]&&e<=i[h+3]&&r>=i[h+0]&&n>=i[h+1]&&(!s||s(p))&&(!c||!gt(u,p.overlapMode))&&(a.push({key:p,x1:i[h],y1:i[h+1],x2:i[h+2],y2:i[h+3]}),c))return!0}}let p=this.circleCells[i];if(null!==p){let i=this.circles;for(let o of p)if(!l.circle[o]){l.circle[o]=!0;let h=3*o,p=this.circleKeys[o];if(this._circleAndRectCollide(i[h],i[h+1],i[h+2],t,e,r,n)&&(!s||s(p))&&(!c||!gt(u,p.overlapMode))){let t=i[h],e=i[h+1],r=i[h+2];if(a.push({key:p,x1:t-r,y1:e-r,x2:t+r,y2:e+r}),c)return!0}}}return!1}_queryCellCircle(t,e,r,n,i,a,o,s){let{circle:l,seenUids:c,overlapMode:u}=o,h=this.boxCells[i];if(null!==h){let t=this.bboxes;for(let e of h)if(!c.box[e]){c.box[e]=!0;let r=4*e,n=this.boxKeys[e];if(this._circleAndRectCollide(l.x,l.y,l.radius,t[r+0],t[r+1],t[r+2],t[r+3])&&(!s||s(n))&&!gt(u,n.overlapMode))return a.push(!0),!0}}let p=this.circleCells[i];if(null!==p){let t=this.circles;for(let e of p)if(!c.circle[e]){c.circle[e]=!0;let r=3*e,n=this.circleKeys[e];if(this._circlesCollide(t[r],t[r+1],t[r+2],l.x,l.y,l.radius)&&(!s||s(n))&&!gt(u,n.overlapMode))return a.push(!0),!0}}}_forEachCell(t,e,r,n,i,a,o,s){let l=this._convertToXCellCoord(t),c=this._convertToYCellCoord(e),u=this._convertToXCellCoord(r),h=this._convertToYCellCoord(n);for(let p=l;p<=u;p++)for(let l=c;l<=h;l++)if(i.call(this,t,e,r,n,this.xCellCount*l+p,a,o,s))return}_convertToXCellCoord(t){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(t*this.xScale)))}_convertToYCellCoord(t){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(t*this.yScale)))}_circlesCollide(t,e,r,n,i,a){let o=n-t,s=i-e,l=r+a;return l*l>o*o+s*s}_circleAndRectCollide(t,e,r,n,i,a,o){let s=(a-n)/2,l=Math.abs(t-(n+s));if(l>s+r)return!1;let c=(o-i)/2,u=Math.abs(e-(i+c));if(u>c+r)return!1;if(l<=s||u<=c)return!0;let h=l-s,p=u-c;return h*h+p*p<=r*r}}function vt(t,r,n,i,a){let o=e.H();return r?(e.K(o,o,[1/a,1/a,1]),n||e.ad(o,o,i.angle)):e.L(o,i.labelPlaneMatrix,t),o}function xt(t,r,n,i,a){if(r){let r=e.ae(t);return e.K(r,r,[a,a,1]),n||e.ad(r,r,-i.angle),r}return i.glCoordMatrix}function _t(t,r,n,i){let a;i?(a=[t,r,i(t,r),1],e.af(a,a,n)):(a=[t,r,0,1],Ot(a,a,n));let o=a[3];return{point:new e.P(a[0]/o,a[1]/o),signedDistanceFromCamera:o,isOccluded:!1}}function bt(t,e){return.5+t/e*.5}function wt(t,e){return t.x>=-e[0]&&t.x<=e[0]&&t.y>=-e[1]&&t.y<=e[1]}function Tt(t,r,n,i,a,o,s,l,c,u,h,p,f,d,m){let g=i?t.textSizeData:t.iconSizeData,y=e.ag(g,n.transform.zoom),v=[256/n.width*2+1,256/n.height*2+1],x=i?t.text.dynamicLayoutVertexArray:t.icon.dynamicLayoutVertexArray;x.clear();let _=t.lineVertexArray,b=i?t.text.placedSymbolArray:t.icon.placedSymbolArray,w=n.transform.width/n.transform.height,T=!1;for(let i=0;iMath.abs(n.x-r.x)*i?{useVertical:!0}:(t===e.ah.vertical?r.yn.x)?{needsFlipping:!0}:null}function Mt(t,r,n,i,a,o,s,l,c,u,h){let p,f=n/24,d=r.lineOffsetX*f,m=r.lineOffsetY*f;if(r.numGlyphs>1){let e=r.glyphStartIndex+r.numGlyphs,n=r.lineStartIndex,o=r.lineStartIndex+r.lineLength,c=At(f,l,d,m,i,r,h,t);if(!c)return{notEnoughRoom:!0};let g=_t(c.first.point.x,c.first.point.y,s,t.getElevation).point,y=_t(c.last.point.x,c.last.point.y,s,t.getElevation).point;if(a&&!i){let t=kt(r.writingMode,g,y,u);if(t)return t}p=[c.first];for(let a=r.glyphStartIndex+1;a0?s.point:St(t.tileAnchorPoint,a,n,1,o,t),c=kt(r.writingMode,n,l,u);if(c)return c}let n=Pt(f*l.getoffsetX(r.glyphStartIndex),d,m,i,r.segment,r.lineStartIndex,r.lineStartIndex+r.lineLength,t,h);if(!n||t.projectionCache.anyProjectionOccluded)return{notEnoughRoom:!0};p=[n]}for(let t of p)e.aj(c,t.point,t.angle);return{}}function St(t,e,r,n,i,a){let o=t.add(t.sub(e)._unit()),s=void 0!==i?_t(o.x,o.y,i,a.getElevation).point:Ct(o.x,o.y,a).point,l=r.sub(s);return r.add(l._mult(n/l.mag()))}function Et(t,r,n){let i=r.projectionCache;if(i.projections[t])return i.projections[t];let a=new e.P(r.lineVertexArray.getx(t),r.lineVertexArray.gety(t)),o=Ct(a.x,a.y,r);if(o.signedDistanceFromCamera>0)return i.projections[t]=o.point,i.anyProjectionOccluded=i.anyProjectionOccluded||o.isOccluded,o.point;let s=t-n.direction;return St(0===n.distanceFromAnchor?r.tileAnchorPoint:new e.P(r.lineVertexArray.getx(s),r.lineVertexArray.gety(s)),a,n.previousVertex,n.absOffsetX-n.distanceFromAnchor+1,void 0,r)}function Ct(t,e,r){let n,i=t+r.translation[0],a=e+r.translation[1];return!r.pitchWithMap&&r.projection.useSpecialProjectionForSymbols?(n=r.projection.projectTileCoordinates(i,a,r.unwrappedTileID,r.getElevation),n.point.x=(.5*n.point.x+.5)*r.width,n.point.y=(.5*-n.point.y+.5)*r.height):(n=_t(i,a,r.labelPlaneMatrix,r.getElevation),n.isOccluded=!1),n}function It(t,e,r){return t._unit()._perp()._mult(e*r)}function Lt(t,r,n,i,a,o,s,l,c){if(l.projectionCache.offsets[t])return l.projectionCache.offsets[t];let u=n.add(r);if(t+c.direction=a)return l.projectionCache.offsets[t]=u,u;let h=Et(t+c.direction,l,c),p=It(h.sub(n),s,c.direction),f=n.add(p),d=h.add(p);return l.projectionCache.offsets[t]=e.ak(o,u,f,d)||u,l.projectionCache.offsets[t]}function Pt(t,e,r,n,i,a,o,s,l){let c=n?t-e:t+e,u=c>0?1:-1,h=0;n&&(u*=-1,h=Math.PI),u<0&&(h+=Math.PI);let p,f=u>0?a+i:a+i+1;s.projectionCache.cachedAnchorPoint?p=s.projectionCache.cachedAnchorPoint:(p=Ct(s.tileAnchorPoint.x,s.tileAnchorPoint.y,s).point,s.projectionCache.cachedAnchorPoint=p);let d,m,g,y=p,v=p,x=0,_=0,b=Math.abs(c),w=[];for(;x+_<=b;){if(f+=u,f=o)return null;x+=_,v=y,m=d;let t={absOffsetX:b,direction:u,distanceFromAnchor:x,previousVertex:v};if(y=Et(f,s,t),0===r)w.push(v),g=y.sub(v);else{let e,n=y.sub(v);e=0===n.mag()?It(Et(f+u,s,t).sub(y),r,u):It(n,r,u),m||(m=v.add(e)),d=Lt(f,e,y,a,o,m,r,s,t),w.push(m),g=d.sub(m)}_=g.mag()}let T=g._mult((b-x)/_)._add(m||v),A=h+Math.atan2(y.y-v.y,y.x-v.x);return w.push(T),{point:T,angle:l?A:0,path:w}}let zt=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function Dt(t,e){for(let r=0;r=1;t--)l.push(o.path[t]);for(let t=1;tt.signedDistanceFromCamera<=0))?[]:t.map((t=>t.point))}let m=[];if(l.length>0){let t=l[0].clone(),r=l[0].clone();for(let e=1;e=n.x&&r.x<=i.x&&t.y>=n.y&&r.y<=i.y?[l]:r.xi.x||r.yi.y?[]:e.al([l],n.x,n.y,i.x,i.y)}for(let e of m){a.reset(e,.25*r);let n=0;n=a.length<=.5*r?1:Math.ceil(a.paddedLength/h)+1;for(let e=0;e_t(t.x,t.y,r,e.getElevation)))}queryRenderedSymbols(t){if(0===t.length||0===this.grid.keysLength()&&0===this.ignoredGrid.keysLength())return{};let r=[],n=1/0,i=1/0,a=-1/0,o=-1/0;for(let s of t){let t=new e.P(s.x+Rt,s.y+Rt);n=Math.min(n,t.x),i=Math.min(i,t.y),a=Math.max(a,t.x),o=Math.max(o,t.y),r.push(t)}let s=this.grid.query(n,i,a,o).concat(this.ignoredGrid.query(n,i,a,o)),l={},c={};for(let t of s){let n=t.key;if(void 0===l[n.bucketInstanceId]&&(l[n.bucketInstanceId]={}),l[n.bucketInstanceId][n.featureIndex])continue;let i=[new e.P(t.x1,t.y1),new e.P(t.x2,t.y1),new e.P(t.x2,t.y2),new e.P(t.x1,t.y2)];e.am(r,i)&&(l[n.bucketInstanceId][n.featureIndex]=!0,void 0===c[n.bucketInstanceId]&&(c[n.bucketInstanceId]=[]),c[n.bucketInstanceId].push(n.featureIndex))}return c}insertCollisionBox(t,e,r,n,i,a){(r?this.ignoredGrid:this.grid).insert({bucketInstanceId:n,featureIndex:i,collisionGroupID:a,overlapMode:e},t[0],t[1],t[2],t[3])}insertCollisionCircles(t,e,r,n,i,a){let o=r?this.ignoredGrid:this.grid,s={bucketInstanceId:n,featureIndex:i,collisionGroupID:a,overlapMode:e};for(let e=0;e=this.screenRightBoundary||nthis.screenBottomBoundary}isInsideGrid(t,e,r,n){return r>=0&&t=0&&ethis.projectAndGetPerspectiveRatio(n,t.x,t.y,i,c)));A=t.some((t=>!t.isOccluded)),T=t.map((t=>t.point))}else A=!0;return{box:e.ao(T),allPointsOccluded:!A}}}function Bt(t,r,n){return r*(e.X/(t.tileSize*Math.pow(2,n-t.tileID.overscaledZ)))}class jt{constructor(t,e,r,n){this.opacity=t?Math.max(0,Math.min(1,t.opacity+(t.placed?e:-e))):n&&r?1:0,this.placed=r}isHidden(){return 0===this.opacity&&!this.placed}}class Nt{constructor(t,e,r,n,i){this.text=new jt(t?t.text:null,e,r,i),this.icon=new jt(t?t.icon:null,e,n,i)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class Ut{constructor(t,e,r){this.text=t,this.icon=e,this.skipFade=r}}class Vt{constructor(){this.invProjMatrix=e.H(),this.viewportMatrix=e.H(),this.circles=[]}}class qt{constructor(t,e,r,n,i){this.bucketInstanceId=t,this.featureIndex=e,this.sourceLayerIndex=r,this.bucketIndex=n,this.tileID=i}}class Ht{constructor(t){this.crossSourceCollisions=t,this.maxGroupID=0,this.collisionGroups={}}get(t){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[t]){let e=++this.maxGroupID;this.collisionGroups[t]={ID:e,predicate:t=>t.collisionGroupID===e}}return this.collisionGroups[t]}}function Gt(t,r,n,i,a){let{horizontalAlign:o,verticalAlign:s}=e.au(t);return new e.P(-(o-.5)*r+i[0]*a,-(s-.5)*n+i[1]*a)}class Wt{constructor(t,e,r,n,i,a){this.transform=t.clone(),this.terrain=r,this.collisionIndex=new Ft(this.transform,e),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=n,this.retainedQueryData={},this.collisionGroups=new Ht(i),this.collisionCircleArrays={},this.collisionBoxArrays=new Map,this.prevPlacement=a,a&&(a.prevPlacement=void 0),this.placedOrientations={}}_getTerrainElevationFunc(t){let e=this.terrain;return e?(r,n)=>e.getElevation(t,r,n):null}getBucketParts(t,r,n,i){let a=n.getBucket(r),o=n.latestFeatureIndex;if(!a||!o||r.id!==a.layerIds[0])return;let s=n.collisionBoxArray,l=a.layers[0].layout,c=a.layers[0].paint,u=Math.pow(2,this.transform.zoom-n.tileID.overscaledZ),h=n.tileSize/e.X,p=n.tileID.toUnwrapped(),f=this.transform.calculatePosMatrix(p),d="map"===l.get("text-pitch-alignment"),m="map"===l.get("text-rotation-alignment"),g=Bt(n,1,this.transform.zoom),y=this.collisionIndex.mapProjection.translatePosition(this.transform,n,c.get("text-translate"),c.get("text-translate-anchor")),v=this.collisionIndex.mapProjection.translatePosition(this.transform,n,c.get("icon-translate"),c.get("icon-translate-anchor")),x=vt(f,d,m,this.transform,g),_=null;if(d){let t=xt(f,d,m,this.transform,g);_=e.L([],this.transform.labelPlaneMatrix,t)}this.retainedQueryData[a.bucketInstanceId]=new qt(a.bucketInstanceId,o,a.sourceLayerIndex,a.index,n.tileID);let b={bucket:a,layout:l,translationText:y,translationIcon:v,posMatrix:f,unwrappedTileID:p,textLabelPlaneMatrix:x,labelToScreenMatrix:_,scale:u,textPixelRatio:h,holdingForFade:n.holdingForFade(),collisionBoxArray:s,partiallyEvaluatedTextSize:e.ag(a.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(a.sourceID)};if(i)for(let e of a.sortKeyRanges){let{sortKey:r,symbolInstanceStart:n,symbolInstanceEnd:i}=e;t.push({sortKey:r,symbolInstanceStart:n,symbolInstanceEnd:i,parameters:b})}else t.push({symbolInstanceStart:0,symbolInstanceEnd:a.symbolInstances.length,parameters:b})}attemptAnchorPlacement(t,r,n,i,a,o,s,l,c,u,h,p,f,d,m,g,y,v,x){let _=e.aq[t.textAnchor],b=[t.textOffset0,t.textOffset1],w=Gt(_,n,i,b,a),T=this.collisionIndex.placeCollisionBox(r,p,l,c,u,s,o,g,h.predicate,x,w);if((!v||this.collisionIndex.placeCollisionBox(v,p,l,c,u,s,o,y,h.predicate,x,w).placeable)&&T.placeable){let t;if(this.prevPlacement&&this.prevPlacement.variableOffsets[f.crossTileID]&&this.prevPlacement.placements[f.crossTileID]&&this.prevPlacement.placements[f.crossTileID].text&&(t=this.prevPlacement.variableOffsets[f.crossTileID].anchor),0===f.crossTileID)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[f.crossTileID]={textOffset:b,width:n,height:i,anchor:_,textBoxScale:a,prevAnchor:t},this.markUsedJustification(d,_,f,m),d.allowVerticalPlacement&&(this.markUsedOrientation(d,m,f),this.placedOrientations[f.crossTileID]=m),{shift:w,placedGlyphBoxes:T}}}placeLayerBucketPart(t,r,n){let{bucket:i,layout:a,translationText:o,translationIcon:s,posMatrix:l,unwrappedTileID:c,textLabelPlaneMatrix:u,labelToScreenMatrix:h,textPixelRatio:p,holdingForFade:f,collisionBoxArray:d,partiallyEvaluatedTextSize:m,collisionGroup:g}=t.parameters,y=a.get("text-optional"),v=a.get("icon-optional"),x=e.ar(a,"text-overlap","text-allow-overlap"),_="always"===x,b=e.ar(a,"icon-overlap","icon-allow-overlap"),w="always"===b,T="map"===a.get("text-rotation-alignment"),A="map"===a.get("text-pitch-alignment"),k="none"!==a.get("icon-text-fit"),M="viewport-y"===a.get("symbol-z-order"),S=_&&(w||!i.hasIconData()||v),E=w&&(_||!i.hasTextData()||y);!i.collisionArrays&&d&&i.deserializeCollisionBoxes(d);let C=this._getTerrainElevationFunc(this.retainedQueryData[i.bucketInstanceId].tileID),I=(t,d,w)=>{var M,I;if(r[t.crossTileID])return;if(f)return void(this.placements[t.crossTileID]=new Ut(!1,!1,!1));let L=!1,P=!1,z=!0,D=null,O={box:null,placeable:!1,offscreen:null},R={box:null,placeable:!1,offscreen:null},F=null,B=null,j=null,N=0,U=0,V=0;d.textFeatureIndex?N=d.textFeatureIndex:t.useRuntimeCollisionCircles&&(N=t.featureIndex),d.verticalTextFeatureIndex&&(U=d.verticalTextFeatureIndex);let q=d.textBox;if(q){let r=r=>{let n=e.ah.horizontal;if(i.allowVerticalPlacement&&!r&&this.prevPlacement){let e=this.prevPlacement.placedOrientations[t.crossTileID];e&&(this.placedOrientations[t.crossTileID]=e,n=e,this.markUsedOrientation(i,n,t))}return n},a=(r,n)=>{if(i.allowVerticalPlacement&&t.numVerticalGlyphVertices>0&&d.verticalTextBox){for(let t of i.writingModes)if(t===e.ah.vertical?(O=n(),R=O):O=r(),O&&O.placeable)break}else O=r()},u=t.textAnchorOffsetStartIndex,h=t.textAnchorOffsetEndIndex;if(h===u){let n=(e,r)=>{let n=this.collisionIndex.placeCollisionBox(e,x,p,l,c,A,T,o,g.predicate,C);return n&&n.placeable&&(this.markUsedOrientation(i,r,t),this.placedOrientations[t.crossTileID]=r),n};a((()=>n(q,e.ah.horizontal)),(()=>{let r=d.verticalTextBox;return i.allowVerticalPlacement&&t.numVerticalGlyphVertices>0&&r?n(r,e.ah.vertical):{box:null,offscreen:null}})),r(O&&O.placeable)}else{let f=e.aq[null===(I=null===(M=this.prevPlacement)||void 0===M?void 0:M.variableOffsets[t.crossTileID])||void 0===I?void 0:I.anchor],m=(r,a,d)=>{let m=r.x2-r.x1,y=r.y2-r.y1,v=t.textBoxScale,_=k&&"never"===b?a:null,w=null,M="never"===x?1:2,S="never";f&&M++;for(let e=0;em(q,d.iconBox,e.ah.horizontal)),(()=>{let r=d.verticalTextBox;return i.allowVerticalPlacement&&(!O||!O.placeable)&&t.numVerticalGlyphVertices>0&&r?m(r,d.verticalIconBox,e.ah.vertical):{box:null,occluded:!0,offscreen:null}})),O&&(L=O.placeable,z=O.offscreen);let y=r(O&&O.placeable);if(!L&&this.prevPlacement){let e=this.prevPlacement.variableOffsets[t.crossTileID];e&&(this.variableOffsets[t.crossTileID]=e,this.markUsedJustification(i,e.anchor,t,y))}}}if(F=O,L=F&&F.placeable,z=F&&F.offscreen,t.useRuntimeCollisionCircles){let r=i.text.placedSymbolArray.get(t.centerJustifiedTextSymbolIndex),s=e.ai(i.textSizeData,m,r),p=a.get("text-padding");B=this.collisionIndex.placeCollisionCircles(x,r,i.lineVertexArray,i.glyphOffsetArray,s,l,c,u,h,n,A,g.predicate,t.collisionCircleDiameter,p,o,C),B.circles.length&&B.collisionDetected&&!n&&e.w("Collisions detected, but collision boxes are not shown"),L=_||B.circles.length>0&&!B.collisionDetected,z=z&&B.offscreen}if(d.iconFeatureIndex&&(V=d.iconFeatureIndex),d.iconBox){let t=t=>this.collisionIndex.placeCollisionBox(t,b,p,l,c,A,T,s,g.predicate,C,k&&D?D:void 0);R&&R.placeable&&d.verticalIconBox?(j=t(d.verticalIconBox),P=j.placeable):(j=t(d.iconBox),P=j.placeable),z=z&&j.offscreen}let H=y||0===t.numHorizontalGlyphVertices&&0===t.numVerticalGlyphVertices,G=v||0===t.numIconVertices;H||G?G?H||(P=P&&L):L=P&&L:P=L=P&&L;let W=P&&j.placeable;if(L&&F.placeable&&this.collisionIndex.insertCollisionBox(F.box,x,a.get("text-ignore-placement"),i.bucketInstanceId,R&&R.placeable&&U?U:N,g.ID),W&&this.collisionIndex.insertCollisionBox(j.box,b,a.get("icon-ignore-placement"),i.bucketInstanceId,V,g.ID),B&&L&&this.collisionIndex.insertCollisionCircles(B.circles,x,a.get("text-ignore-placement"),i.bucketInstanceId,N,g.ID),n&&this.storeCollisionData(i.bucketInstanceId,w,d,F,j,B),0===t.crossTileID)throw new Error("symbolInstance.crossTileID can't be 0");if(0===i.bucketInstanceId)throw new Error("bucket.bucketInstanceId can't be 0");this.placements[t.crossTileID]=new Ut(L||S,P||E,z||i.justReloaded),r[t.crossTileID]=!0};if(M){if(0!==t.symbolInstanceStart)throw new Error("bucket.bucketInstanceId should be 0");let e=i.getSortedSymbolIndexes(this.transform.angle);for(let t=e.length-1;t>=0;--t){let r=e[t];I(i.symbolInstances.get(r),i.collisionArrays[r],r)}}else for(let e=t.symbolInstanceStart;e=0&&(t.text.placedSymbolArray.get(e).crossTileID=a>=0&&e!==a?0:n.crossTileID)}markUsedOrientation(t,r,n){let i=r===e.ah.horizontal||r===e.ah.horizontalOnly?r:0,a=r===e.ah.vertical?r:0,o=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex];for(let e of o)t.text.placedSymbolArray.get(e).placedOrientation=i;n.verticalPlacedTextSymbolIndex&&(t.text.placedSymbolArray.get(n.verticalPlacedTextSymbolIndex).placedOrientation=a)}commit(t){this.commitTime=t,this.zoomAtLastRecencyCheck=this.transform.zoom;let e=this.prevPlacement,r=!1;this.prevZoomAdjustment=e?e.zoomAdjustment(this.transform.zoom):0;let n=e?e.symbolFadeChange(t):1,i=e?e.opacities:{},a=e?e.variableOffsets:{},o=e?e.placedOrientations:{};for(let t in this.placements){let e=this.placements[t],a=i[t];a?(this.opacities[t]=new Nt(a,n,e.text,e.icon),r=r||e.text!==a.text.placed||e.icon!==a.icon.placed):(this.opacities[t]=new Nt(null,n,e.text,e.icon,e.skipFade),r=r||e.text||e.icon)}for(let t in i){let e=i[t];if(!this.opacities[t]){let i=new Nt(e,n,!1,!1);i.isHidden()||(this.opacities[t]=i,r=r||e.text.placed||e.icon.placed)}}for(let t in a)this.variableOffsets[t]||!this.opacities[t]||this.opacities[t].isHidden()||(this.variableOffsets[t]=a[t]);for(let t in o)this.placedOrientations[t]||!this.opacities[t]||this.opacities[t].isHidden()||(this.placedOrientations[t]=o[t]);if(e&&void 0===e.lastPlacementChangeTime)throw new Error("Last placement time for previous placement is not defined");r?this.lastPlacementChangeTime=t:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=e?e.lastPlacementChangeTime:t)}updateLayerOpacities(t,e){let r={};for(let n of e){let e=n.getBucket(t);e&&n.latestFeatureIndex&&t.id===e.layerIds[0]&&this.updateBucketOpacities(e,n.tileID,r,n.collisionBoxArray)}}updateBucketOpacities(t,r,n,i){t.hasTextData()&&(t.text.opacityVertexArray.clear(),t.text.hasVisibleVertices=!1),t.hasIconData()&&(t.icon.opacityVertexArray.clear(),t.icon.hasVisibleVertices=!1),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexArray.clear(),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexArray.clear();let a=t.layers[0],o=a.layout,s=new Nt(null,0,!1,!1,!0),l=o.get("text-allow-overlap"),c=o.get("icon-allow-overlap"),u=a._unevaluatedLayout.hasValue("text-variable-anchor")||a._unevaluatedLayout.hasValue("text-variable-anchor-offset"),h="map"===o.get("text-rotation-alignment"),p="map"===o.get("text-pitch-alignment"),f="none"!==o.get("icon-text-fit"),d=new Nt(null,0,l&&(c||!t.hasIconData()||o.get("icon-optional")),c&&(l||!t.hasTextData()||o.get("text-optional")),!0);!t.collisionArrays&&i&&(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData())&&t.deserializeCollisionBoxes(i);let m=(t,e,r)=>{for(let n=0;n0,v=this.placedOrientations[i.crossTileID],x=v===e.ah.vertical,_=v===e.ah.horizontal||v===e.ah.horizontalOnly;if(a>0||o>0){let e=ee(c.text);m(t.text,a,x?re:e),m(t.text,o,_?re:e);let r=c.text.isHidden();[i.rightJustifiedTextSymbolIndex,i.centerJustifiedTextSymbolIndex,i.leftJustifiedTextSymbolIndex].forEach((e=>{e>=0&&(t.text.placedSymbolArray.get(e).hidden=r||x?1:0)})),i.verticalPlacedTextSymbolIndex>=0&&(t.text.placedSymbolArray.get(i.verticalPlacedTextSymbolIndex).hidden=r||_?1:0);let n=this.variableOffsets[i.crossTileID];n&&this.markUsedJustification(t,n.anchor,i,v);let s=this.placedOrientations[i.crossTileID];s&&(this.markUsedJustification(t,"left",i,s),this.markUsedOrientation(t,s,i))}if(y){let e=ee(c.icon),r=!(f&&i.verticalPlacedIconSymbolIndex&&x);i.placedIconSymbolIndex>=0&&(m(t.icon,i.numIconVertices,r?e:re),t.icon.placedSymbolArray.get(i.placedIconSymbolIndex).hidden=c.icon.isHidden()),i.verticalPlacedIconSymbolIndex>=0&&(m(t.icon,i.numVerticalIconVertices,r?re:e),t.icon.placedSymbolArray.get(i.verticalPlacedIconSymbolIndex).hidden=c.icon.isHidden())}let b=g&&g.has(r)?g.get(r):{text:null,icon:null};if(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData()){let n=t.collisionArrays[r];if(n){let r=new e.P(0,0);if(n.textBox||n.verticalTextBox){let e=!0;if(u){let t=this.variableOffsets[l];t?(r=Gt(t.anchor,t.width,t.height,t.textOffset,t.textBoxScale),h&&r._rotate(p?this.transform.angle:-this.transform.angle)):e=!1}if(n.textBox||n.verticalTextBox){let i;n.textBox&&(i=x),n.verticalTextBox&&(i=_),Zt(t.textCollisionBox.collisionVertexArray,c.text.placed,!e||i,b.text,r.x,r.y)}}if(n.iconBox||n.verticalIconBox){let e,i=!(_||!n.verticalIconBox);n.iconBox&&(e=i),n.verticalIconBox&&(e=!i),Zt(t.iconCollisionBox.collisionVertexArray,c.icon.placed,e,b.icon,f?r.x:0,f?r.y:0)}}}}if(t.sortFeatures(this.transform.angle),this.retainedQueryData[t.bucketInstanceId]&&(this.retainedQueryData[t.bucketInstanceId].featureSortOrder=t.featureSortOrder),t.hasTextData()&&t.text.opacityVertexBuffer&&t.text.opacityVertexBuffer.updateData(t.text.opacityVertexArray),t.hasIconData()&&t.icon.opacityVertexBuffer&&t.icon.opacityVertexBuffer.updateData(t.icon.opacityVertexArray),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexBuffer&&t.iconCollisionBox.collisionVertexBuffer.updateData(t.iconCollisionBox.collisionVertexArray),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexBuffer&&t.textCollisionBox.collisionVertexBuffer.updateData(t.textCollisionBox.collisionVertexArray),t.text.opacityVertexArray.length!==t.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${t.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${t.text.layoutVertexArray.length}) / 4`);if(t.icon.opacityVertexArray.length!==t.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${t.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${t.icon.layoutVertexArray.length}) / 4`);if(t.bucketInstanceId in this.collisionCircleArrays){let e=this.collisionCircleArrays[t.bucketInstanceId];t.placementInvProjMatrix=e.invProjMatrix,t.placementViewportMatrix=e.viewportMatrix,t.collisionCircleArray=e.circles,delete this.collisionCircleArrays[t.bucketInstanceId]}}symbolFadeChange(t){return 0===this.fadeDuration?1:(t-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(t){return Math.max(0,(this.transform.zoom-t)/1.5)}hasTransitions(t){return this.stale||t-this.lastPlacementChangeTimet}setStale(){this.stale=!0}}function Zt(t,e,r,n,i,a){n&&0!==n.length||(n=[0,0,0,0]);let o=n[0]-Rt,s=n[1]-Rt,l=n[2]-Rt,c=n[3]-Rt;t.emplaceBack(e?1:0,r?1:0,i||0,a||0,o,s),t.emplaceBack(e?1:0,r?1:0,i||0,a||0,l,s),t.emplaceBack(e?1:0,r?1:0,i||0,a||0,l,c),t.emplaceBack(e?1:0,r?1:0,i||0,a||0,o,c)}let Yt=Math.pow(2,25),Xt=Math.pow(2,24),$t=Math.pow(2,17),Kt=Math.pow(2,16),Jt=Math.pow(2,9),Qt=Math.pow(2,8),te=Math.pow(2,1);function ee(t){if(0===t.opacity&&!t.placed)return 0;if(1===t.opacity&&t.placed)return 4294967295;let e=t.placed?1:0,r=Math.floor(127*t.opacity);return r*Yt+e*Xt+r*$t+e*Kt+r*Jt+e*Qt+r*te+e}let re=0;function ne(){return{isOccluded:(t,e,r)=>!1,getPitchedTextCorrection:(t,e,r)=>1,get useSpecialProjectionForSymbols(){return!1},projectTileCoordinates(t,e,r,n){throw new Error("Not implemented.")},translatePosition:(t,e,r,n)=>function(t,e,r,n,i=!1){if(!r[0]&&!r[1])return[0,0];let a=i?"map"===n?t.angle:0:"viewport"===n?-t.angle:0;if(a){let t=Math.sin(a),e=Math.cos(a);r=[r[0]*e-r[1]*t,r[0]*t+r[1]*e]}return[i?r[0]:Bt(e,r[0],t.zoom),i?r[1]:Bt(e,r[1],t.zoom)]}(t,e,r,n),getCircleRadiusCorrection:t=>1}}class ie{constructor(t){this._sortAcrossTiles="viewport-y"!==t.layout.get("symbol-z-order")&&!t.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(t,e,r,n,i){let a=this._bucketParts;for(;this._currentTileIndext.sortKey-e.sortKey)));this._currentPartIndex!this._forceFullPlacement&&a.now()-n>2;for(;this._currentPlacementIndex>=0;){let n=e[t[this._currentPlacementIndex]],a=this.placement.collisionIndex.transform.zoom;if("symbol"===n.type&&(!n.minzoom||n.minzoom<=a)&&(!n.maxzoom||n.maxzoom>a)){if(this._inProgressLayer||(this._inProgressLayer=new ie(n)),this._inProgressLayer.continuePlacement(r[n.source],this.placement,this._showCollisionBoxes,n,i))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(t){return this.placement.commit(t),this.placement}}let oe=512/e.X/2;class se{constructor(t,r,n){this.tileID=t,this.bucketInstanceId=n,this._symbolsByKey={};let i=new Map;for(let t=0;t({x:Math.floor(t.anchorX*oe),y:Math.floor(t.anchorY*oe)}))),crossTileIDs:r.map((t=>t.crossTileID))};if(n.positions.length>128){let t=new e.av(n.positions.length,16,Uint16Array);for(let{x:e,y:r}of n.positions)t.add(e,r);t.finish(),delete n.positions,n.index=t}this._symbolsByKey[t]=n}}getScaledCoordinates(t,r){let{x:n,y:i,z:a}=this.tileID.canonical,{x:o,y:s,z:l}=r.canonical,c=oe/Math.pow(2,l-a),u=(s*e.X+t.anchorY)*c,h=i*e.X*oe;return{x:Math.floor((o*e.X+t.anchorX)*c-n*e.X*oe),y:Math.floor(u-h)}}findMatches(t,e,r){let n=this.tileID.canonical.zt))}}class le{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class ce{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(t){let e=Math.round((t-this.lng)/360);if(0!==e)for(let t in this.indexes){let r=this.indexes[t],n={};for(let t in r){let i=r[t];i.tileID=i.tileID.unwrapTo(i.tileID.wrap+e),n[i.tileID.key]=i}this.indexes[t]=n}this.lng=t}addBucket(t,e,r){if(this.indexes[t.overscaledZ]&&this.indexes[t.overscaledZ][t.key]){if(this.indexes[t.overscaledZ][t.key].bucketInstanceId===e.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(t.overscaledZ,this.indexes[t.overscaledZ][t.key])}for(let t=0;tt.overscaledZ)for(let r in i){let a=i[r];a.tileID.isChildOf(t)&&a.findMatches(e.symbolInstances,t,n)}else{let a=i[t.scaledTo(Number(r)).key];a&&a.findMatches(e.symbolInstances,t,n)}}for(let t=0;t{e[t]=!0}));for(let t in this.layerIndexes)e[t]||delete this.layerIndexes[t]}}let he=(t,r)=>e.t(t,r&&r.filter((t=>"source.canvas"!==t.identifier))),pe=e.aw();class fe extends e.E{constructor(t,r={}){super(),this._rtlPluginLoaded=()=>{for(let t in this.sourceCaches){let e=this.sourceCaches[t].getSource().type;"vector"!==e&&"geojson"!==e||this.sourceCaches[t].reload()}},this.map=t,this.dispatcher=new U(N(),t._getMapId()),this.dispatcher.registerMessageHandler("GG",((t,e)=>this.getGlyphs(t,e))),this.dispatcher.registerMessageHandler("GI",((t,e)=>this.getImages(t,e))),this.imageManager=new A,this.imageManager.setEventedParent(this),this.glyphManager=new C(t._requestManager,r.localIdeographFontFamily),this.lineAtlas=new D(256,512),this.crossTileSymbolIndex=new ue,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new e.ax,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("SR",e.ay()),lt().on(at,this._rtlPluginLoaded),this.on("data",(t=>{if("source"!==t.dataType||"metadata"!==t.sourceDataType)return;let e=this.sourceCaches[t.sourceId];if(!e)return;let r=e.getSource();if(r&&r.vectorLayerIds)for(let t in this._layers){let e=this._layers[t];e.source===r.id&&this._validateLayer(e)}}))}loadURL(t,r={},n){this.fire(new e.k("dataloading",{dataType:"style"})),r.validate="boolean"!=typeof r.validate||r.validate;let i=this.map._requestManager.transformRequest(t,"Style");this._loadStyleRequest=new AbortController;let a=this._loadStyleRequest;e.h(i,this._loadStyleRequest).then((t=>{this._loadStyleRequest=null,this._load(t.data,r,n)})).catch((t=>{this._loadStyleRequest=null,t&&!a.signal.aborted&&this.fire(new e.j(t))}))}loadJSON(t,r={},n){this.fire(new e.k("dataloading",{dataType:"style"})),this._frameRequest=new AbortController,a.frameAsync(this._frameRequest).then((()=>{this._frameRequest=null,r.validate=!1!==r.validate,this._load(t,r,n)})).catch((()=>{}))}loadEmpty(){this.fire(new e.k("dataloading",{dataType:"style"})),this._load(pe,{validate:!1})}_load(t,r,n){var i;let a=r.transformStyle?r.transformStyle(n,t):t;if(!r.validate||!he(this,e.u(a))){this._loaded=!0,this.stylesheet=a;for(let t in a.sources)this.addSource(t,a.sources[t],{validate:!1});a.sprite?this._loadSprite(a.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(a.glyphs),this._createLayers(),this.light=new L(this.stylesheet.light),this.sky=new z(this.stylesheet.sky),this.map.setTerrain(null!==(i=this.stylesheet.terrain)&&void 0!==i?i:null),this.fire(new e.k("data",{dataType:"style"})),this.fire(new e.k("style.load"))}}_createLayers(){let t=e.az(this.stylesheet.layers);this.dispatcher.broadcast("SL",t),this._order=t.map((t=>t.id)),this._layers={},this._serializedLayers=null;for(let r of t){let t=e.aA(r);t.setEventedParent(this,{layer:{id:r.id}}),this._layers[r.id]=t}}_loadSprite(t,r=!1,n=void 0){let i;this.imageManager.setLoaded(!1),this._spriteRequest=new AbortController,function(t,r,n,i){return e._(this,void 0,void 0,(function*(){let o=_(t),s=n>1?"@2x":"",l={},c={};for(let{id:t,url:n}of o){let a=r.transformRequest(b(n,s,".json"),"SpriteJSON");l[t]=e.h(a,i);let o=r.transformRequest(b(n,s,".png"),"SpriteImage");c[t]=f.getImage(o,i)}return yield Promise.all([...Object.values(l),...Object.values(c)]),function(t,r){return e._(this,void 0,void 0,(function*(){let e={};for(let n in t){e[n]={};let i=a.getImageCanvasContext((yield r[n]).data),o=(yield t[n]).data;for(let t in o){let{width:r,height:a,x:s,y:l,sdf:c,pixelRatio:u,stretchX:h,stretchY:p,content:f,textFitWidth:d,textFitHeight:m}=o[t];e[n][t]={data:null,pixelRatio:u,sdf:c,stretchX:h,stretchY:p,content:f,textFitWidth:d,textFitHeight:m,spriteData:{width:r,height:a,x:s,y:l,context:i}}}}return e}))}(l,c)}))}(t,this.map._requestManager,this.map.getPixelRatio(),this._spriteRequest).then((t=>{if(this._spriteRequest=null,t)for(let e in t){this._spritesImagesIds[e]=[];let n=this._spritesImagesIds[e]?this._spritesImagesIds[e].filter((e=>!(e in t))):[];for(let t of n)this.imageManager.removeImage(t),this._changedImages[t]=!0;for(let n in t[e]){let i="default"===e?n:`${e}:${n}`;this._spritesImagesIds[e].push(i),i in this.imageManager.images?this.imageManager.updateImage(i,t[e][n],!1):this.imageManager.addImage(i,t[e][n]),r&&(this._changedImages[i]=!0)}}})).catch((t=>{this._spriteRequest=null,i=t,this.fire(new e.j(i))})).finally((()=>{this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),r&&(this._changed=!0),this.dispatcher.broadcast("SI",this._availableImages),this.fire(new e.k("data",{dataType:"style"})),n&&n(i)}))}_unloadSprite(){for(let t of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(t),this._changedImages[t]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new e.k("data",{dataType:"style"}))}_validateLayer(t){let r=this.sourceCaches[t.source];if(!r)return;let n=t.sourceLayer;if(!n)return;let i=r.getSource();("geojson"===i.type||i.vectorLayerIds&&-1===i.vectorLayerIds.indexOf(n))&&this.fire(new e.j(new Error(`Source layer "${n}" does not exist on source "${i.id}" as specified by style layer "${t.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(let t in this.sourceCaches)if(!this.sourceCaches[t].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(t,r=!1){let n=this._serializedAllLayers();if(!t||0===t.length)return Object.values(r?e.aB(n):n);let i=[];for(let a of t)if(n[a]){let t=r?e.aB(n[a]):n[a];i.push(t)}return i}_serializedAllLayers(){let t=this._serializedLayers;if(t)return t;t=this._serializedLayers={};let e=Object.keys(this._layers);for(let r of e){let e=this._layers[r];"custom"!==e.type&&(t[r]=e.serialize())}return t}hasTransitions(){if(this.light&&this.light.hasTransition()||this.sky&&this.sky.hasTransition())return!0;for(let t in this.sourceCaches)if(this.sourceCaches[t].hasTransition())return!0;for(let t in this._layers)if(this._layers[t].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(t){if(!this._loaded)return;let r=this._changed;if(r){let e=Object.keys(this._updatedLayers),r=Object.keys(this._removedLayers);(e.length||r.length)&&this._updateWorkerLayers(e,r);for(let t in this._updatedSources){let e=this._updatedSources[t];if("reload"===e)this._reloadSource(t);else{if("clear"!==e)throw new Error(`Invalid action ${e}`);this._clearSource(t)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(let e in this._updatedPaintProps)this._layers[e].updateTransitions(t);this.light.updateTransitions(t),this.sky.updateTransitions(t),this._resetUpdates()}let n={};for(let t in this.sourceCaches){let e=this.sourceCaches[t];n[t]=e.used,e.used=!1}for(let e of this._order){let r=this._layers[e];r.recalculate(t,this._availableImages),!r.isHidden(t.zoom)&&r.source&&(this.sourceCaches[r.source].used=!0)}for(let t in n){let r=this.sourceCaches[t];!!n[t]!=!!r.used&&r.fire(new e.k("data",{sourceDataType:"visibility",dataType:"source",sourceId:t}))}this.light.recalculate(t),this.sky.recalculate(t),this.z=t.zoom,r&&this.fire(new e.k("data",{dataType:"style"}))}_updateTilesForChangedImages(){let t=Object.keys(this._changedImages);if(t.length){for(let e in this.sourceCaches)this.sourceCaches[e].reloadTilesForDependencies(["icons","patterns"],t);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(let t in this.sourceCaches)this.sourceCaches[t].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(t,e){this.dispatcher.broadcast("UL",{layers:this._serializeByIds(t,!1),removedIds:e})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(t,r={}){var n;this._checkLoaded();let i=this.serialize();if(t=r.transformStyle?r.transformStyle(i,t):t,(null===(n=r.validate)||void 0===n||n)&&he(this,e.u(t)))return!1;(t=e.aB(t)).layers=e.az(t.layers);let a=e.aC(i,t),o=this._getOperationsToPerform(a);if(o.unimplemented.length>0)throw new Error(`Unimplemented: ${o.unimplemented.join(", ")}.`);if(0===o.operations.length)return!1;for(let t of o.operations)t();return this.stylesheet=t,this._serializedLayers=null,!0}_getOperationsToPerform(t){let e=[],r=[];for(let n of t)switch(n.command){case"setCenter":case"setZoom":case"setBearing":case"setPitch":continue;case"addLayer":e.push((()=>this.addLayer.apply(this,n.args)));break;case"removeLayer":e.push((()=>this.removeLayer.apply(this,n.args)));break;case"setPaintProperty":e.push((()=>this.setPaintProperty.apply(this,n.args)));break;case"setLayoutProperty":e.push((()=>this.setLayoutProperty.apply(this,n.args)));break;case"setFilter":e.push((()=>this.setFilter.apply(this,n.args)));break;case"addSource":e.push((()=>this.addSource.apply(this,n.args)));break;case"removeSource":e.push((()=>this.removeSource.apply(this,n.args)));break;case"setLayerZoomRange":e.push((()=>this.setLayerZoomRange.apply(this,n.args)));break;case"setLight":e.push((()=>this.setLight.apply(this,n.args)));break;case"setGeoJSONSourceData":e.push((()=>this.setGeoJSONSourceData.apply(this,n.args)));break;case"setGlyphs":e.push((()=>this.setGlyphs.apply(this,n.args)));break;case"setSprite":e.push((()=>this.setSprite.apply(this,n.args)));break;case"setSky":e.push((()=>this.setSky.apply(this,n.args)));break;case"setTerrain":e.push((()=>this.map.setTerrain.apply(this,n.args)));break;case"setTransition":e.push((()=>{}));break;default:r.push(n.command)}return{operations:e,unimplemented:r}}addImage(t,r){if(this.getImage(t))return this.fire(new e.j(new Error(`An image named "${t}" already exists.`)));this.imageManager.addImage(t,r),this._afterImageUpdated(t)}updateImage(t,e){this.imageManager.updateImage(t,e)}getImage(t){return this.imageManager.getImage(t)}removeImage(t){if(!this.getImage(t))return this.fire(new e.j(new Error(`An image named "${t}" does not exist.`)));this.imageManager.removeImage(t),this._afterImageUpdated(t)}_afterImageUpdated(t){this._availableImages=this.imageManager.listImages(),this._changedImages[t]=!0,this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new e.k("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(t,r,n={}){if(this._checkLoaded(),void 0!==this.sourceCaches[t])throw new Error(`Source "${t}" already exists.`);if(!r.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(r).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(r.type)>=0&&this._validate(e.u.source,`sources.${t}`,r,null,n))return;this.map&&this.map._collectResourceTiming&&(r.collectResourceTiming=!0);let i=this.sourceCaches[t]=new pt(t,r,this.dispatcher);i.style=this,i.setEventedParent(this,(()=>({isSourceLoaded:i.loaded(),source:i.serialize(),sourceId:t}))),i.onAdd(this.map),this._changed=!0}removeSource(t){if(this._checkLoaded(),void 0===this.sourceCaches[t])throw new Error("There is no source with this ID");for(let r in this._layers)if(this._layers[r].source===t)return this.fire(new e.j(new Error(`Source "${t}" cannot be removed while layer "${r}" is using it.`)));let r=this.sourceCaches[t];delete this.sourceCaches[t],delete this._updatedSources[t],r.fire(new e.k("data",{sourceDataType:"metadata",dataType:"source",sourceId:t})),r.setEventedParent(null),r.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(t,e){if(this._checkLoaded(),void 0===this.sourceCaches[t])throw new Error(`There is no source with this ID=${t}`);let r=this.sourceCaches[t].getSource();if("geojson"!==r.type)throw new Error(`geojsonSource.type is ${r.type}, which is !== 'geojson`);r.setData(e),this._changed=!0}getSource(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()}addLayer(t,r,n={}){this._checkLoaded();let i,a=t.id;if(this.getLayer(a))return void this.fire(new e.j(new Error(`Layer "${a}" already exists on this map.`)));if("custom"===t.type){if(he(this,e.aD(t)))return;i=e.aA(t)}else{if("source"in t&&"object"==typeof t.source&&(this.addSource(a,t.source),t=e.aB(t),t=e.e(t,{source:a})),this._validate(e.u.layer,`layers.${a}`,t,{arrayIndex:-1},n))return;i=e.aA(t),this._validateLayer(i),i.setEventedParent(this,{layer:{id:a}})}let o=r?this._order.indexOf(r):this._order.length;if(r&&-1===o)this.fire(new e.j(new Error(`Cannot add layer "${a}" before non-existing layer "${r}".`)));else{if(this._order.splice(o,0,a),this._layerOrderChanged=!0,this._layers[a]=i,this._removedLayers[a]&&i.source&&"custom"!==i.type){let t=this._removedLayers[a];delete this._removedLayers[a],t.type!==i.type?this._updatedSources[i.source]="clear":(this._updatedSources[i.source]="reload",this.sourceCaches[i.source].pause())}this._updateLayer(i),i.onAdd&&i.onAdd(this.map)}}moveLayer(t,r){if(this._checkLoaded(),this._changed=!0,!this._layers[t])return void this.fire(new e.j(new Error(`The layer '${t}' does not exist in the map's style and cannot be moved.`)));if(t===r)return;let n=this._order.indexOf(t);this._order.splice(n,1);let i=r?this._order.indexOf(r):this._order.length;r&&-1===i?this.fire(new e.j(new Error(`Cannot move layer "${t}" before non-existing layer "${r}".`))):(this._order.splice(i,0,t),this._layerOrderChanged=!0)}removeLayer(t){this._checkLoaded();let r=this._layers[t];if(!r)return void this.fire(new e.j(new Error(`Cannot remove non-existing layer "${t}".`)));r.setEventedParent(null);let n=this._order.indexOf(t);this._order.splice(n,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[t]=r,delete this._layers[t],this._serializedLayers&&delete this._serializedLayers[t],delete this._updatedLayers[t],delete this._updatedPaintProps[t],r.onRemove&&r.onRemove(this.map)}getLayer(t){return this._layers[t]}getLayersOrder(){return[...this._order]}hasLayer(t){return t in this._layers}setLayerZoomRange(t,r,n){this._checkLoaded();let i=this.getLayer(t);i?i.minzoom===r&&i.maxzoom===n||(null!=r&&(i.minzoom=r),null!=n&&(i.maxzoom=n),this._updateLayer(i)):this.fire(new e.j(new Error(`Cannot set the zoom range of non-existing layer "${t}".`)))}setFilter(t,r,n={}){this._checkLoaded();let i=this.getLayer(t);if(i){if(!e.aE(i.filter,r))return null==r?(i.filter=void 0,void this._updateLayer(i)):void(this._validate(e.u.filter,`layers.${i.id}.filter`,r,null,n)||(i.filter=e.aB(r),this._updateLayer(i)))}else this.fire(new e.j(new Error(`Cannot filter non-existing layer "${t}".`)))}getFilter(t){return e.aB(this.getLayer(t).filter)}setLayoutProperty(t,r,n,i={}){this._checkLoaded();let a=this.getLayer(t);a?e.aE(a.getLayoutProperty(r),n)||(a.setLayoutProperty(r,n,i),this._updateLayer(a)):this.fire(new e.j(new Error(`Cannot style non-existing layer "${t}".`)))}getLayoutProperty(t,r){let n=this.getLayer(t);if(n)return n.getLayoutProperty(r);this.fire(new e.j(new Error(`Cannot get style of non-existing layer "${t}".`)))}setPaintProperty(t,r,n,i={}){this._checkLoaded();let a=this.getLayer(t);a?e.aE(a.getPaintProperty(r),n)||(a.setPaintProperty(r,n,i)&&this._updateLayer(a),this._changed=!0,this._updatedPaintProps[t]=!0,this._serializedLayers=null):this.fire(new e.j(new Error(`Cannot style non-existing layer "${t}".`)))}getPaintProperty(t,e){return this.getLayer(t).getPaintProperty(e)}setFeatureState(t,r){this._checkLoaded();let n=t.source,i=t.sourceLayer,a=this.sourceCaches[n];if(void 0===a)return void this.fire(new e.j(new Error(`The source '${n}' does not exist in the map's style.`)));let o=a.getSource().type;"geojson"===o&&i?this.fire(new e.j(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==o||i?(void 0===t.id&&this.fire(new e.j(new Error("The feature id parameter must be provided."))),a.setFeatureState(i,t.id,r)):this.fire(new e.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(t,r){this._checkLoaded();let n=t.source,i=this.sourceCaches[n];if(void 0===i)return void this.fire(new e.j(new Error(`The source '${n}' does not exist in the map's style.`)));let a=i.getSource().type,o="vector"===a?t.sourceLayer:void 0;"vector"!==a||o?r&&"string"!=typeof t.id&&"number"!=typeof t.id?this.fire(new e.j(new Error("A feature id is required to remove its specific state property."))):i.removeFeatureState(o,t.id,r):this.fire(new e.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(t){this._checkLoaded();let r=t.source,n=t.sourceLayer,i=this.sourceCaches[r];if(void 0!==i)return"vector"!==i.getSource().type||n?(void 0===t.id&&this.fire(new e.j(new Error("The feature id parameter must be provided."))),i.getFeatureState(n,t.id)):void this.fire(new e.j(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new e.j(new Error(`The source '${r}' does not exist in the map's style.`)))}getTransition(){return e.e({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){if(!this._loaded)return;let t=e.aF(this.sourceCaches,(t=>t.serialize())),r=this._serializeByIds(this._order,!0),n=this.map.getTerrain()||void 0,i=this.stylesheet;return e.aG({version:i.version,name:i.name,metadata:i.metadata,light:i.light,sky:i.sky,center:i.center,zoom:i.zoom,bearing:i.bearing,pitch:i.pitch,sprite:i.sprite,glyphs:i.glyphs,transition:i.transition,sources:t,layers:r,terrain:n},(t=>void 0!==t))}_updateLayer(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&"raster"!==this.sourceCaches[t.source].getSource().type&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(t){let e=t=>"fill-extrusion"===this._layers[t].type,r={},n=[];for(let i=this._order.length-1;i>=0;i--){let a=this._order[i];if(e(a)){r[a]=i;for(let e of t){let t=e[a];if(t)for(let e of t)n.push(e)}}}n.sort(((t,e)=>e.intersectionZ-t.intersectionZ));let i=[];for(let a=this._order.length-1;a>=0;a--){let o=this._order[a];if(e(o))for(let t=n.length-1;t>=0;t--){let e=n[t].feature;if(r[e.layer.id]{let n=r.featureSortOrder;if(n){let r=n.indexOf(t.featureIndex);return n.indexOf(e.featureIndex)-r}return e.featureIndex-t.featureIndex}));for(let t of i)e.push(t)}}for(let e in s)s[e].forEach((n=>{let i=n.feature,a=r[t[e].source].getFeatureState(i.layer["source-layer"],i.id);i.source=i.layer.source,i.layer["source-layer"]&&(i.sourceLayer=i.layer["source-layer"]),i.state=a}));return s}(this._layers,o,this.sourceCaches,t,r,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(a)}querySourceFeatures(t,r){r&&r.filter&&this._validate(e.u.filter,"querySourceFeatures.filter",r.filter,null,r);let n=this.sourceCaches[t];return n?function(t,e){let r=t.getRenderableIds().map((e=>t.getTileByID(e))),n=[],i={};for(let t=0;tt.getTileByID(e))).sort(((t,e)=>e.tileID.overscaledZ-t.tileID.overscaledZ||(t.tileID.isLessThan(e.tileID)?-1:1)))}let n=this.crossTileSymbolIndex.addLayer(r,l[r.source],t.center.lng);o=o||n}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((i=i||this._layerOrderChanged||0===r)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(a.now(),t.zoom))&&(this.pauseablePlacement=new ae(t,this.map.terrain,this._order,i,e,r,n,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,l),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(a.now()),s=!0),o&&this.pauseablePlacement.placement.setStale()),s||o)for(let t of this._order){let e=this._layers[t];"symbol"===e.type&&this.placement.updateLayerOpacities(e,l[e.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(a.now())}_releaseSymbolFadeTiles(){for(let t in this.sourceCaches)this.sourceCaches[t].releaseSymbolFadeTiles()}getImages(t,r){return e._(this,void 0,void 0,(function*(){let t=yield this.imageManager.getImages(r.icons);this._updateTilesForChangedImages();let e=this.sourceCaches[r.source];return e&&e.setDependencies(r.tileID.key,r.type,r.icons),t}))}getGlyphs(t,r){return e._(this,void 0,void 0,(function*(){let t=yield this.glyphManager.getGlyphs(r.stacks),e=this.sourceCaches[r.source];return e&&e.setDependencies(r.tileID.key,r.type,[""]),t}))}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(t,r={}){this._checkLoaded(),t&&this._validate(e.u.glyphs,"glyphs",t,null,r)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=t,this.glyphManager.entries={},this.glyphManager.setURL(t))}addSprite(t,r,n={},i){this._checkLoaded();let a=[{id:t,url:r}],o=[..._(this.stylesheet.sprite),...a];this._validate(e.u.sprite,"sprite",o,null,n)||(this.stylesheet.sprite=o,this._loadSprite(a,!0,i))}removeSprite(t){this._checkLoaded();let r=_(this.stylesheet.sprite);if(r.find((e=>e.id===t))){if(this._spritesImagesIds[t])for(let e of this._spritesImagesIds[t])this.imageManager.removeImage(e),this._changedImages[e]=!0;r.splice(r.findIndex((e=>e.id===t)),1),this.stylesheet.sprite=r.length>0?r:void 0,delete this._spritesImagesIds[t],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new e.k("data",{dataType:"style"}))}else this.fire(new e.j(new Error(`Sprite "${t}" doesn't exists on this map.`)))}getSprite(){return _(this.stylesheet.sprite)}setSprite(t,r={},n){this._checkLoaded(),t&&this._validate(e.u.sprite,"sprite",t,null,r)||(this.stylesheet.sprite=t,t?this._loadSprite(t,!0,n):(this._unloadSprite(),n&&n(null)))}}var de=e.Y([{name:"a_pos",type:"Int16",components:2}]);let me={prelude:ge("#ifdef GL_ES\nprecision mediump float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\n","#ifdef GL_ES\nprecision highp float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\nvec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0\n);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}\n#ifdef TERRAIN3D\nuniform sampler2D u_terrain;uniform float u_terrain_dim;uniform mat4 u_terrain_matrix;uniform vec4 u_terrain_unpack;uniform float u_terrain_exaggeration;uniform highp sampler2D u_depth;\n#endif\nconst highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitShifts=vec4(1.)/bitSh;highp float unpack(highp vec4 color) {return dot(color,bitShifts);}highp float depthOpacity(vec3 frag) {\n#ifdef TERRAIN3D\nhighp float d=unpack(texture2D(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0));\n#else\nreturn 1.0;\n#endif\n}float calculate_visibility(vec4 pos) {\n#ifdef TERRAIN3D\nvec3 frag=pos.xyz/pos.w;highp float d=depthOpacity(frag);if (d > 0.95) return 1.0;return (d+depthOpacity(frag+vec3(0.0,0.01,0.0)))/2.0;\n#else\nreturn 1.0;\n#endif\n}float ele(vec2 pos) {\n#ifdef TERRAIN3D\nvec4 rgb=(texture2D(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a;\n#else\nreturn 0.0;\n#endif\n}float get_elevation(vec2 pos) {\n#ifdef TERRAIN3D\nvec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.0;vec2 f=fract(coord);vec2 c=(floor(coord)+0.5)/(u_terrain_dim+2.0);float d=1.0/(u_terrain_dim+2.0);float tl=ele(c);float tr=ele(c+vec2(d,0.0));float bl=ele(c+vec2(0.0,d));float br=ele(c+vec2(d,d));float elevation=mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);return elevation*u_terrain_exaggeration;\n#else\nreturn 0.0;\n#endif\n}"),background:ge("uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),backgroundPattern:ge("uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),circle:ge("varying vec3 v_data;varying float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=v_data.xy;float extrude_length=length(extrude);float antialiased_blur=v_data.z;float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));gl_FragColor=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;varying float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main(void) {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);float ele=get_elevation(circle_center);v_visibility=calculate_visibility(u_matrix*vec4(circle_center,ele,1.0));if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,ele,1);} else {gl_Position=u_matrix*vec4(circle_center,ele,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}float antialiasblur=-max(1.0/u_device_pixel_ratio/(radius+stroke_width),blur);v_data=vec3(extrude.x,extrude.y,antialiasblur);}"),clippingMask:ge("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:ge("uniform highp float u_intensity;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma mapbox: initialize highp float weight\nfloat d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#pragma mapbox: define mediump float radius\nconst highp float ZERO=1.0/255.0/16.0;\n#define GAUSS_COEF 0.3989422804014327\nvoid main(void) {\n#pragma mapbox: initialize highp float weight\n#pragma mapbox: initialize mediump float radius\nvec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,get_elevation(floor(a_pos*0.5)),1);gl_Position=u_matrix*pos;}"),heatmapTexture:ge("uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(0.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),collisionBox:ge("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_anchor_pos;attribute vec2 a_placed;attribute vec2 a_box_real;uniform mat4 u_matrix;uniform vec2 u_pixel_extrude_scale;varying float v_placed;varying float v_notUsed;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);}void main() {gl_Position=projectTileWithElevation(a_anchor_pos,get_elevation(a_anchor_pos));gl_Position.xy=((a_box_real+0.5)*u_pixel_extrude_scale*2.0-1.0)*vec2(1.0,-1.0)*gl_Position.w;if (gl_Position.z/gl_Position.w < 1.1) {gl_Position.z=0.5;}v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:ge("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),debug:ge("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,get_elevation(a_pos),1);}"),fill:ge("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_FragColor=color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);}"),fillOutline:ge("varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),fillOutlinePattern:ge("uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),fillPattern:ge("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}"),fillExtrusion:ge("varying vec4 v_color;void main() {gl_FragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;\n#ifdef TERRAIN3D\nattribute vec2 a_centroid;\n#endif\nvarying vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 normal=a_normal_ed.xyz;\n#ifdef TERRAIN3D\nfloat height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);\n#else\nfloat height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;\n#endif\nbase=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}"),fillExtrusionPattern:ge("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;\n#ifdef TERRAIN3D\nattribute vec2 a_centroid;\n#endif\nvarying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;\n#ifdef TERRAIN3D\nfloat height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);\n#else\nfloat height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;\n#endif\nbase=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0\n? a_pos\n: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}"),hillshadePrepare:ge("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),hillshade:ge("uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;\n#define PI 3.141592653589793\nvoid main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),line:ge("uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_width2=vec2(outset,inset);}"),lineGradient:ge("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_width2=vec2(outset,inset);}"),linePattern:ge("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}"),lineSDF:ge("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}"),raster:ge("uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),symbolIcon:ge("uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;varying vec2 v_tex;varying float v_fade_opacity;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);}\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}gl_Position=finalPos;v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float visibility=calculate_visibility(projectedPoint);v_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));}"),symbolSDF:ge("#define SDF_PX 8.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float inner_edge=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);inner_edge=inner_edge+gamma*gamma_scale;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(inner_edge-gamma_scaled,inner_edge+gamma_scaled,dist);if (u_is_halo) {lowp float halo_edge=(6.0-halo_width/fontScale)/SDF_PX;alpha=min(smoothstep(halo_edge-gamma_scaled,halo_edge+gamma_scaled,dist),1.0-alpha);}gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_translation;uniform float u_pitched_scale;varying vec2 v_data0;varying vec3 v_data1;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);}\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}"),symbolTextAndIcon:ge("#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;varying vec4 v_data0;varying vec4 v_data1;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);}\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}"),terrain:ge("uniform sampler2D u_texture;uniform vec4 u_fog_color;uniform vec4 u_horizon_color;uniform float u_fog_ground_blend;uniform float u_fog_ground_blend_opacity;uniform float u_horizon_fog_blend;varying vec2 v_texture_pos;varying float v_fog_depth;const float gamma=2.2;vec4 gammaToLinear(vec4 color) {return pow(color,vec4(gamma));}vec4 linearToGamma(vec4 color) {return pow(color,vec4(1.0/gamma));}void main() {vec4 surface_color=texture2D(u_texture,v_texture_pos);if (v_fog_depth > u_fog_ground_blend) {vec4 surface_color_linear=gammaToLinear(surface_color);float blend_color=smoothstep(0.0,1.0,max((v_fog_depth-u_horizon_fog_blend)/(1.0-u_horizon_fog_blend),0.0));vec4 fog_horizon_color_linear=mix(gammaToLinear(u_fog_color),gammaToLinear(u_horizon_color),blend_color);float factor_fog=max(v_fog_depth-u_fog_ground_blend,0.0)/(1.0-u_fog_ground_blend);gl_FragColor=linearToGamma(mix(surface_color_linear,fog_horizon_color_linear,pow(factor_fog,2.0)*u_fog_ground_blend_opacity));} else {gl_FragColor=surface_color;}}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform mat4 u_fog_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;varying float v_fog_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);vec4 pos=u_fog_matrix*vec4(a_pos3d.xy,ele,1.0);v_fog_depth=pos.z/pos.w*0.5+0.5;}"),terrainDepth:ge("varying float v_depth;const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitMsk=vec4(0.,vec3(1./256.0));highp vec4 pack(highp float value) {highp vec4 comp=fract(value*bitSh);comp-=comp.xxyz*bitMsk;return comp;}void main() {gl_FragColor=pack(v_depth);}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying float v_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);v_depth=gl_Position.z/gl_Position.w;}"),terrainCoords:ge("precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;varying vec2 v_texture_pos;void main() {vec4 rgba=texture2D(u_texture,v_texture_pos);gl_FragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);}"),sky:ge("uniform vec4 u_sky_color;uniform vec4 u_horizon_color;uniform float u_horizon;uniform float u_sky_horizon_blend;void main() {float y=gl_FragCoord.y;if (y > u_horizon) {float blend=y-u_horizon;if (blend < u_sky_horizon_blend) {gl_FragColor=mix(u_sky_color,u_horizon_color,pow(1.0-blend/u_sky_horizon_blend,2.0));} else {gl_FragColor=u_sky_color;}}}","attribute vec2 a_pos;void main() {gl_Position=vec4(a_pos,1.0,1.0);}")};function ge(t,e){let r=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,n=e.match(/attribute ([\w]+) ([\w]+)/g),i=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),a=e.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),o=a?a.concat(i):i,s={};return{fragmentSource:t=t.replace(r,((t,e,r,n,i)=>(s[i]=!0,"define"===e?`\n#ifndef HAS_UNIFORM_u_${i}\nvarying ${r} ${n} ${i};\n#else\nuniform ${r} ${n} u_${i};\n#endif\n`:`\n#ifdef HAS_UNIFORM_u_${i}\n ${r} ${n} ${i} = u_${i};\n#endif\n`))),vertexSource:e=e.replace(r,((t,e,r,n,i)=>{let a="float"===n?"vec2":"vec4",o=i.match(/color/)?"color":a;return s[i]?"define"===e?`\n#ifndef HAS_UNIFORM_u_${i}\nuniform lowp float u_${i}_t;\nattribute ${r} ${a} a_${i};\nvarying ${r} ${n} ${i};\n#else\nuniform ${r} ${n} u_${i};\n#endif\n`:"vec4"===o?`\n#ifndef HAS_UNIFORM_u_${i}\n ${i} = a_${i};\n#else\n ${r} ${n} ${i} = u_${i};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${i}\n ${i} = unpack_mix_${o}(a_${i}, u_${i}_t);\n#else\n ${r} ${n} ${i} = u_${i};\n#endif\n`:"define"===e?`\n#ifndef HAS_UNIFORM_u_${i}\nuniform lowp float u_${i}_t;\nattribute ${r} ${a} a_${i};\n#else\nuniform ${r} ${n} u_${i};\n#endif\n`:"vec4"===o?`\n#ifndef HAS_UNIFORM_u_${i}\n ${r} ${n} ${i} = a_${i};\n#else\n ${r} ${n} ${i} = u_${i};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${i}\n ${r} ${n} ${i} = unpack_mix_${o}(a_${i}, u_${i}_t);\n#else\n ${r} ${n} ${i} = u_${i};\n#endif\n`})),staticAttributes:n,staticUniforms:o}}class ye{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(t,e,r,n,i,a,o,s,l){this.context=t;let c=this.boundPaintVertexBuffers.length!==n.length;for(let t=0;!c&&t({u_matrix:t,u_texture:0,u_ele_delta:r,u_fog_matrix:n,u_fog_color:i?i.properties.get("fog-color"):e.aM.white,u_fog_ground_blend:i?i.properties.get("fog-ground-blend"):1,u_fog_ground_blend_opacity:i?i.calculateFogBlendOpacity(a):0,u_horizon_color:i?i.properties.get("horizon-color"):e.aM.white,u_horizon_fog_blend:i?i.properties.get("horizon-fog-blend"):1});function xe(t){let e=[];for(let r=0;r>16,s>>16],u_pixel_coord_lower:[65535&o,65535&s]}}let we=(t,r,n,i)=>{let a=r.style.light,o=a.properties.get("position"),s=[o.x,o.y,o.z],l=(c=new e.A(9),e.A!=Float32Array&&(c[1]=0,c[2]=0,c[3]=0,c[5]=0,c[6]=0,c[7]=0),c[0]=1,c[4]=1,c[8]=1,c);var c;"viewport"===a.properties.get("anchor")&&function(t,e){var r=Math.sin(e),n=Math.cos(e);t[0]=n,t[1]=r,t[2]=0,t[3]=-r,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1}(l,-r.transform.angle),function(t,e,r){var n=e[0],i=e[1],a=e[2];t[0]=n*r[0]+i*r[3]+a*r[6],t[1]=n*r[1]+i*r[4]+a*r[7],t[2]=n*r[2]+i*r[5]+a*r[8]}(s,s,l);let u=a.properties.get("color");return{u_matrix:t,u_lightpos:s,u_lightintensity:a.properties.get("intensity"),u_lightcolor:[u.r,u.g,u.b],u_vertical_gradient:+n,u_opacity:i}},Te=(t,r,n,i,a,o,s)=>e.e(we(t,r,n,i),be(o,r,s),{u_height_factor:-Math.pow(2,a.overscaledZ)/s.tileSize/8}),Ae=t=>({u_matrix:t}),ke=(t,r,n,i)=>e.e(Ae(t),be(n,r,i)),Me=(t,e)=>({u_matrix:t,u_world:e}),Se=(t,r,n,i,a)=>e.e(ke(t,r,n,i),{u_world:a}),Ee=(t,e,r,n)=>{let i,a,o=t.transform;if("map"===n.paint.get("circle-pitch-alignment")){let t=Bt(r,1,o.zoom);i=!0,a=[t,t]}else i=!1,a=o.pixelsToGLUnits;return{u_camera_to_center_distance:o.cameraToCenterDistance,u_scale_with_map:+("map"===n.paint.get("circle-pitch-scale")),u_matrix:t.translatePosMatrix(e.posMatrix,r,n.paint.get("circle-translate"),n.paint.get("circle-translate-anchor")),u_pitch_with_map:+i,u_device_pixel_ratio:t.pixelRatio,u_extrude_scale:a}},Ce=(t,e,r)=>({u_matrix:t,u_inv_matrix:e,u_camera_to_center_distance:r.cameraToCenterDistance,u_viewport_size:[r.width,r.height]}),Ie=(t,e,r=1)=>({u_matrix:t,u_color:e,u_overlay:0,u_overlay_scale:r}),Le=t=>({u_matrix:t}),Pe=(t,e,r,n)=>({u_matrix:t,u_extrude_scale:Bt(e,1,r),u_intensity:n}),ze=(t,r,n,i)=>{let a=e.H();e.aP(a,0,t.width,t.height,0,0,1);let o=t.context.gl;return{u_matrix:a,u_world:[o.drawingBufferWidth,o.drawingBufferHeight],u_image:n,u_color_ramp:i,u_opacity:r.paint.get("heatmap-opacity")}};function De(t,r){let n=Math.pow(2,r.canonical.z),i=r.canonical.y;return[new e.Z(0,i/n).toLngLat().lat,new e.Z(0,(i+1)/n).toLngLat().lat]}let Oe=(t,e,r,n)=>{let i=t.transform;return{u_matrix:Ne(t,e,r,n),u_ratio:1/Bt(e,1,i.zoom),u_device_pixel_ratio:t.pixelRatio,u_units_to_pixels:[1/i.pixelsToGLUnits[0],1/i.pixelsToGLUnits[1]]}},Re=(t,r,n,i,a)=>e.e(Oe(t,r,n,a),{u_image:0,u_image_height:i}),Fe=(t,e,r,n,i)=>{let a=t.transform,o=je(e,a);return{u_matrix:Ne(t,e,r,i),u_texsize:e.imageAtlasTexture.size,u_ratio:1/Bt(e,1,a.zoom),u_device_pixel_ratio:t.pixelRatio,u_image:0,u_scale:[o,n.fromScale,n.toScale],u_fade:n.t,u_units_to_pixels:[1/a.pixelsToGLUnits[0],1/a.pixelsToGLUnits[1]]}},Be=(t,r,n,i,a,o)=>{let s=t.lineAtlas,l=je(r,t.transform),c="round"===n.layout.get("line-cap"),u=s.getDash(i.from,c),h=s.getDash(i.to,c),p=u.width*a.fromScale,f=h.width*a.toScale;return e.e(Oe(t,r,n,o),{u_patternscale_a:[l/p,-u.height/2],u_patternscale_b:[l/f,-h.height/2],u_sdfgamma:s.width/(256*Math.min(p,f)*t.pixelRatio)/2,u_image:0,u_tex_y_a:u.y,u_tex_y_b:h.y,u_mix:a.t})};function je(t,e){return 1/Bt(t,1,e.tileZoom)}function Ne(t,e,r,n){return t.translatePosMatrix(n?n.posMatrix:e.tileID.posMatrix,e,r.paint.get("line-translate"),r.paint.get("line-translate-anchor"))}let Ue=(t,e,r,n,i)=>{return{u_matrix:t,u_tl_parent:e,u_scale_parent:r,u_buffer_scale:1,u_fade_t:n.mix,u_opacity:n.opacity*i.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:i.paint.get("raster-brightness-min"),u_brightness_high:i.paint.get("raster-brightness-max"),u_saturation_factor:(o=i.paint.get("raster-saturation"),o>0?1-1/(1.001-o):-o),u_contrast_factor:(a=i.paint.get("raster-contrast"),a>0?1/(1-a):1+a),u_spin_weights:Ve(i.paint.get("raster-hue-rotate"))};var a,o};function Ve(t){t*=Math.PI/180;let e=Math.sin(t),r=Math.cos(t);return[(2*r+1)/3,(-Math.sqrt(3)*e-r+1)/3,(Math.sqrt(3)*e-r+1)/3]}let qe=(t,e,r,n,i,a,o,s,l,c,u,h,p,f)=>{let d=o.transform;return{u_is_size_zoom_constant:+("constant"===t||"source"===t),u_is_size_feature_constant:+("constant"===t||"camera"===t),u_size_t:e?e.uSizeT:0,u_size:e?e.uSize:0,u_camera_to_center_distance:d.cameraToCenterDistance,u_pitch:d.pitch/360*2*Math.PI,u_rotate_symbol:+r,u_aspect_ratio:d.width/d.height,u_fade_change:o.options.fadeDuration?o.symbolFadeChange:1,u_matrix:s,u_label_plane_matrix:l,u_coord_matrix:c,u_is_text:+h,u_pitch_with_map:+n,u_is_along_line:i,u_is_variable_anchor:a,u_texsize:p,u_texture:0,u_translation:u,u_pitched_scale:f}},He=(t,r,n,i,a,o,s,l,c,u,h,p,f,d,m)=>{let g=s.transform;return e.e(qe(t,r,n,i,a,o,s,l,c,u,h,p,f,m),{u_gamma_scale:i?Math.cos(g._pitch)*g.cameraToCenterDistance:1,u_device_pixel_ratio:s.pixelRatio,u_is_halo:+d})},Ge=(t,r,n,i,a,o,s,l,c,u,h,p,f,d)=>e.e(He(t,r,n,i,a,o,s,l,c,u,h,!0,p,!0,d),{u_texsize_icon:f,u_texture_icon:1}),We=(t,e,r)=>({u_matrix:t,u_opacity:e,u_color:r}),Ze=(t,r,n,i,a,o)=>e.e(function(t,e,r,n){let i=r.imageManager.getPattern(t.from.toString()),a=r.imageManager.getPattern(t.to.toString()),{width:o,height:s}=r.imageManager.getPixelSize(),l=Math.pow(2,n.tileID.overscaledZ),c=n.tileSize*Math.pow(2,r.transform.tileZoom)/l,u=c*(n.tileID.canonical.x+n.tileID.wrap*l),h=c*n.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:i.tl,u_pattern_br_a:i.br,u_pattern_tl_b:a.tl,u_pattern_br_b:a.br,u_texsize:[o,s],u_mix:e.t,u_pattern_size_a:i.displaySize,u_pattern_size_b:a.displaySize,u_scale_a:e.fromScale,u_scale_b:e.toScale,u_tile_units_to_pixels:1/Bt(n,1,r.transform.tileZoom),u_pixel_coord_upper:[u>>16,h>>16],u_pixel_coord_lower:[65535&u,65535&h]}}(i,o,n,a),{u_matrix:t,u_opacity:r}),Ye={fillExtrusion:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_lightpos:new e.aN(t,r.u_lightpos),u_lightintensity:new e.aI(t,r.u_lightintensity),u_lightcolor:new e.aN(t,r.u_lightcolor),u_vertical_gradient:new e.aI(t,r.u_vertical_gradient),u_opacity:new e.aI(t,r.u_opacity)}),fillExtrusionPattern:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_lightpos:new e.aN(t,r.u_lightpos),u_lightintensity:new e.aI(t,r.u_lightintensity),u_lightcolor:new e.aN(t,r.u_lightcolor),u_vertical_gradient:new e.aI(t,r.u_vertical_gradient),u_height_factor:new e.aI(t,r.u_height_factor),u_image:new e.aH(t,r.u_image),u_texsize:new e.aO(t,r.u_texsize),u_pixel_coord_upper:new e.aO(t,r.u_pixel_coord_upper),u_pixel_coord_lower:new e.aO(t,r.u_pixel_coord_lower),u_scale:new e.aN(t,r.u_scale),u_fade:new e.aI(t,r.u_fade),u_opacity:new e.aI(t,r.u_opacity)}),fill:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix)}),fillPattern:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_image:new e.aH(t,r.u_image),u_texsize:new e.aO(t,r.u_texsize),u_pixel_coord_upper:new e.aO(t,r.u_pixel_coord_upper),u_pixel_coord_lower:new e.aO(t,r.u_pixel_coord_lower),u_scale:new e.aN(t,r.u_scale),u_fade:new e.aI(t,r.u_fade)}),fillOutline:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_world:new e.aO(t,r.u_world)}),fillOutlinePattern:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_world:new e.aO(t,r.u_world),u_image:new e.aH(t,r.u_image),u_texsize:new e.aO(t,r.u_texsize),u_pixel_coord_upper:new e.aO(t,r.u_pixel_coord_upper),u_pixel_coord_lower:new e.aO(t,r.u_pixel_coord_lower),u_scale:new e.aN(t,r.u_scale),u_fade:new e.aI(t,r.u_fade)}),circle:(t,r)=>({u_camera_to_center_distance:new e.aI(t,r.u_camera_to_center_distance),u_scale_with_map:new e.aH(t,r.u_scale_with_map),u_pitch_with_map:new e.aH(t,r.u_pitch_with_map),u_extrude_scale:new e.aO(t,r.u_extrude_scale),u_device_pixel_ratio:new e.aI(t,r.u_device_pixel_ratio),u_matrix:new e.aJ(t,r.u_matrix)}),collisionBox:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_pixel_extrude_scale:new e.aO(t,r.u_pixel_extrude_scale)}),collisionCircle:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_inv_matrix:new e.aJ(t,r.u_inv_matrix),u_camera_to_center_distance:new e.aI(t,r.u_camera_to_center_distance),u_viewport_size:new e.aO(t,r.u_viewport_size)}),debug:(t,r)=>({u_color:new e.aL(t,r.u_color),u_matrix:new e.aJ(t,r.u_matrix),u_overlay:new e.aH(t,r.u_overlay),u_overlay_scale:new e.aI(t,r.u_overlay_scale)}),clippingMask:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix)}),heatmap:(t,r)=>({u_extrude_scale:new e.aI(t,r.u_extrude_scale),u_intensity:new e.aI(t,r.u_intensity),u_matrix:new e.aJ(t,r.u_matrix)}),heatmapTexture:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_world:new e.aO(t,r.u_world),u_image:new e.aH(t,r.u_image),u_color_ramp:new e.aH(t,r.u_color_ramp),u_opacity:new e.aI(t,r.u_opacity)}),hillshade:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_image:new e.aH(t,r.u_image),u_latrange:new e.aO(t,r.u_latrange),u_light:new e.aO(t,r.u_light),u_shadow:new e.aL(t,r.u_shadow),u_highlight:new e.aL(t,r.u_highlight),u_accent:new e.aL(t,r.u_accent)}),hillshadePrepare:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_image:new e.aH(t,r.u_image),u_dimension:new e.aO(t,r.u_dimension),u_zoom:new e.aI(t,r.u_zoom),u_unpack:new e.aK(t,r.u_unpack)}),line:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_ratio:new e.aI(t,r.u_ratio),u_device_pixel_ratio:new e.aI(t,r.u_device_pixel_ratio),u_units_to_pixels:new e.aO(t,r.u_units_to_pixels)}),lineGradient:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_ratio:new e.aI(t,r.u_ratio),u_device_pixel_ratio:new e.aI(t,r.u_device_pixel_ratio),u_units_to_pixels:new e.aO(t,r.u_units_to_pixels),u_image:new e.aH(t,r.u_image),u_image_height:new e.aI(t,r.u_image_height)}),linePattern:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_texsize:new e.aO(t,r.u_texsize),u_ratio:new e.aI(t,r.u_ratio),u_device_pixel_ratio:new e.aI(t,r.u_device_pixel_ratio),u_image:new e.aH(t,r.u_image),u_units_to_pixels:new e.aO(t,r.u_units_to_pixels),u_scale:new e.aN(t,r.u_scale),u_fade:new e.aI(t,r.u_fade)}),lineSDF:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_ratio:new e.aI(t,r.u_ratio),u_device_pixel_ratio:new e.aI(t,r.u_device_pixel_ratio),u_units_to_pixels:new e.aO(t,r.u_units_to_pixels),u_patternscale_a:new e.aO(t,r.u_patternscale_a),u_patternscale_b:new e.aO(t,r.u_patternscale_b),u_sdfgamma:new e.aI(t,r.u_sdfgamma),u_image:new e.aH(t,r.u_image),u_tex_y_a:new e.aI(t,r.u_tex_y_a),u_tex_y_b:new e.aI(t,r.u_tex_y_b),u_mix:new e.aI(t,r.u_mix)}),raster:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_tl_parent:new e.aO(t,r.u_tl_parent),u_scale_parent:new e.aI(t,r.u_scale_parent),u_buffer_scale:new e.aI(t,r.u_buffer_scale),u_fade_t:new e.aI(t,r.u_fade_t),u_opacity:new e.aI(t,r.u_opacity),u_image0:new e.aH(t,r.u_image0),u_image1:new e.aH(t,r.u_image1),u_brightness_low:new e.aI(t,r.u_brightness_low),u_brightness_high:new e.aI(t,r.u_brightness_high),u_saturation_factor:new e.aI(t,r.u_saturation_factor),u_contrast_factor:new e.aI(t,r.u_contrast_factor),u_spin_weights:new e.aN(t,r.u_spin_weights)}),symbolIcon:(t,r)=>({u_is_size_zoom_constant:new e.aH(t,r.u_is_size_zoom_constant),u_is_size_feature_constant:new e.aH(t,r.u_is_size_feature_constant),u_size_t:new e.aI(t,r.u_size_t),u_size:new e.aI(t,r.u_size),u_camera_to_center_distance:new e.aI(t,r.u_camera_to_center_distance),u_pitch:new e.aI(t,r.u_pitch),u_rotate_symbol:new e.aH(t,r.u_rotate_symbol),u_aspect_ratio:new e.aI(t,r.u_aspect_ratio),u_fade_change:new e.aI(t,r.u_fade_change),u_matrix:new e.aJ(t,r.u_matrix),u_label_plane_matrix:new e.aJ(t,r.u_label_plane_matrix),u_coord_matrix:new e.aJ(t,r.u_coord_matrix),u_is_text:new e.aH(t,r.u_is_text),u_pitch_with_map:new e.aH(t,r.u_pitch_with_map),u_is_along_line:new e.aH(t,r.u_is_along_line),u_is_variable_anchor:new e.aH(t,r.u_is_variable_anchor),u_texsize:new e.aO(t,r.u_texsize),u_texture:new e.aH(t,r.u_texture),u_translation:new e.aO(t,r.u_translation),u_pitched_scale:new e.aI(t,r.u_pitched_scale)}),symbolSDF:(t,r)=>({u_is_size_zoom_constant:new e.aH(t,r.u_is_size_zoom_constant),u_is_size_feature_constant:new e.aH(t,r.u_is_size_feature_constant),u_size_t:new e.aI(t,r.u_size_t),u_size:new e.aI(t,r.u_size),u_camera_to_center_distance:new e.aI(t,r.u_camera_to_center_distance),u_pitch:new e.aI(t,r.u_pitch),u_rotate_symbol:new e.aH(t,r.u_rotate_symbol),u_aspect_ratio:new e.aI(t,r.u_aspect_ratio),u_fade_change:new e.aI(t,r.u_fade_change),u_matrix:new e.aJ(t,r.u_matrix),u_label_plane_matrix:new e.aJ(t,r.u_label_plane_matrix),u_coord_matrix:new e.aJ(t,r.u_coord_matrix),u_is_text:new e.aH(t,r.u_is_text),u_pitch_with_map:new e.aH(t,r.u_pitch_with_map),u_is_along_line:new e.aH(t,r.u_is_along_line),u_is_variable_anchor:new e.aH(t,r.u_is_variable_anchor),u_texsize:new e.aO(t,r.u_texsize),u_texture:new e.aH(t,r.u_texture),u_gamma_scale:new e.aI(t,r.u_gamma_scale),u_device_pixel_ratio:new e.aI(t,r.u_device_pixel_ratio),u_is_halo:new e.aH(t,r.u_is_halo),u_translation:new e.aO(t,r.u_translation),u_pitched_scale:new e.aI(t,r.u_pitched_scale)}),symbolTextAndIcon:(t,r)=>({u_is_size_zoom_constant:new e.aH(t,r.u_is_size_zoom_constant),u_is_size_feature_constant:new e.aH(t,r.u_is_size_feature_constant),u_size_t:new e.aI(t,r.u_size_t),u_size:new e.aI(t,r.u_size),u_camera_to_center_distance:new e.aI(t,r.u_camera_to_center_distance),u_pitch:new e.aI(t,r.u_pitch),u_rotate_symbol:new e.aH(t,r.u_rotate_symbol),u_aspect_ratio:new e.aI(t,r.u_aspect_ratio),u_fade_change:new e.aI(t,r.u_fade_change),u_matrix:new e.aJ(t,r.u_matrix),u_label_plane_matrix:new e.aJ(t,r.u_label_plane_matrix),u_coord_matrix:new e.aJ(t,r.u_coord_matrix),u_is_text:new e.aH(t,r.u_is_text),u_pitch_with_map:new e.aH(t,r.u_pitch_with_map),u_is_along_line:new e.aH(t,r.u_is_along_line),u_is_variable_anchor:new e.aH(t,r.u_is_variable_anchor),u_texsize:new e.aO(t,r.u_texsize),u_texsize_icon:new e.aO(t,r.u_texsize_icon),u_texture:new e.aH(t,r.u_texture),u_texture_icon:new e.aH(t,r.u_texture_icon),u_gamma_scale:new e.aI(t,r.u_gamma_scale),u_device_pixel_ratio:new e.aI(t,r.u_device_pixel_ratio),u_is_halo:new e.aH(t,r.u_is_halo),u_translation:new e.aO(t,r.u_translation),u_pitched_scale:new e.aI(t,r.u_pitched_scale)}),background:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_opacity:new e.aI(t,r.u_opacity),u_color:new e.aL(t,r.u_color)}),backgroundPattern:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_opacity:new e.aI(t,r.u_opacity),u_image:new e.aH(t,r.u_image),u_pattern_tl_a:new e.aO(t,r.u_pattern_tl_a),u_pattern_br_a:new e.aO(t,r.u_pattern_br_a),u_pattern_tl_b:new e.aO(t,r.u_pattern_tl_b),u_pattern_br_b:new e.aO(t,r.u_pattern_br_b),u_texsize:new e.aO(t,r.u_texsize),u_mix:new e.aI(t,r.u_mix),u_pattern_size_a:new e.aO(t,r.u_pattern_size_a),u_pattern_size_b:new e.aO(t,r.u_pattern_size_b),u_scale_a:new e.aI(t,r.u_scale_a),u_scale_b:new e.aI(t,r.u_scale_b),u_pixel_coord_upper:new e.aO(t,r.u_pixel_coord_upper),u_pixel_coord_lower:new e.aO(t,r.u_pixel_coord_lower),u_tile_units_to_pixels:new e.aI(t,r.u_tile_units_to_pixels)}),terrain:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_texture:new e.aH(t,r.u_texture),u_ele_delta:new e.aI(t,r.u_ele_delta),u_fog_matrix:new e.aJ(t,r.u_fog_matrix),u_fog_color:new e.aL(t,r.u_fog_color),u_fog_ground_blend:new e.aI(t,r.u_fog_ground_blend),u_fog_ground_blend_opacity:new e.aI(t,r.u_fog_ground_blend_opacity),u_horizon_color:new e.aL(t,r.u_horizon_color),u_horizon_fog_blend:new e.aI(t,r.u_horizon_fog_blend)}),terrainDepth:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_ele_delta:new e.aI(t,r.u_ele_delta)}),terrainCoords:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_texture:new e.aH(t,r.u_texture),u_terrain_coords_id:new e.aI(t,r.u_terrain_coords_id),u_ele_delta:new e.aI(t,r.u_ele_delta)}),sky:(t,r)=>({u_sky_color:new e.aL(t,r.u_sky_color),u_horizon_color:new e.aL(t,r.u_horizon_color),u_horizon:new e.aI(t,r.u_horizon),u_sky_horizon_blend:new e.aI(t,r.u_sky_horizon_blend)})};class Xe{constructor(t,e,r){this.context=t;let n=t.gl;this.buffer=n.createBuffer(),this.dynamicDraw=!!r,this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),n.bufferData(n.ELEMENT_ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?n.DYNAMIC_DRAW:n.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(t){let e=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),e.bufferSubData(e.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}let $e={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class Ke{constructor(t,e,r,n){this.length=e.length,this.attributes=r,this.itemSize=e.bytesPerElement,this.dynamicDraw=n,this.context=t;let i=t.gl;this.buffer=i.createBuffer(),t.bindVertexBuffer.set(this.buffer),i.bufferData(i.ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?i.DYNAMIC_DRAW:i.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(t){if(t.length!==this.length)throw new Error(`Length of new data is ${t.length}, which doesn't match current length of ${this.length}`);let e=this.context.gl;this.bind(),e.bufferSubData(e.ARRAY_BUFFER,0,t.arrayBuffer)}enableAttributes(t,e){for(let r=0;r0){let r=e.H();e.aQ(r,m.placementInvProjMatrix,t.transform.glCoordMatrix),e.aQ(r,r,m.placementViewportMatrix),c.push({circleArray:y,circleOffset:h,transform:d.posMatrix,invTransform:r,coord:d}),u+=y.length/4,h=u}g&&l.draw(o,s.LINES,jr.disabled,Vr.disabled,t.colorModeForRenderPass(),qr.disabled,{u_matrix:d.posMatrix,u_pixel_extrude_scale:[1/(p=t.transform).width,1/p.height]},t.style.map.terrain&&t.style.map.terrain.getTerrainData(d),n.id,g.layoutVertexBuffer,g.indexBuffer,g.segments,null,t.transform.zoom,null,null,g.collisionVertexBuffer)}var p;if(!a||!c.length)return;let f=t.useProgram("collisionCircle"),d=new e.aR;d.resize(4*u),d._trim();let m=0;for(let t of c)for(let e=0;e=0&&(v[x.associatedIconIndex]={shiftedAnchor:I,angle:L})}else Dt(x.numGlyphs,g)}if(u){y.clear();let r=t.icon.placedSymbolArray;for(let t=0;tt.style.map.terrain.getElevation(l,e,r):null,r="map"===n.layout.get("text-rotation-alignment");Tt(c,l.posMatrix,t,a,N,V,v,u,r,g,l.toUnwrapped(),m.width,m.height,q,e)}let W,Z=l.posMatrix,Y=a&&k||G,X=x||Y?Gr:N,$=U,K=I&&0!==n.paint.get(a?"text-halo-width":"icon-halo-width").constantOr(1);W=I?c.iconsInText?Ge(L.kind,D,_,v,x,Y,t,Z,X,$,q,p,R,S):He(L.kind,D,_,v,x,Y,t,Z,X,$,q,a,p,!0,S):qe(L.kind,D,_,v,x,Y,t,Z,X,$,q,a,p,S);let J={program:z,buffers:h,uniformValues:W,atlasTexture:f,atlasTextureIcon:F,atlasInterpolation:A,atlasInterpolationIcon:E,isSDF:I,hasHalo:K};if(w&&c.canOverlap){T=!0;let t=h.segments.get();for(let r of t)M.push({segments:new e.a0([r]),sortKey:r.sortKey,state:J,terrainData:O})}else M.push({segments:h.segments,sortKey:0,state:J,terrainData:O})}T&&M.sort(((t,e)=>t.sortKey-e.sortKey));for(let e of M){let r=e.state;if(f.activeTexture.set(d.TEXTURE0),r.atlasTexture.bind(r.atlasInterpolation,d.CLAMP_TO_EDGE),r.atlasTextureIcon&&(f.activeTexture.set(d.TEXTURE1),r.atlasTextureIcon&&r.atlasTextureIcon.bind(r.atlasInterpolationIcon,d.CLAMP_TO_EDGE)),r.isSDF){let i=r.uniformValues;r.hasHalo&&(i.u_is_halo=1,Kr(r.buffers,e.segments,n,t,r.program,A,h,p,i,e.terrainData)),i.u_is_halo=0}Kr(r.buffers,e.segments,n,t,r.program,A,h,p,r.uniformValues,e.terrainData)}}function Kr(t,e,r,n,i,a,o,s,l,c){let u=n.context;i.draw(u,u.gl.TRIANGLES,a,o,s,qr.disabled,l,c,r.id,t.layoutVertexBuffer,t.indexBuffer,e,r.paint,n.transform.zoom,t.programConfigurations.get(r.id),t.dynamicLayoutVertexBuffer,t.opacityVertexBuffer)}function Jr(t,r,n,i){let a=t.context,o=a.gl,s=Vr.disabled,l=new Fr([o.ONE,o.ONE],e.aM.transparent,[!0,!0,!0,!0]),c=r.getBucket(n);if(!c)return;let u=i.key,h=n.heatmapFbos.get(u);h||(h=tn(a,r.tileSize,r.tileSize),n.heatmapFbos.set(u,h)),a.bindFramebuffer.set(h.framebuffer),a.viewport.set([0,0,r.tileSize,r.tileSize]),a.clear({color:e.aM.transparent});let p=c.programConfigurations.get(n.id),f=t.useProgram("heatmap",p),d=t.style.map.terrain.getTerrainData(i);f.draw(a,o.TRIANGLES,jr.disabled,s,l,qr.disabled,Pe(i.posMatrix,r,t.transform.zoom,n.paint.get("heatmap-intensity")),d,n.id,c.layoutVertexBuffer,c.indexBuffer,c.segments,n.paint,t.transform.zoom,p)}function Qr(t,e,r){let n=t.context,i=n.gl;n.setColorMode(t.colorModeForRenderPass());let a=en(n,e),o=r.key,s=e.heatmapFbos.get(o);s&&(n.activeTexture.set(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,s.colorAttachment.get()),n.activeTexture.set(i.TEXTURE1),a.bind(i.LINEAR,i.CLAMP_TO_EDGE),t.useProgram("heatmapTexture").draw(n,i.TRIANGLES,jr.disabled,Vr.disabled,t.colorModeForRenderPass(),qr.disabled,ze(t,e,0,1),null,e.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments,e.paint,t.transform.zoom),s.destroy(),e.heatmapFbos.delete(o))}function tn(t,e,r){var n,i;let a=t.gl,o=a.createTexture();a.bindTexture(a.TEXTURE_2D,o),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,a.CLAMP_TO_EDGE),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,a.CLAMP_TO_EDGE),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.LINEAR),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,a.LINEAR);let s=null!==(n=t.HALF_FLOAT)&&void 0!==n?n:a.UNSIGNED_BYTE,l=null!==(i=t.RGBA16F)&&void 0!==i?i:a.RGBA;a.texImage2D(a.TEXTURE_2D,0,l,e,r,0,a.RGBA,s,null);let c=t.createFramebuffer(e,r,!1,!1);return c.colorAttachment.set(o),c}function en(t,e){return e.colorRampTexture||(e.colorRampTexture=new w(t,e.colorRamp,t.gl.RGBA)),e.colorRampTexture}function rn(t,e,r,n,i){if(!r||!n||!n.imageAtlas)return;let a=n.imageAtlas.patternPositions,o=a[r.to.toString()],s=a[r.from.toString()];if(!o&&s&&(o=s),!s&&o&&(s=o),!o||!s){let t=i.getPaintProperty(e);o=a[t],s=a[t]}o&&s&&t.setConstantPatternPositions(o,s)}function nn(t,e,r,n,i,a,o){let s,l,c,u,h,p=t.context.gl,f="fill-pattern",d=r.paint.get(f),m=d&&d.constantOr(1),g=r.getCrossfadeParameters();o?(l=m&&!r.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",s=p.LINES):(l=m?"fillPattern":"fill",s=p.TRIANGLES);let y=d.constantOr(null);for(let d of n){let n=e.getTile(d);if(m&&!n.patternsLoaded())continue;let v=n.getBucket(r);if(!v)continue;let x=v.programConfigurations.get(r.id),_=t.useProgram(l,x),b=t.style.map.terrain&&t.style.map.terrain.getTerrainData(d);m&&(t.context.activeTexture.set(p.TEXTURE0),n.imageAtlasTexture.bind(p.LINEAR,p.CLAMP_TO_EDGE),x.updatePaintBuffers(g)),rn(x,f,y,n,r);let w=b?d:null,T=t.translatePosMatrix(w?w.posMatrix:d.posMatrix,n,r.paint.get("fill-translate"),r.paint.get("fill-translate-anchor"));if(o){u=v.indexBuffer2,h=v.segments2;let e=[p.drawingBufferWidth,p.drawingBufferHeight];c="fillOutlinePattern"===l&&m?Se(T,t,g,n,e):Me(T,e)}else u=v.indexBuffer,h=v.segments,c=m?ke(T,t,g,n):Ae(T);_.draw(t.context,s,i,t.stencilModeForClipping(d),a,qr.disabled,c,b,r.id,v.layoutVertexBuffer,u,h,r.paint,t.transform.zoom,x)}}function an(t,e,r,n,i,a,o){let s=t.context,l=s.gl,c="fill-extrusion-pattern",u=r.paint.get(c),h=u.constantOr(1),p=r.getCrossfadeParameters(),f=r.paint.get("fill-extrusion-opacity"),d=u.constantOr(null);for(let u of n){let n=e.getTile(u),m=n.getBucket(r);if(!m)continue;let g=t.style.map.terrain&&t.style.map.terrain.getTerrainData(u),y=m.programConfigurations.get(r.id),v=t.useProgram(h?"fillExtrusionPattern":"fillExtrusion",y);h&&(t.context.activeTexture.set(l.TEXTURE0),n.imageAtlasTexture.bind(l.LINEAR,l.CLAMP_TO_EDGE),y.updatePaintBuffers(p)),rn(y,c,d,n,r);let x=t.translatePosMatrix(u.posMatrix,n,r.paint.get("fill-extrusion-translate"),r.paint.get("fill-extrusion-translate-anchor")),_=r.paint.get("fill-extrusion-vertical-gradient"),b=h?Te(x,t,_,f,u,p,n):we(x,t,_,f);v.draw(s,s.gl.TRIANGLES,i,a,o,qr.backCCW,b,g,r.id,m.layoutVertexBuffer,m.indexBuffer,m.segments,r.paint,t.transform.zoom,y,t.style.map.terrain&&m.centroidVertexBuffer)}}function on(t,e,r,n,i,a,o){let s=t.context,l=s.gl,c=r.fbo;if(!c)return;let u=t.useProgram("hillshade"),h=t.style.map.terrain&&t.style.map.terrain.getTerrainData(e);s.activeTexture.set(l.TEXTURE0),l.bindTexture(l.TEXTURE_2D,c.colorAttachment.get()),u.draw(s,l.TRIANGLES,i,a,o,qr.disabled,((t,e,r,n)=>{let i=r.paint.get("hillshade-shadow-color"),a=r.paint.get("hillshade-highlight-color"),o=r.paint.get("hillshade-accent-color"),s=r.paint.get("hillshade-illumination-direction")*(Math.PI/180);"viewport"===r.paint.get("hillshade-illumination-anchor")&&(s-=t.transform.angle);let l=!t.options.moving;return{u_matrix:n?n.posMatrix:t.transform.calculatePosMatrix(e.tileID.toUnwrapped(),l),u_image:0,u_latrange:De(0,e.tileID),u_light:[r.paint.get("hillshade-exaggeration"),s],u_shadow:i,u_highlight:a,u_accent:o}})(t,r,n,h?e:null),h,n.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments)}function sn(t,r,n,i,a,o){let s=t.context,l=s.gl,c=r.dem;if(c&&c.data){let u=c.dim,h=c.stride,p=c.getPixels();if(s.activeTexture.set(l.TEXTURE1),s.pixelStoreUnpackPremultiplyAlpha.set(!1),r.demTexture=r.demTexture||t.getTileTexture(h),r.demTexture){let t=r.demTexture;t.update(p,{premultiply:!1}),t.bind(l.NEAREST,l.CLAMP_TO_EDGE)}else r.demTexture=new w(s,p,l.RGBA,{premultiply:!1}),r.demTexture.bind(l.NEAREST,l.CLAMP_TO_EDGE);s.activeTexture.set(l.TEXTURE0);let f=r.fbo;if(!f){let t=new w(s,{width:u,height:u,data:null},l.RGBA);t.bind(l.LINEAR,l.CLAMP_TO_EDGE),f=r.fbo=s.createFramebuffer(u,u,!0,!1),f.colorAttachment.set(t.texture)}s.bindFramebuffer.set(f.framebuffer),s.viewport.set([0,0,u,u]),t.useProgram("hillshadePrepare").draw(s,l.TRIANGLES,i,a,o,qr.disabled,((t,r)=>{let n=r.stride,i=e.H();return e.aP(i,0,e.X,-e.X,0,0,1),e.J(i,i,[0,-e.X,0]),{u_matrix:i,u_image:1,u_dimension:[n,n],u_zoom:t.overscaledZ,u_unpack:r.getUnpackVector()}})(r.tileID,c),null,n.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments),r.needsHillshadePrepare=!1}}function ln(t,r,n,i,o,s){let l=i.paint.get("raster-fade-duration");if(!s&&l>0){let i=a.now(),s=(i-t.timeAdded)/l,c=r?(i-r.timeAdded)/l:-1,u=n.getSource(),h=o.coveringZoomLevel({tileSize:u.tileSize,roundZoom:u.roundZoom}),p=!r||Math.abs(r.tileID.overscaledZ-h)>Math.abs(t.tileID.overscaledZ-h),f=p&&t.refreshedUponExpiration?1:e.ac(p?s:1-c,0,1);return t.refreshedUponExpiration&&s>=1&&(t.refreshedUponExpiration=!1),r?{opacity:1,mix:1-f}:{opacity:f,mix:0}}return{opacity:1,mix:0}}let cn=new e.aM(1,0,0,1),un=new e.aM(0,1,0,1),hn=new e.aM(0,0,1,1),pn=new e.aM(1,0,1,1),fn=new e.aM(0,1,1,1);function dn(t,e,r,n){gn(t,0,e+r/2,t.transform.width,r,n)}function mn(t,e,r,n){gn(t,e-r/2,0,r,t.transform.height,n)}function gn(t,e,r,n,i,a){let o=t.context,s=o.gl;s.enable(s.SCISSOR_TEST),s.scissor(e*t.pixelRatio,r*t.pixelRatio,n*t.pixelRatio,i*t.pixelRatio),o.clear({color:a}),s.disable(s.SCISSOR_TEST)}function yn(t,r,n){let i=t.context,a=i.gl,o=n.posMatrix,s=t.useProgram("debug"),l=jr.disabled,c=Vr.disabled,u=t.colorModeForRenderPass(),h="$debug",p=t.style.map.terrain&&t.style.map.terrain.getTerrainData(n);i.activeTexture.set(a.TEXTURE0);let f=r.getTileByID(n.key).latestRawTileData,d=Math.floor((f&&f.byteLength||0)/1024),m=r.getTile(n).tileSize,g=512/Math.min(m,512)*(n.overscaledZ/t.transform.zoom)*.5,y=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(y+=` => ${n.overscaledZ}`),function(t,e){t.initDebugOverlayCanvas();let r=t.debugOverlayCanvas,n=t.context.gl,i=t.debugOverlayCanvas.getContext("2d");i.clearRect(0,0,r.width,r.height),i.shadowColor="white",i.shadowBlur=2,i.lineWidth=1.5,i.strokeStyle="white",i.textBaseline="top",i.font="bold 36px Open Sans, sans-serif",i.fillText(e,5,5),i.strokeText(e,5,5),t.debugOverlayTexture.update(r),t.debugOverlayTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)}(t,`${y} ${d}kB`),s.draw(i,a.TRIANGLES,l,c,Fr.alphaBlended,qr.disabled,Ie(o,e.aM.transparent,g),null,h,t.debugBuffer,t.quadTriangleIndexBuffer,t.debugSegments),s.draw(i,a.LINE_STRIP,l,c,u,qr.disabled,Ie(o,e.aM.red),p,h,t.debugBuffer,t.tileBorderIndexBuffer,t.debugSegments)}function vn(t,e,r){let n=t.context,i=n.gl,a=t.colorModeForRenderPass(),o=new jr(i.LEQUAL,jr.ReadWrite,t.depthRangeFor3D),s=t.useProgram("terrain"),l=e.getTerrainMesh();n.bindFramebuffer.set(null),n.viewport.set([0,0,t.width,t.height]);for(let c of r){let r=t.renderToTexture.getTexture(c),u=e.getTerrainData(c.tileID);n.activeTexture.set(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,r.texture);let h=t.transform.calculatePosMatrix(c.tileID.toUnwrapped()),p=e.getMeshFrameDelta(t.transform.zoom),f=t.transform.calculateFogMatrix(c.tileID.toUnwrapped()),d=ve(h,p,f,t.style.sky,t.transform.pitch);s.draw(n,i.TRIANGLES,o,Vr.disabled,a,qr.backCCW,d,u,"terrain",l.vertexBuffer,l.indexBuffer,l.segments)}}class xn{constructor(t,e,r){this.vertexBuffer=t,this.indexBuffer=e,this.segments=r}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}}class _n{constructor(t,r){this.context=new Br(t),this.transform=r,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:e.an(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=pt.maxUnderzooming+pt.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new ue}resize(t,e,r){if(this.width=Math.floor(t*r),this.height=Math.floor(e*r),this.pixelRatio=r,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(let t of this.style._order)this.style._layers[t].resize()}setup(){let t=this.context,r=new e.aX;r.emplaceBack(0,0),r.emplaceBack(e.X,0),r.emplaceBack(0,e.X),r.emplaceBack(e.X,e.X),this.tileExtentBuffer=t.createVertexBuffer(r,de.members),this.tileExtentSegments=e.a0.simpleSegment(0,0,4,2);let n=new e.aX;n.emplaceBack(0,0),n.emplaceBack(e.X,0),n.emplaceBack(0,e.X),n.emplaceBack(e.X,e.X),this.debugBuffer=t.createVertexBuffer(n,de.members),this.debugSegments=e.a0.simpleSegment(0,0,4,5);let i=new e.$;i.emplaceBack(0,0,0,0),i.emplaceBack(e.X,0,e.X,0),i.emplaceBack(0,e.X,0,e.X),i.emplaceBack(e.X,e.X,e.X,e.X),this.rasterBoundsBuffer=t.createVertexBuffer(i,Q.members),this.rasterBoundsSegments=e.a0.simpleSegment(0,0,4,2);let a=new e.aX;a.emplaceBack(0,0),a.emplaceBack(1,0),a.emplaceBack(0,1),a.emplaceBack(1,1),this.viewportBuffer=t.createVertexBuffer(a,de.members),this.viewportSegments=e.a0.simpleSegment(0,0,4,2);let o=new e.aZ;o.emplaceBack(0),o.emplaceBack(1),o.emplaceBack(3),o.emplaceBack(2),o.emplaceBack(0),this.tileBorderIndexBuffer=t.createIndexBuffer(o);let s=new e.aY;s.emplaceBack(0,1,2),s.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=t.createIndexBuffer(s);let l=this.context.gl;this.stencilClearMode=new Vr({func:l.ALWAYS,mask:0},0,255,l.ZERO,l.ZERO,l.ZERO)}clearStencil(){let t=this.context,r=t.gl;this.nextStencilID=1,this.currentStencilSource=void 0;let n=e.H();e.aP(n,0,this.width,this.height,0,0,1),e.K(n,n,[r.drawingBufferWidth,r.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(t,r.TRIANGLES,jr.disabled,this.stencilClearMode,Fr.disabled,qr.disabled,Le(n),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(t,e){if(this.currentStencilSource===t.source||!t.isTileClipped()||!e||!e.length)return;this.currentStencilSource=t.source;let r=this.context,n=r.gl;this.nextStencilID+e.length>256&&this.clearStencil(),r.setColorMode(Fr.disabled),r.setDepthMode(jr.disabled);let i=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(let t of e){let e=this._tileClippingMaskIDs[t.key]=this.nextStencilID++,a=this.style.map.terrain&&this.style.map.terrain.getTerrainData(t);i.draw(r,n.TRIANGLES,jr.disabled,new Vr({func:n.ALWAYS,mask:0},e,255,n.KEEP,n.KEEP,n.REPLACE),Fr.disabled,qr.disabled,Le(t.posMatrix),a,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();let t=this.nextStencilID++,e=this.context.gl;return new Vr({func:e.NOTEQUAL,mask:255},t,255,e.KEEP,e.KEEP,e.REPLACE)}stencilModeForClipping(t){let e=this.context.gl;return new Vr({func:e.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,e.KEEP,e.KEEP,e.REPLACE)}stencilConfigForOverlap(t){let e=this.context.gl,r=t.sort(((t,e)=>e.overscaledZ-t.overscaledZ)),n=r[r.length-1].overscaledZ,i=r[0].overscaledZ-n+1;if(i>1){this.currentStencilSource=void 0,this.nextStencilID+i>256&&this.clearStencil();let t={};for(let r=0;r=0;this.currentLayer--){let t=this.style._layers[n[this.currentLayer]],e=i[t.source],r=o[t.source];this._renderTileClippingMasks(t,r),this.renderLayer(this,e,t,r)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayerr.source&&!r.isHidden(e)?[t.sourceCaches[r.source]]:[])),i=n.filter((t=>"vector"===t.getSource().type)),a=n.filter((t=>"vector"!==t.getSource().type)),o=t=>{(!r||r.getSource().maxzoomo(t))),r||a.forEach((t=>o(t))),r}(this.style,this.transform.zoom);t&&function(t,e,r){for(let n=0;n0),i&&(e.b0(r,n),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,function(t,r){let n=t.context,i=n.gl,a=Fr.unblended,o=new jr(i.LEQUAL,jr.ReadWrite,[0,1]),s=r.getTerrainMesh(),l=r.sourceCache.getRenderableTiles(),c=t.useProgram("terrainDepth");n.bindFramebuffer.set(r.getFramebuffer("depth").framebuffer),n.viewport.set([0,0,t.width/devicePixelRatio,t.height/devicePixelRatio]),n.clear({color:e.aM.transparent,depth:1});for(let e of l){let l=r.getTerrainData(e.tileID),u={u_matrix:t.transform.calculatePosMatrix(e.tileID.toUnwrapped()),u_ele_delta:r.getMeshFrameDelta(t.transform.zoom)};c.draw(n,i.TRIANGLES,o,Vr.disabled,a,qr.backCCW,u,l,"terrain",s.vertexBuffer,s.indexBuffer,s.segments)}n.bindFramebuffer.set(null),n.viewport.set([0,0,t.width,t.height])}(this,this.style.map.terrain),function(t,r){let n=t.context,i=n.gl,a=Fr.unblended,o=new jr(i.LEQUAL,jr.ReadWrite,[0,1]),s=r.getTerrainMesh(),l=r.getCoordsTexture(),c=r.sourceCache.getRenderableTiles(),u=t.useProgram("terrainCoords");n.bindFramebuffer.set(r.getFramebuffer("coords").framebuffer),n.viewport.set([0,0,t.width/devicePixelRatio,t.height/devicePixelRatio]),n.clear({color:e.aM.transparent,depth:1}),r.coordsIndex=[];for(let e of c){let c=r.getTerrainData(e.tileID);n.activeTexture.set(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,l.texture);let h={u_matrix:t.transform.calculatePosMatrix(e.tileID.toUnwrapped()),u_terrain_coords_id:(255-r.coordsIndex.length)/255,u_texture:0,u_ele_delta:r.getMeshFrameDelta(t.transform.zoom)};u.draw(n,i.TRIANGLES,o,Vr.disabled,a,qr.backCCW,h,c,"terrain",s.vertexBuffer,s.indexBuffer,s.segments),r.coordsIndex.push(e.tileID.key)}n.bindFramebuffer.set(null),n.viewport.set([0,0,t.width,t.height])}(this,this.style.map.terrain))}renderLayer(t,r,n,i){if(!n.isHidden(this.transform.zoom)&&("background"===n.type||"custom"===n.type||(i||[]).length))switch(this.id=n.id,n.type){case"symbol":!function(t,r,n,i,a){if("translucent"!==t.renderPass)return;let o=Vr.disabled,s=t.colorModeForRenderPass();(n._unevaluatedLayout.hasValue("text-variable-anchor")||n._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&function(t,r,n,i,a,o,s,l,c){let u=r.transform,h=ne(),p="map"===a,f="map"===o;for(let a of t){let t=i.getTile(a),o=t.getBucket(n);if(!o||!o.text||!o.text.segments.get().length)continue;let d=e.ag(o.textSizeData,u.zoom),m=Bt(t,1,r.transform.zoom),g=vt(a.posMatrix,f,p,r.transform,m),y="none"!==n.layout.get("icon-text-fit")&&o.hasIconData();if(d){let e=Math.pow(2,u.zoom-t.tileID.overscaledZ),n=r.style.map.terrain?(t,e)=>r.style.map.terrain.getElevation(a,t,e):null,i=h.translatePosition(u,t,s,l);Yr(o,p,f,c,u,g,a.posMatrix,e,d,y,h,i,a.toUnwrapped(),n)}}}(i,t,n,r,n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),a),0!==n.paint.get("icon-opacity").constantOr(1)&&$r(t,r,n,i,!1,n.paint.get("icon-translate"),n.paint.get("icon-translate-anchor"),n.layout.get("icon-rotation-alignment"),n.layout.get("icon-pitch-alignment"),n.layout.get("icon-keep-upright"),o,s),0!==n.paint.get("text-opacity").constantOr(1)&&$r(t,r,n,i,!0,n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),n.layout.get("text-keep-upright"),o,s),r.map.showCollisionBoxes&&(Hr(t,r,n,i,!0),Hr(t,r,n,i,!1))}(t,r,n,i,this.style.placement.variableOffsets);break;case"circle":!function(t,r,n,i){if("translucent"!==t.renderPass)return;let a=n.paint.get("circle-opacity"),o=n.paint.get("circle-stroke-width"),s=n.paint.get("circle-stroke-opacity"),l=!n.layout.get("circle-sort-key").isConstant();if(0===a.constantOr(1)&&(0===o.constantOr(1)||0===s.constantOr(1)))return;let c=t.context,u=c.gl,h=t.depthModeForSublayer(0,jr.ReadOnly),p=Vr.disabled,f=t.colorModeForRenderPass(),d=[];for(let a=0;at.sortKey-e.sortKey));for(let e of d){let{programConfiguration:r,program:i,layoutVertexBuffer:a,indexBuffer:o,uniformValues:s,terrainData:l}=e.state;i.draw(c,u.TRIANGLES,h,p,f,qr.disabled,s,l,n.id,a,o,e.segments,n.paint,t.transform.zoom,r)}}(t,r,n,i);break;case"heatmap":!function(t,r,n,i){if(0===n.paint.get("heatmap-opacity"))return;let a=t.context;if(t.style.map.terrain){for(let e of i){let i=r.getTile(e);r.hasRenderableParent(e)||("offscreen"===t.renderPass?Jr(t,i,n,e):"translucent"===t.renderPass&&Qr(t,n,e))}a.viewport.set([0,0,t.width,t.height])}else"offscreen"===t.renderPass?function(t,r,n,i){let a=t.context,o=a.gl,s=Vr.disabled,l=new Fr([o.ONE,o.ONE],e.aM.transparent,[!0,!0,!0,!0]);(function(t,r,n){let i=t.gl;t.activeTexture.set(i.TEXTURE1),t.viewport.set([0,0,r.width/4,r.height/4]);let a=n.heatmapFbos.get(e.aU);a?(i.bindTexture(i.TEXTURE_2D,a.colorAttachment.get()),t.bindFramebuffer.set(a.framebuffer)):(a=tn(t,r.width/4,r.height/4),n.heatmapFbos.set(e.aU,a))})(a,t,n),a.clear({color:e.aM.transparent});for(let e=0;e20&&a.texParameterf(a.TEXTURE_2D,i.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,i.extTextureFilterAnisotropicMax);let _=t.style.map.terrain&&t.style.map.terrain.getTerrainData(n),b=_?n:null,w=b?b.posMatrix:t.transform.calculatePosMatrix(n.toUnwrapped(),p),T=Ue(w,m||[0,0],d||1,v,r);o instanceof tt?s.draw(i,a.TRIANGLES,u,Vr.disabled,l,qr.disabled,T,_,r.id,o.boundsBuffer,t.quadTriangleIndexBuffer,o.boundsSegments):s.draw(i,a.TRIANGLES,u,c[n.overscaledZ],l,qr.disabled,T,_,r.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments)}}(t,r,n,i);break;case"background":!function(t,e,r,n){let i=r.paint.get("background-color"),a=r.paint.get("background-opacity");if(0===a)return;let o=t.context,s=o.gl,l=t.transform,c=l.tileSize,u=r.paint.get("background-pattern");if(t.isPatternMissing(u))return;let h=!u&&1===i.a&&1===a&&t.opaquePassEnabledForLayer()?"opaque":"translucent";if(t.renderPass!==h)return;let p=Vr.disabled,f=t.depthModeForSublayer(0,"opaque"===h?jr.ReadWrite:jr.ReadOnly),d=t.colorModeForRenderPass(),m=t.useProgram(u?"backgroundPattern":"background"),g=n||l.coveringTiles({tileSize:c,terrain:t.style.map.terrain});u&&(o.activeTexture.set(s.TEXTURE0),t.imageManager.bind(t.context));let y=r.getCrossfadeParameters();for(let e of g){let l=n?e.posMatrix:t.transform.calculatePosMatrix(e.toUnwrapped()),h=u?Ze(l,a,t,u,{tileID:e,tileSize:c},y):We(l,a,i),g=t.style.map.terrain&&t.style.map.terrain.getTerrainData(e);m.draw(o,s.TRIANGLES,f,p,d,qr.disabled,h,g,r.id,t.tileExtentBuffer,t.quadTriangleIndexBuffer,t.tileExtentSegments)}}(t,0,n,i);break;case"custom":!function(t,e,r){let n=t.context,i=r.implementation;if("offscreen"===t.renderPass){let e=i.prerender;e&&(t.setCustomLayerDefaults(),n.setColorMode(t.colorModeForRenderPass()),e.call(i,n.gl,t.transform.customLayerMatrix()),n.setDirty(),t.setBaseState())}else if("translucent"===t.renderPass){t.setCustomLayerDefaults(),n.setColorMode(t.colorModeForRenderPass()),n.setStencilMode(Vr.disabled);let e="3d"===i.renderingMode?new jr(t.context.gl.LEQUAL,jr.ReadWrite,t.depthRangeFor3D):t.depthModeForSublayer(0,jr.ReadOnly);n.setDepthMode(e),i.render(n.gl,t.transform.customLayerMatrix(),{farZ:t.transform.farZ,nearZ:t.transform.nearZ,fov:t.transform._fov,modelViewProjectionMatrix:t.transform.modelViewProjectionMatrix,projectionMatrix:t.transform.projectionMatrix}),n.setDirty(),t.setBaseState(),n.bindFramebuffer.set(null)}}(t,0,n)}}translatePosMatrix(t,r,n,i,a){if(!n[0]&&!n[1])return t;let o=a?"map"===i?this.transform.angle:0:"viewport"===i?-this.transform.angle:0;if(o){let t=Math.sin(o),e=Math.cos(o);n=[n[0]*e-n[1]*t,n[0]*t+n[1]*e]}let s=[a?n[0]:Bt(r,n[0],this.transform.zoom),a?n[1]:Bt(r,n[1],this.transform.zoom),0],l=new Float32Array(16);return e.J(l,t,s),l}saveTileTexture(t){let e=this._tileTextures[t.size[0]];e?e.push(t):this._tileTextures[t.size[0]]=[t]}getTileTexture(t){let e=this._tileTextures[t];return e&&e.length>0?e.pop():null}isPatternMissing(t){if(!t)return!1;if(!t.from||!t.to)return!0;let e=this.imageManager.getPattern(t.from.toString()),r=this.imageManager.getPattern(t.to.toString());return!e||!r}useProgram(t,e){this.cache=this.cache||{};let r=t+(e?e.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[r]||(this.cache[r]=new _e(this.context,me[t],e,Ye[t],this._showOverdrawInspector,this.style.map.terrain)),this.cache[r]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){let t=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(t.FUNC_ADD)}initDebugOverlayCanvas(){null==this.debugOverlayCanvas&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new w(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){let{drawingBufferWidth:t,drawingBufferHeight:e}=this.context.gl;return this.width!==t||this.height!==e}}class bn{constructor(t,e){this.points=t,this.planes=e}static fromInvProjectionMatrix(t,r,n){let i=Math.pow(2,n),a=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map((n=>{let a=1/(n=e.af([],n,t))[3]/r*i;return e.b1(n,n,[a,a,1/n[3],a])})),o=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((t=>{let e=function(t,e){var r=e[0],n=e[1],i=e[2],a=r*r+n*n+i*i;return a>0&&(a=1/Math.sqrt(a)),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a,t}([],(n=[],i=y([],a[t[0]],a[t[1]]),o=y([],a[t[2]],a[t[1]]),s=i[0],l=i[1],c=i[2],u=o[0],h=o[1],p=o[2],n[0]=l*p-c*h,n[1]=c*u-s*p,n[2]=s*h-l*u,n)),r=-((f=e)[0]*(d=a[t[1]])[0]+f[1]*d[1]+f[2]*d[2]);var n,i,o,s,l,c,u,h,p,f,d;return e.concat(r)}));return new bn(a,o)}}class wn{constructor(t,e){var r,n,i;this.min=t,this.max=e,this.center=function(t,e){return t[0]=.5*e[0],t[1]=.5*e[1],t[2]=.5*e[2],t}([],(r=[],n=this.min,i=this.max,r[0]=n[0]+i[0],r[1]=n[1]+i[1],r[2]=n[2]+i[2],r))}quadrant(t){let e=[t%2==0,t<2],r=m(this.min),n=m(this.max);for(let t=0;t=0&&o++;if(0===o)return 0;o!==r.length&&(n=!1)}if(n)return 2;for(let e=0;e<3;e++){let r=Number.MAX_VALUE,n=-Number.MAX_VALUE;for(let i=0;ithis.max[e]-this.min[e])return 0}return 1}}class Tn{constructor(t=0,e=0,r=0,n=0){if(isNaN(t)||t<0||isNaN(e)||e<0||isNaN(r)||r<0||isNaN(n)||n<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=e,this.left=r,this.right=n}interpolate(t,r,n){return null!=r.top&&null!=t.top&&(this.top=e.y.number(t.top,r.top,n)),null!=r.bottom&&null!=t.bottom&&(this.bottom=e.y.number(t.bottom,r.bottom,n)),null!=r.left&&null!=t.left&&(this.left=e.y.number(t.left,r.left,n)),null!=r.right&&null!=t.right&&(this.right=e.y.number(t.right,r.right,n)),this}getCenter(t,r){let n=e.ac((this.left+t-this.right)/2,0,t),i=e.ac((this.top+r-this.bottom)/2,0,r);return new e.P(n,i)}equals(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right}clone(){return new Tn(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}let An=85.051129;class kn{constructor(t,r,n,i,a){this.tileSize=512,this._renderWorldCopies=void 0===a||!!a,this._minZoom=t||0,this._maxZoom=r||22,this._minPitch=n??0,this._maxPitch=i??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new e.N(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new Tn,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={},this.minElevationForCurrentTile=0}clone(){let t=new kn(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return t.apply(this),t}apply(t){this.tileSize=t.tileSize,this.latRange=t.latRange,this.lngRange=t.lngRange,this.width=t.width,this.height=t.height,this._center=t._center,this._elevation=t._elevation,this.minElevationForCurrentTile=t.minElevationForCurrentTile,this.zoom=t.zoom,this.angle=t.angle,this._fov=t._fov,this._pitch=t._pitch,this._unmodified=t._unmodified,this._edgeInsets=t._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))}get maxZoom(){return this._maxZoom}set maxZoom(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))}get minPitch(){return this._minPitch}set minPitch(t){this._minPitch!==t&&(this._minPitch=t,this.pitch=Math.max(this.pitch,t))}get maxPitch(){return this._maxPitch}set maxPitch(t){this._maxPitch!==t&&(this._maxPitch=t,this.pitch=Math.min(this.pitch,t))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new e.P(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(t){let r=-e.b3(t,-180,180)*Math.PI/180;var n;this.angle!==r&&(this._unmodified=!1,this.angle=r,this._calcMatrices(),this.rotationMatrix=(n=new e.A(4),e.A!=Float32Array&&(n[1]=0,n[2]=0),n[0]=1,n[3]=1,n),function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),l=Math.cos(r);t[0]=n*l+a*s,t[1]=i*l+o*s,t[2]=n*-s+a*l,t[3]=i*-s+o*l}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(t){let r=e.ac(t,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==r&&(this._unmodified=!1,this._pitch=r,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=t/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(t){let e=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==e&&(this._unmodified=!1,this._zoom=e,this.tileZoom=Math.max(0,Math.floor(e)),this.scale=this.zoomScale(e),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(t){t!==this._elevation&&(this._elevation=t,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(t){return this._edgeInsets.equals(t)}interpolatePadding(t,e,r){this._unmodified=!1,this._edgeInsets.interpolate(t,e,r),this._constrain(),this._calcMatrices()}coveringZoomLevel(t){let e=(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize));return Math.max(0,e)}getVisibleUnwrappedCoordinates(t){let r=[new e.b4(0,t)];if(this._renderWorldCopies){let n=this.pointCoordinate(new e.P(0,0)),i=this.pointCoordinate(new e.P(this.width,0)),a=this.pointCoordinate(new e.P(this.width,this.height)),o=this.pointCoordinate(new e.P(0,this.height)),s=Math.floor(Math.min(n.x,i.x,a.x,o.x)),l=Math.floor(Math.max(n.x,i.x,a.x,o.x)),c=1;for(let n=s-c;n<=l+c;n++)0!==n&&r.push(new e.b4(n,t))}return r}coveringTiles(t){var r,n;let i=this.coveringZoomLevel(t),a=i;if(void 0!==t.minzoom&&it.maxzoom&&(i=t.maxzoom);let o=this.pointCoordinate(this.getCameraPoint()),s=e.Z.fromLngLat(this.center),l=Math.pow(2,i),c=[l*o.x,l*o.y,0],u=[l*s.x,l*s.y,0],h=bn.fromInvProjectionMatrix(this.invModelViewProjectionMatrix,this.worldSize,i),p=t.minzoom||0;!t.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(p=i);let f=t.terrain?2/Math.min(this.tileSize,t.tileSize)*this.tileSize:3,d=t=>({aabb:new wn([t*l,0,0],[(t+1)*l,l,0]),zoom:0,x:0,y:0,wrap:t,fullyVisible:!1}),m=[],g=[],y=i,v=t.reparseOverscaled?a:i;if(this._renderWorldCopies)for(let t=1;t<=3;t++)m.push(d(-t)),m.push(d(t));for(m.push(d(0));m.length>0;){let i=m.pop(),a=i.x,o=i.y,s=i.fullyVisible;if(!s){let t=i.aabb.intersects(h);if(0===t)continue;s=2===t}let l=t.terrain?c:u,d=i.aabb.distanceX(l),_=i.aabb.distanceY(l),b=Math.max(Math.abs(d),Math.abs(_));if(i.zoom===y||b>f+(1<=p){let t=y-i.zoom,r=c[0]-.5-(a<>1),h=i.zoom+1,p=i.aabb.quadrant(l);if(t.terrain){let a=new e.S(h,i.wrap,h,c,u),o=t.terrain.getMinMaxElevation(a),s=null!==(r=o.minElevation)&&void 0!==r?r:this.elevation,l=null!==(n=o.maxElevation)&&void 0!==n?n:this.elevation;p=new wn([p.min[0],p.min[1],s],[p.max[0],p.max[1],l])}m.push({aabb:p,zoom:h,x:c,y:u,wrap:i.wrap,fullyVisible:s})}}return g.sort(((t,e)=>t.distanceSq-e.distanceSq)).map((t=>t.tileID))}resize(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(t){return Math.pow(2,t)}scaleZoom(t){return Math.log(t)/Math.LN2}project(t){let r=e.ac(t.lat,-85.051129,An);return new e.P(e.O(t.lng)*this.worldSize,e.Q(r)*this.worldSize)}unproject(t){return new e.Z(t.x/this.worldSize,t.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}getCameraPosition(){return{lngLat:this.pointLocation(this.getCameraPoint()),altitude:Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter+this.elevation}}recalculateZoom(t){let r=this.elevation,n=Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter,i=this.pointLocation(this.centerPoint,t),a=t.getElevationForLngLatZoom(i,this.tileZoom);if(!(this.elevation-a))return;let o=n+r-a,s=Math.cos(this._pitch)*this.cameraToCenterDistance/o/e.b5(1,i.lat),l=this.scaleZoom(s/this.tileSize);this._elevation=a,this._center=i,this.zoom=l}setLocationAtPoint(t,r){let n=this.pointCoordinate(r),i=this.pointCoordinate(this.centerPoint),a=this.locationCoordinate(t),o=new e.Z(a.x-(n.x-i.x),a.y-(n.y-i.y));this.center=this.coordinateLocation(o),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(t,e){return e?this.coordinatePoint(this.locationCoordinate(t),e.getElevationForLngLatZoom(t,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(t))}pointLocation(t,e){return this.coordinateLocation(this.pointCoordinate(t,e))}locationCoordinate(t){return e.Z.fromLngLat(t)}coordinateLocation(t){return t&&t.toLngLat()}pointCoordinate(t,r){if(r){let e=r.pointCoordinate(t);if(null!=e)return e}let n=[t.x,t.y,0,1],i=[t.x,t.y,1,1];e.af(n,n,this.pixelMatrixInverse),e.af(i,i,this.pixelMatrixInverse);let a=n[3],o=i[3],s=n[1]/a,l=i[1]/o,c=n[2]/a,u=i[2]/o,h=c===u?0:(0-c)/(u-c);return new e.Z(e.y.number(n[0]/a,i[0]/o,h)/this.worldSize,e.y.number(s,l,h)/this.worldSize)}coordinatePoint(t,r=0,n=this.pixelMatrix){let i=[t.x*this.worldSize,t.y*this.worldSize,r,1];return e.af(i,i,n),new e.P(i[0]/i[3],i[1]/i[3])}getBounds(){let t=Math.max(0,this.height/2-this.getHorizon());return(new Z).extend(this.pointLocation(new e.P(0,t))).extend(this.pointLocation(new e.P(this.width,t))).extend(this.pointLocation(new e.P(this.width,this.height))).extend(this.pointLocation(new e.P(0,this.height)))}getMaxBounds(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new Z([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null}getHorizon(){return Math.tan(Math.PI/2-this._pitch)*this.cameraToCenterDistance*.85}setMaxBounds(t){t?(this.lngRange=[t.getWest(),t.getEast()],this.latRange=[t.getSouth(),t.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-85.051129,An])}calculateTileMatrix(t){let r=t.canonical,n=this.worldSize/this.zoomScale(r.z),i=r.x+Math.pow(2,r.z)*t.wrap,a=e.an(new Float64Array(16));return e.J(a,a,[i*n,r.y*n,0]),e.K(a,a,[n/e.X,n/e.X,1]),a}calculatePosMatrix(t,r=!1){let n=t.key,i=r?this._alignedPosMatrixCache:this._posMatrixCache;if(i[n])return i[n];let a=this.calculateTileMatrix(t);return e.L(a,r?this.alignedModelViewProjectionMatrix:this.modelViewProjectionMatrix,a),i[n]=new Float32Array(a),i[n]}calculateFogMatrix(t){let r=t.key,n=this._fogMatrixCache;if(n[r])return n[r];let i=this.calculateTileMatrix(t);return e.L(i,this.fogMatrix,i),n[r]=new Float32Array(i),n[r]}customLayerMatrix(){return this.mercatorMatrix.slice()}getConstrained(t,r){r=e.ac(+r,this.minZoom,this.maxZoom);let n={center:new e.N(t.lng,t.lat),zoom:r},i=this.lngRange;if(!this._renderWorldCopies&&null===i){let t=179.9999999999;i=[-t,t]}let a=this.tileSize*this.zoomScale(n.zoom),o=0,s=a,l=0,c=a,u=0,h=0,{x:p,y:f}=this.size;if(this.latRange){let t=this.latRange;o=e.Q(t[1])*a,s=e.Q(t[0])*a,s-os&&(m=s-t)}if(i){let t=(l+c)/2,r=g;this._renderWorldCopies&&(r=e.b3(g,t-a/2,t+a/2));let n=p/2;r-nc&&(d=c-n)}if(void 0!==d||void 0!==m){let t=new e.P(d??g,m??y);n.center=this.unproject.call({worldSize:a},t).wrap()}return n}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;let t=this._unmodified,{center:e,zoom:r}=this.getConstrained(this.center,this.zoom);this.center=e,this.zoom=r,this._unmodified=t,this._constraining=!1}_calcMatrices(){if(!this.height)return;let t=this.centerOffset,r=this.point.x,n=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=e.b5(1,this.center.lat)*this.worldSize;let i=e.an(new Float64Array(16));e.K(i,i,[this.width/2,-this.height/2,1]),e.J(i,i,[1,-1,0]),this.labelPlaneMatrix=i,i=e.an(new Float64Array(16)),e.K(i,i,[1,-1,1]),e.J(i,i,[-1,-1,0]),e.K(i,i,[2/this.width,2/this.height,1]),this.glCoordMatrix=i;let a=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),o=Math.min(this.elevation,this.minElevationForCurrentTile),s=a-o*this._pixelPerMeter/Math.cos(this._pitch),l=o<0?s:a,c=Math.PI/2+this._pitch,u=this._fov*(.5+t.y/this.height),h=Math.sin(u)*l/Math.sin(e.ac(Math.PI-c-u,.01,Math.PI-.01)),p=this.getHorizon(),f=2*Math.atan(p/this.cameraToCenterDistance)*(.5+t.y/(2*p)),d=Math.sin(f)*l/Math.sin(e.ac(Math.PI-c-f,.01,Math.PI-.01)),m=Math.min(h,d);this.farZ=1.01*(Math.cos(Math.PI/2-this._pitch)*m+l),this.nearZ=this.height/50,i=new Float64Array(16),e.b6(i,this._fov,this.width/this.height,this.nearZ,this.farZ),i[8]=2*-t.x/this.width,i[9]=2*t.y/this.height,this.projectionMatrix=e.ae(i),e.K(i,i,[1,-1,1]),e.J(i,i,[0,0,-this.cameraToCenterDistance]),e.b7(i,i,this._pitch),e.ad(i,i,this.angle),e.J(i,i,[-r,-n,0]),this.mercatorMatrix=e.K([],i,[this.worldSize,this.worldSize,this.worldSize]),e.K(i,i,[1,1,this._pixelPerMeter]),this.pixelMatrix=e.L(new Float64Array(16),this.labelPlaneMatrix,i),e.J(i,i,[0,0,-this.elevation]),this.modelViewProjectionMatrix=i,this.invModelViewProjectionMatrix=e.as([],i),this.fogMatrix=new Float64Array(16),e.b6(this.fogMatrix,this._fov,this.width/this.height,a,this.farZ),this.fogMatrix[8]=2*-t.x/this.width,this.fogMatrix[9]=2*t.y/this.height,e.K(this.fogMatrix,this.fogMatrix,[1,-1,1]),e.J(this.fogMatrix,this.fogMatrix,[0,0,-this.cameraToCenterDistance]),e.b7(this.fogMatrix,this.fogMatrix,this._pitch),e.ad(this.fogMatrix,this.fogMatrix,this.angle),e.J(this.fogMatrix,this.fogMatrix,[-r,-n,0]),e.K(this.fogMatrix,this.fogMatrix,[1,1,this._pixelPerMeter]),e.J(this.fogMatrix,this.fogMatrix,[0,0,-this.elevation]),this.pixelMatrix3D=e.L(new Float64Array(16),this.labelPlaneMatrix,i);let g=this.width%2/2,y=this.height%2/2,v=Math.cos(this.angle),x=Math.sin(this.angle),_=r-Math.round(r)+v*g+x*y,b=n-Math.round(n)+v*y+x*g,w=new Float64Array(i);if(e.J(w,w,[_>.5?_-1:_,b>.5?b-1:b,0]),this.alignedModelViewProjectionMatrix=w,i=e.as(new Float64Array(16),this.pixelMatrix),!i)throw new Error("failed to invert matrix");this.pixelMatrixInverse=i,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;let t=this.pointCoordinate(new e.P(0,0)),r=[t.x*this.worldSize,t.y*this.worldSize,0,1];return e.af(r,r,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){let t=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new e.P(0,t))}getCameraQueryGeometry(t){let r=this.getCameraPoint();if(1===t.length)return[t[0],r];{let n=r.x,i=r.y,a=r.x,o=r.y;for(let e of t)n=Math.min(n,e.x),i=Math.min(i,e.y),a=Math.max(a,e.x),o=Math.max(o,e.y);return[new e.P(n,i),new e.P(a,i),new e.P(a,o),new e.P(n,o),new e.P(n,i)]}}lngLatToCameraDepth(t,r){let n=this.locationCoordinate(t),i=[n.x*this.worldSize,n.y*this.worldSize,r,1];return e.af(i,i,this.modelViewProjectionMatrix),i[2]/i[3]}}function Mn(t,e){let r,n=!1,i=null,a=null,o=()=>{i=null,n&&(t.apply(a,r),i=setTimeout(o,e),n=!1)};return(...t)=>(n=!0,a=this,r=t,i||o(),i)}class Sn{constructor(t){this._getCurrentHash=()=>{let t=window.location.hash.replace("#","");if(this._hashName){let e;return t.split("&").map((t=>t.split("="))).forEach((t=>{t[0]===this._hashName&&(e=t)})),(e&&e[1]||"").split("/")}return t.split("/")},this._onHashChange=()=>{let t=this._getCurrentHash();if(t.length>=3&&!t.some((t=>isNaN(t)))){let e=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(t[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:e,pitch:+(t[4]||0)}),!0}return!1},this._updateHashUnthrottled=()=>{let t=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,t)},this._removeHash=()=>{let t=this._getCurrentHash();if(0===t.length)return;let e=t.join("/"),r=e;r.split("&").length>0&&(r=r.split("&")[0]),this._hashName&&(r=`${this._hashName}=${e}`);let n=window.location.hash.replace(r,"");n.startsWith("#&")?n=n.slice(0,1)+n.slice(2):"#"===n&&(n="");let i=window.location.href.replace(/(#.+)?$/,n);i=i.replace("&&","&"),window.history.replaceState(window.history.state,null,i)},this._updateHash=Mn(this._updateHashUnthrottled,300),this._hashName=t&&encodeURIComponent(t)}addTo(t){return this._map=t,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),this._removeHash(),delete this._map,this}getHashString(t){let e=this._map.getCenter(),r=Math.round(100*this._map.getZoom())/100,n=Math.ceil((r*Math.LN2+Math.log(512/360/.5))/Math.LN10),i=Math.pow(10,n),a=Math.round(e.lng*i)/i,o=Math.round(e.lat*i)/i,s=this._map.getBearing(),l=this._map.getPitch(),c="";if(c+=t?`/${a}/${o}/${r}`:`${r}/${o}/${a}`,(s||l)&&(c+="/"+Math.round(10*s)/10),l&&(c+=`/${Math.round(l)}`),this._hashName){let t=this._hashName,e=!1,r=window.location.hash.slice(1).split("&").map((r=>{let n=r.split("=")[0];return n===t?(e=!0,`${n}=${c}`):r})).filter((t=>t));return e||r.push(`${t}=${c}`),`#${r.join("&")}`}return`#${c}`}}let En={linearity:.3,easing:e.b8(0,0,.3,1)},Cn=e.e({deceleration:2500,maxSpeed:1400},En),In=e.e({deceleration:20,maxSpeed:1400},En),Ln=e.e({deceleration:1e3,maxSpeed:360},En),Pn=e.e({deceleration:1e3,maxSpeed:90},En);class zn{constructor(t){this._map=t,this.clear()}clear(){this._inertiaBuffer=[]}record(t){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:a.now(),settings:t})}_drainInertiaBuffer(){let t=this._inertiaBuffer,e=a.now();for(;t.length>0&&e-t[0].time>160;)t.shift()}_onMoveEnd(t){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;let r={zoom:0,bearing:0,pitch:0,pan:new e.P(0,0),pinchAround:void 0,around:void 0};for(let{settings:t}of this._inertiaBuffer)r.zoom+=t.zoomDelta||0,r.bearing+=t.bearingDelta||0,r.pitch+=t.pitchDelta||0,t.panDelta&&r.pan._add(t.panDelta),t.around&&(r.around=t.around),t.pinchAround&&(r.pinchAround=t.pinchAround);let n=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,i={};if(r.pan.mag()){let a=On(r.pan.mag(),n,e.e({},Cn,t||{}));i.offset=r.pan.mult(a.amount/r.pan.mag()),i.center=this._map.transform.center,Dn(i,a)}if(r.zoom){let t=On(r.zoom,n,In);i.zoom=this._map.transform.zoom+t.amount,Dn(i,t)}if(r.bearing){let t=On(r.bearing,n,Ln);i.bearing=this._map.transform.bearing+e.ac(t.amount,-179,179),Dn(i,t)}if(r.pitch){let t=On(r.pitch,n,Pn);i.pitch=this._map.transform.pitch+t.amount,Dn(i,t)}if(i.zoom||i.bearing){let t=void 0===r.pinchAround?r.around:r.pinchAround;i.around=t?this._map.unproject(t):this._map.getCenter()}return this.clear(),e.e(i,{noMoveStart:!0})}}function Dn(t,e){(!t.duration||t.durationr.unproject(t))),l=a.reduce(((t,e,r,n)=>t.add(e.div(n.length))),new e.P(0,0));super(t,{points:a,point:l,lngLats:s,lngLat:r.unproject(l),originalEvent:n}),this._defaultPrevented=!1}}class Bn extends e.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,e,r){super(t,{originalEvent:r}),this._defaultPrevented=!1}}class jn{constructor(t,e){this._map=t,this._clickTolerance=e.clickTolerance}reset(){delete this._mousedownPos}wheel(t){return this._firePreventable(new Bn(t.type,this._map,t))}mousedown(t,e){return this._mousedownPos=e,this._firePreventable(new Rn(t.type,this._map,t))}mouseup(t){this._map.fire(new Rn(t.type,this._map,t))}click(t,e){this._mousedownPos&&this._mousedownPos.dist(e)>=this._clickTolerance||this._map.fire(new Rn(t.type,this._map,t))}dblclick(t){return this._firePreventable(new Rn(t.type,this._map,t))}mouseover(t){this._map.fire(new Rn(t.type,this._map,t))}mouseout(t){this._map.fire(new Rn(t.type,this._map,t))}touchstart(t){return this._firePreventable(new Fn(t.type,this._map,t))}touchmove(t){this._map.fire(new Fn(t.type,this._map,t))}touchend(t){this._map.fire(new Fn(t.type,this._map,t))}touchcancel(t){this._map.fire(new Fn(t.type,this._map,t))}_firePreventable(t){if(this._map.fire(t),t.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Nn{constructor(t){this._map=t}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(t){this._map.fire(new Rn(t.type,this._map,t))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Rn("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(t){this._delayContextMenu?this._contextMenuEvent=t:this._ignoreContextMenu||this._map.fire(new Rn(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Un{constructor(t){this._map=t}get transform(){return this._map._requestedCameraState||this._map.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(t){return this.transform.pointLocation(e.P.convert(t),this._map.terrain)}}class Vn{constructor(t,e){this._map=t,this._tr=new Un(t),this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=e.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(t,e){this.isEnabled()&&t.shiftKey&&0===t.button&&(o.disableDrag(),this._startPos=this._lastPos=e,this._active=!0)}mousemoveWindow(t,e){if(!this._active)return;let r=e;if(this._lastPos.equals(r)||!this._box&&r.dist(this._startPos)t.fitScreenCoordinates(n,i,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",t)}keydown(t){this._active&&27===t.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",t))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(o.remove(this._box),this._box=null),o.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(t,r){return this._map.fire(new e.k(t,{originalEvent:r}))}}function qn(t,e){if(t.length!==e.length)throw new Error(`The number of touches and points are not equal - touches ${t.length}, points ${e.length}`);let r={};for(let n=0;nthis.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=t.timeStamp),n.length===this.numTouches&&(this.centroid=function(t){let r=new e.P(0,0);for(let e of t)r._add(e);return r.div(t.length)}(r),this.touches=qn(n,r)))}touchmove(t,e,r){if(this.aborted||!this.centroid)return;let n=qn(r,e);for(let t in this.touches){let e=n[t];(!e||e.dist(this.touches[t])>30)&&(this.aborted=!0)}}touchend(t,e,r){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),0===r.length){let t=!this.aborted&&this.centroid;if(this.reset(),t)return t}}}class Gn{constructor(t){this.singleTap=new Hn(t),this.numTaps=t.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(t,e,r){this.singleTap.touchstart(t,e,r)}touchmove(t,e,r){this.singleTap.touchmove(t,e,r)}touchend(t,e,r){let n=this.singleTap.touchend(t,e,r);if(n){let e=t.timeStamp-this.lastTime<500,r=!this.lastTap||this.lastTap.dist(n)<30;if(e&&r||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=n,this.count===this.numTaps)return this.reset(),n}}}class Wn{constructor(t){this._tr=new Un(t),this._zoomIn=new Gn({numTouches:1,numTaps:2}),this._zoomOut=new Gn({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(t,e,r){this._zoomIn.touchstart(t,e,r),this._zoomOut.touchstart(t,e,r)}touchmove(t,e,r){this._zoomIn.touchmove(t,e,r),this._zoomOut.touchmove(t,e,r)}touchend(t,e,r){let n=this._zoomIn.touchend(t,e,r),i=this._zoomOut.touchend(t,e,r),a=this._tr;return n?(this._active=!0,t.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:e=>e.easeTo({duration:300,zoom:a.zoom+1,around:a.unproject(n)},{originalEvent:t})}):i?(this._active=!0,t.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:e=>e.easeTo({duration:300,zoom:a.zoom-1,around:a.unproject(i)},{originalEvent:t})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Zn{constructor(t){this._enabled=!!t.enable,this._moveStateManager=t.moveStateManager,this._clickTolerance=t.clickTolerance||1,this._moveFunction=t.move,this._activateOnStart=!!t.activateOnStart,t.assignEvents(this),this.reset()}reset(t){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(t)}_move(...t){let e=this._moveFunction(...t);if(e.bearingDelta||e.pitchDelta||e.around||e.panDelta)return this._active=!0,e}dragStart(t,e){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(t)&&(this._moveStateManager.startMove(t),this._lastPoint=e.length?e[0]:e,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(t,e){if(!this.isEnabled())return;let r=this._lastPoint;if(!r)return;if(t.preventDefault(),!this._moveStateManager.isValidMoveEvent(t))return void this.reset(t);let n=e.length?e[0]:e;return!this._moved&&n.dist(r){t.mousedown=t.dragStart,t.mousemoveWindow=t.dragMove,t.mouseup=t.dragEnd,t.contextmenu=t=>{t.preventDefault()}},Jn=({enable:t,clickTolerance:e,bearingDegreesPerPixelMoved:r=.8})=>{let n=new Xn({checkCorrectEvent:t=>0===o.mouseButton(t)&&t.ctrlKey||2===o.mouseButton(t)});return new Zn({clickTolerance:e,move:(t,e)=>({bearingDelta:(e.x-t.x)*r}),moveStateManager:n,enable:t,assignEvents:Kn})},Qn=({enable:t,clickTolerance:e,pitchDegreesPerPixelMoved:r=-.5})=>{let n=new Xn({checkCorrectEvent:t=>0===o.mouseButton(t)&&t.ctrlKey||2===o.mouseButton(t)});return new Zn({clickTolerance:e,move:(t,e)=>({pitchDelta:(e.y-t.y)*r}),moveStateManager:n,enable:t,assignEvents:Kn})};class ti{constructor(t,e){this._clickTolerance=t.clickTolerance||1,this._map=e,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new e.P(0,0)}_shouldBePrevented(t){return t<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(t,e,r){return this._calculateTransform(t,e,r)}touchmove(t,e,r){if(this._active){if(!this._shouldBePrevented(r.length))return t.preventDefault(),this._calculateTransform(t,e,r);this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",t)}}touchend(t,e,r){this._calculateTransform(t,e,r),this._active&&this._shouldBePrevented(r.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(t,r,n){n.length>0&&(this._active=!0);let i=qn(n,r),a=new e.P(0,0),o=new e.P(0,0),s=0;for(let t in i){let e=i[t],r=this._touches[t];r&&(a._add(e),o._add(e.sub(r)),s++,i[t]=e)}if(this._touches=i,this._shouldBePrevented(s)||!o.mag())return;let l=o.div(s);return this._sum._add(l),this._sum.mag()Math.abs(t.x)}class li extends ei{constructor(t){super(),this._currentTouchCount=0,this._map=t}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(t,e,r){super.touchstart(t,e,r),this._currentTouchCount=r.length}_start(t){this._lastPoints=t,si(t[0].sub(t[1]))&&(this._valid=!1)}_move(t,e,r){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;let n=t[0].sub(this._lastPoints[0]),i=t[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(n,i,r.timeStamp),this._valid?(this._lastPoints=t,this._active=!0,{pitchDelta:(n.y+i.y)/2*-.5}):void 0}gestureBeginsVertically(t,e,r){if(void 0!==this._valid)return this._valid;let n=t.mag()>=2,i=e.mag()>=2;if(!n&&!i)return;if(!n||!i)return void 0===this._firstMove&&(this._firstMove=r),r-this._firstMove<100&&void 0;let a=t.y>0==e.y>0;return si(t)&&si(e)&&a}}let ci={panStep:100,bearingStep:15,pitchStep:10};class ui{constructor(t){this._tr=new Un(t);let e=ci;this._panStep=e.panStep,this._bearingStep=e.bearingStep,this._pitchStep=e.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(t){if(t.altKey||t.ctrlKey||t.metaKey)return;let e=0,r=0,n=0,i=0,a=0;switch(t.keyCode){case 61:case 107:case 171:case 187:e=1;break;case 189:case 109:case 173:e=-1;break;case 37:t.shiftKey?r=-1:(t.preventDefault(),i=-1);break;case 39:t.shiftKey?r=1:(t.preventDefault(),i=1);break;case 38:t.shiftKey?n=1:(t.preventDefault(),a=-1);break;case 40:t.shiftKey?n=-1:(t.preventDefault(),a=1);break;default:return}return this._rotationDisabled&&(r=0,n=0),{cameraAnimation:o=>{let s=this._tr;o.easeTo({duration:300,easeId:"keyboardHandler",easing:hi,zoom:e?Math.round(s.zoom)+e*(t.shiftKey?2:1):s.zoom,bearing:s.bearing+r*this._bearingStep,pitch:s.pitch+n*this._pitchStep,offset:[-i*this._panStep,-a*this._panStep],center:s.center},{originalEvent:t})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function hi(t){return t*(2-t)}let pi=4.000244140625;class fi{constructor(t,e){this._onTimeout=t=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(t)},this._map=t,this._tr=new Un(t),this._triggerRenderFrame=e,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(t){this._defaultZoomRate=t}setWheelZoomRate(t){this._wheelZoomRate=t}isEnabled(){return!!this._enabled}isActive(){return!!this._active||void 0!==this._finishTimeout}isZooming(){return!!this._zooming}enable(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!t&&"center"===t.around)}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(t){return!!this._map.cooperativeGestures.isEnabled()&&!(t.ctrlKey||this._map.cooperativeGestures.isBypassed(t))}wheel(t){if(!this.isEnabled())return;if(this._shouldBePrevented(t))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",t);let e=t.deltaMode===WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY,r=a.now(),n=r-(this._lastWheelEventTime||0);this._lastWheelEventTime=r,0!==e&&e%pi==0?this._type="wheel":0!==e&&Math.abs(e)<4?this._type="trackpad":n>400?(this._type=null,this._lastValue=e,this._timeout=setTimeout(this._onTimeout,40,t)):this._type||(this._type=Math.abs(n*e)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,e+=this._lastValue)),t.shiftKey&&e&&(e/=4),this._type&&(this._lastWheelEvent=t,this._delta-=e,this._active||this._start(t)),t.preventDefault()}_start(t){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);let r=o.mousePos(this._map.getCanvas(),t),n=this._tr;this._around=r.y>n.transform.height/2-n.transform.getHorizon()?e.N.convert(this._aroundCenter?n.center:n.unproject(r)):e.N.convert(n.center),this._aroundPoint=n.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;let t=this._tr.transform;if(0!==this._delta){let e="wheel"===this._type&&Math.abs(this._delta)>pi?this._wheelZoomRate:this._defaultZoomRate,r=2/(1+Math.exp(-Math.abs(this._delta*e)));this._delta<0&&0!==r&&(r=1/r);let n="number"==typeof this._targetZoom?t.zoomScale(this._targetZoom):t.scale;this._targetZoom=Math.min(t.maxZoom,Math.max(t.minZoom,t.scaleZoom(n*r))),"wheel"===this._type&&(this._startZoom=t.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}let r,n="number"==typeof this._targetZoom?this._targetZoom:t.zoom,i=this._startZoom,o=this._easing,s=!1,l=a.now()-this._lastWheelEventTime;if("wheel"===this._type&&i&&o&&l){let t=Math.min(l/200,1),a=o(t);r=e.y.number(i,n,a),t<1?this._frameId||(this._frameId=!0):s=!0}else r=n,s=!0;return this._active=!0,s&&(this._active=!1,this._finishTimeout=setTimeout((()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout}),200)),{noInertia:!0,needsRenderFrame:!s,zoomDelta:r-t.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(t){let r=e.b9;if(this._prevEase){let t=this._prevEase,n=(a.now()-t.start)/t.duration,i=t.easing(n+.01)-t.easing(n),o=.27/Math.sqrt(i*i+1e-4)*.01,s=Math.sqrt(.0729-o*o);r=e.b8(o,s,.25,1)}return this._prevEase={start:a.now(),duration:t,easing:r},r}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class di{constructor(t,e){this._clickZoom=t,this._tapZoom=e}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class mi{constructor(t){this._tr=new Un(t),this.reset()}reset(){this._active=!1}dblclick(t,e){return t.preventDefault(),{cameraAnimation:r=>{r.easeTo({duration:300,zoom:this._tr.zoom+(t.shiftKey?-1:1),around:this._tr.unproject(e)},{originalEvent:t})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class gi{constructor(){this._tap=new Gn({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(t,e,r){if(!this._swipePoint)if(this._tapTime){let n=e[0],i=t.timeStamp-this._tapTime<500,a=this._tapPoint.dist(n)<30;i&&a?r.length>0&&(this._swipePoint=n,this._swipeTouch=r[0].identifier):this.reset()}else this._tap.touchstart(t,e,r)}touchmove(t,e,r){if(this._tapTime){if(this._swipePoint){if(r[0].identifier!==this._swipeTouch)return;let n=e[0],i=n.y-this._swipePoint.y;return this._swipePoint=n,t.preventDefault(),this._active=!0,{zoomDelta:i/128}}}else this._tap.touchmove(t,e,r)}touchend(t,e,r){if(this._tapTime)this._swipePoint&&0===r.length&&this.reset();else{let n=this._tap.touchend(t,e,r);n&&(this._tapTime=t.timeStamp,this._tapPoint=n)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class yi{constructor(t,e,r){this._el=t,this._mousePan=e,this._touchPan=r}enable(t){this._inertiaOptions=t||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class vi{constructor(t,e,r){this._pitchWithRotate=t.pitchWithRotate,this._mouseRotate=e,this._mousePitch=r}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}class xi{constructor(t,e,r,n){this._el=t,this._touchZoom=e,this._touchRotate=r,this._tapDragZoom=n,this._rotationDisabled=!1,this._enabled=!0}enable(t){this._touchZoom.enable(t),this._rotationDisabled||this._touchRotate.enable(t),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}class _i{constructor(t,e){this._bypassKey=-1!==navigator.userAgent.indexOf("Mac")?"metaKey":"ctrlKey",this._map=t,this._options=e,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;let t=this._map.getCanvasContainer();t.classList.add("maplibregl-cooperative-gestures"),this._container=o.create("div","maplibregl-cooperative-gesture-screen",t);let e=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");"metaKey"===this._bypassKey&&(e=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));let r=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),n=document.createElement("div");n.className="maplibregl-desktop-message",n.textContent=e,this._container.appendChild(n);let i=document.createElement("div");i.className="maplibregl-mobile-message",i.textContent=r,this._container.appendChild(i),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(o.remove(this._container),this._map.getCanvasContainer().classList.remove("maplibregl-cooperative-gestures")),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destroyUI()}isEnabled(){return this._enabled}isBypassed(t){return t[this._bypassKey]}notifyGestureBlocked(t,r){this._enabled&&(this._map.fire(new e.k("cooperativegestureprevented",{gestureType:t,originalEvent:r})),this._container.classList.add("maplibregl-show"),setTimeout((()=>{this._container.classList.remove("maplibregl-show")}),100))}}let bi=t=>t.zoom||t.drag||t.pitch||t.rotate;class wi extends e.k{}function Ti(t){return t.panDelta&&t.panDelta.mag()||t.zoomDelta||t.bearingDelta||t.pitchDelta}class Ai{constructor(t,e){this.handleWindowEvent=t=>{this.handleEvent(t,`${t.type}Window`)},this.handleEvent=(t,e)=>{if("blur"===t.type)return void this.stop(!0);this._updatingCamera=!0;let r="renderFrame"===t.type?void 0:t,n={needsRenderFrame:!1},i={},a={},s=t.touches,l=s?this._getMapTouches(s):void 0,c=l?o.touchPos(this._map.getCanvas(),l):o.mousePos(this._map.getCanvas(),t);for(let{handlerName:o,handler:s,allowed:u}of this._handlers){if(!s.isEnabled())continue;let h;this._blockedByActive(a,u,o)?s.reset():s[e||t.type]&&(h=s[e||t.type](t,c,l),this.mergeHandlerResult(n,i,h,o,r),h&&h.needsRenderFrame&&this._triggerRenderFrame()),(h||s.isActive())&&(a[o]=s)}let u={};for(let t in this._previousActiveHandlers)a[t]||(u[t]=r);this._previousActiveHandlers=a,(Object.keys(u).length||Ti(n))&&(this._changes.push([n,i,u]),this._triggerRenderFrame()),(Object.keys(a).length||Ti(n))&&this._map._stop(!0),this._updatingCamera=!1;let{cameraAnimation:h}=n;h&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],h(this._map))},this._map=t,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new zn(t),this._bearingSnap=e.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(e);let r=this._el;this._listeners=[[r,"touchstart",{passive:!0}],[r,"touchmove",{passive:!1}],[r,"touchend",void 0],[r,"touchcancel",void 0],[r,"mousedown",void 0],[r,"mousemove",void 0],[r,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[r,"mouseover",void 0],[r,"mouseout",void 0],[r,"dblclick",void 0],[r,"click",void 0],[r,"keydown",{capture:!1}],[r,"keyup",void 0],[r,"wheel",{passive:!1}],[r,"contextmenu",void 0],[window,"blur",void 0]];for(let[t,e,r]of this._listeners)o.addEventListener(t,e,t===document?this.handleWindowEvent:this.handleEvent,r)}destroy(){for(let[t,e,r]of this._listeners)o.removeEventListener(t,e,t===document?this.handleWindowEvent:this.handleEvent,r)}_addDefaultHandlers(t){let e=this._map,r=e.getCanvasContainer();this._add("mapEvent",new jn(e,t));let n=e.boxZoom=new Vn(e,t);this._add("boxZoom",n),t.interactive&&t.boxZoom&&n.enable();let i=e.cooperativeGestures=new _i(e,t.cooperativeGestures);this._add("cooperativeGestures",i),t.cooperativeGestures&&i.enable();let a=new Wn(e),s=new mi(e);e.doubleClickZoom=new di(s,a),this._add("tapZoom",a),this._add("clickZoom",s),t.interactive&&t.doubleClickZoom&&e.doubleClickZoom.enable();let l=new gi;this._add("tapDragZoom",l);let c=e.touchPitch=new li(e);this._add("touchPitch",c),t.interactive&&t.touchPitch&&e.touchPitch.enable(t.touchPitch);let u=Jn(t),h=Qn(t);e.dragRotate=new vi(t,u,h),this._add("mouseRotate",u,["mousePitch"]),this._add("mousePitch",h,["mouseRotate"]),t.interactive&&t.dragRotate&&e.dragRotate.enable();let p=(({enable:t,clickTolerance:e})=>{let r=new Xn({checkCorrectEvent:t=>0===o.mouseButton(t)&&!t.ctrlKey});return new Zn({clickTolerance:e,move:(t,e)=>({around:e,panDelta:e.sub(t)}),activateOnStart:!0,moveStateManager:r,enable:t,assignEvents:Kn})})(t),f=new ti(t,e);e.dragPan=new yi(r,p,f),this._add("mousePan",p),this._add("touchPan",f,["touchZoom","touchRotate"]),t.interactive&&t.dragPan&&e.dragPan.enable(t.dragPan);let d=new oi,m=new ii;e.touchZoomRotate=new xi(r,m,d,l),this._add("touchRotate",d,["touchPan","touchZoom"]),this._add("touchZoom",m,["touchPan","touchRotate"]),t.interactive&&t.touchZoomRotate&&e.touchZoomRotate.enable(t.touchZoomRotate);let g=e.scrollZoom=new fi(e,(()=>this._triggerRenderFrame()));this._add("scrollZoom",g,["mousePan"]),t.interactive&&t.scrollZoom&&e.scrollZoom.enable(t.scrollZoom);let y=e.keyboard=new ui(e);this._add("keyboard",y),t.interactive&&t.keyboard&&e.keyboard.enable(),this._add("blockableMapEvent",new Nn(e))}_add(t,e,r){this._handlers.push({handlerName:t,handler:e,allowed:r}),this._handlersById[t]=e}stop(t){if(!this._updatingCamera){for(let{handler:t}of this._handlers)t.reset();this._inertia.clear(),this._fireEvents({},{},t),this._changes=[]}}isActive(){for(let{handler:t}of this._handlers)if(t.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!bi(this._eventsInProgress)||this.isZooming()}_blockedByActive(t,e,r){for(let n in t)if(n!==r&&(!e||e.indexOf(n)<0))return!0;return!1}_getMapTouches(t){let e=[];for(let r of t)this._el.contains(r.target)&&e.push(r);return e}mergeHandlerResult(t,r,n,i,a){if(!n)return;e.e(t,n);let o={handlerName:i,originalEvent:n.originalEvent||a};void 0!==n.zoomDelta&&(r.zoom=o),void 0!==n.panDelta&&(r.drag=o),void 0!==n.pitchDelta&&(r.pitch=o),void 0!==n.bearingDelta&&(r.rotate=o)}_applyChanges(){let t={},r={},n={};for(let[i,a,o]of this._changes)i.panDelta&&(t.panDelta=(t.panDelta||new e.P(0,0))._add(i.panDelta)),i.zoomDelta&&(t.zoomDelta=(t.zoomDelta||0)+i.zoomDelta),i.bearingDelta&&(t.bearingDelta=(t.bearingDelta||0)+i.bearingDelta),i.pitchDelta&&(t.pitchDelta=(t.pitchDelta||0)+i.pitchDelta),void 0!==i.around&&(t.around=i.around),void 0!==i.pinchAround&&(t.pinchAround=i.pinchAround),i.noInertia&&(t.noInertia=i.noInertia),e.e(r,a),e.e(n,o);this._updateMapTransform(t,r,n),this._changes=[]}_updateMapTransform(t,e,r){let n=this._map,i=n._getTransformForUpdate(),a=n.terrain;if(!(Ti(t)||a&&this._terrainMovement))return this._fireEvents(e,r,!0);let{panDelta:o,zoomDelta:s,bearingDelta:l,pitchDelta:c,around:u,pinchAround:h}=t;void 0!==h&&(u=h),n._stop(!0),u=u||n.transform.centerPoint;let p=i.pointLocation(o?u.sub(o):u);l&&(i.bearing+=l),c&&(i.pitch+=c),s&&(i.zoom+=s),a?this._terrainMovement||!e.drag&&!e.zoom?e.drag&&this._terrainMovement?i.center=i.pointLocation(i.centerPoint.sub(o)):i.setLocationAtPoint(p,u):(this._terrainMovement=!0,this._map._elevationFreeze=!0,i.setLocationAtPoint(p,u)):i.setLocationAtPoint(p,u),n._applyUpdatedTransform(i),this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(e,r,!0)}_fireEvents(t,r,n){let i=bi(this._eventsInProgress),o=bi(t),s={};for(let e in t){let{originalEvent:r}=t[e];this._eventsInProgress[e]||(s[`${e}start`]=r),this._eventsInProgress[e]=t[e]}!i&&o&&this._fireEvent("movestart",o.originalEvent);for(let t in s)this._fireEvent(t,s[t]);o&&this._fireEvent("move",o.originalEvent);for(let e in t){let{originalEvent:r}=t[e];this._fireEvent(e,r)}let l,c={};for(let t in this._eventsInProgress){let{handlerName:e,originalEvent:n}=this._eventsInProgress[t];this._handlersById[e].isActive()||(delete this._eventsInProgress[t],l=r[e]||n,c[`${t}end`]=l)}for(let t in c)this._fireEvent(t,c[t]);let u=bi(this._eventsInProgress),h=(i||o)&&!u;if(h&&this._terrainMovement){this._map._elevationFreeze=!1,this._terrainMovement=!1;let t=this._map._getTransformForUpdate();t.recalculateZoom(this._map.terrain),this._map._applyUpdatedTransform(t)}if(n&&h){this._updatingCamera=!0;let t=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),r=t=>0!==t&&-this._bearingSnap{delete this._frameId,this.handleEvent(new wi("renderFrame",{timeStamp:t})),this._applyChanges()}))}_triggerRenderFrame(){void 0===this._frameId&&(this._frameId=this._requestFrame())}}class ki extends e.E{constructor(t,e){super(),this._renderFrameCallback=()=>{let t=Math.min((a.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(t)),t<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=t,this._bearingSnap=e.bearingSnap,this.on("moveend",(()=>{delete this._requestedCameraState}))}getCenter(){return new e.N(this.transform.center.lng,this.transform.center.lat)}setCenter(t,e){return this.jumpTo({center:t},e)}panBy(t,r,n){return t=e.P.convert(t).mult(-1),this.panTo(this.transform.center,e.e({offset:t},r),n)}panTo(t,r,n){return this.easeTo(e.e({center:t},r),n)}getZoom(){return this.transform.zoom}setZoom(t,e){return this.jumpTo({zoom:t},e),this}zoomTo(t,r,n){return this.easeTo(e.e({zoom:t},r),n)}zoomIn(t,e){return this.zoomTo(this.getZoom()+1,t,e),this}zoomOut(t,e){return this.zoomTo(this.getZoom()-1,t,e),this}getBearing(){return this.transform.bearing}setBearing(t,e){return this.jumpTo({bearing:t},e),this}getPadding(){return this.transform.padding}setPadding(t,e){return this.jumpTo({padding:t},e),this}rotateTo(t,r,n){return this.easeTo(e.e({bearing:t},r),n)}resetNorth(t,r){return this.rotateTo(0,e.e({duration:1e3},t),r),this}resetNorthPitch(t,r){return this.easeTo(e.e({bearing:0,pitch:0,duration:1e3},t),r),this}snapToNorth(t,e){return Math.abs(this.getBearing()){if(this._zooming&&(i.zoom=e.y.number(o,y,n)),this._rotating&&(i.bearing=e.y.number(s,u,n)),this._pitching&&(i.pitch=e.y.number(l,h,n)),this._padding&&(i.interpolatePadding(c,p,n),d=i.centerPoint.add(f)),this.terrain&&!t.freezeElevation&&this._updateElevation(n),v)i.setLocationAtPoint(v,x);else{let t=i.zoomScale(i.zoom-o),e=y>o?Math.min(2,w):Math.max(.5,w),r=Math.pow(e,1-n),a=i.unproject(_.add(b.mult(n*r)).mult(t));i.setLocationAtPoint(i.renderWorldCopies?a.wrap():a,d)}this._applyUpdatedTransform(i),this._fireMoveEvents(r)}),(e=>{this.terrain&&t.freezeElevation&&this._finalizeElevation(),this._afterEase(r,e)}),t),this}_prepareEase(t,r,n={}){this._moving=!0,r||n.moving||this.fire(new e.k("movestart",t)),this._zooming&&!n.zooming&&this.fire(new e.k("zoomstart",t)),this._rotating&&!n.rotating&&this.fire(new e.k("rotatestart",t)),this._pitching&&!n.pitching&&this.fire(new e.k("pitchstart",t))}_prepareElevation(t){this._elevationCenter=t,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(t,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(t){this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);let r=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(t<1&&r!==this._elevationTarget){let e=this._elevationTarget-this._elevationStart;this._elevationStart+=t*(e-(r-(e*t+this._elevationStart))/(1-t)),this._elevationTarget=r}this.transform.elevation=e.y.number(this._elevationStart,this._elevationTarget,t)}_finalizeElevation(){this._elevationFreeze=!1,this.transform.recalculateZoom(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate||this.terrain?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_elevateCameraIfInsideTerrain(t){let e=t.getCameraPosition(),r=this.terrain.getElevationForLngLatZoom(e.lngLat,t.zoom);if(e.altitudethis._elevateCameraIfInsideTerrain(t))),this.transformCameraUpdate&&e.push((t=>this.transformCameraUpdate(t))),!e.length)return;let r=t.clone();for(let t of e){let e=r.clone(),{center:n,zoom:i,pitch:a,bearing:o,elevation:s}=t(e);n&&(e.center=n),void 0!==i&&(e.zoom=i),void 0!==a&&(e.pitch=a),void 0!==o&&(e.bearing=o),void 0!==s&&(e.elevation=s),r.apply(e)}this.transform.apply(r)}_fireMoveEvents(t){this.fire(new e.k("move",t)),this._zooming&&this.fire(new e.k("zoom",t)),this._rotating&&this.fire(new e.k("rotate",t)),this._pitching&&this.fire(new e.k("pitch",t))}_afterEase(t,r){if(this._easeId&&r&&this._easeId===r)return;delete this._easeId;let n=this._zooming,i=this._rotating,a=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,n&&this.fire(new e.k("zoomend",t)),i&&this.fire(new e.k("rotateend",t)),a&&this.fire(new e.k("pitchend",t)),this.fire(new e.k("moveend",t))}flyTo(t,r){var n;if(!t.essential&&a.prefersReducedMotion){let n=e.M(t,["center","zoom","bearing","pitch","around"]);return this.jumpTo(n,r)}this.stop(),t=e.e({offset:[0,0],speed:1.2,curve:1.42,easing:e.b9},t);let i=this._getTransformForUpdate(),o=i.zoom,s=i.bearing,l=i.pitch,c=i.padding,u="bearing"in t?this._normalizeBearing(t.bearing,s):s,h="pitch"in t?+t.pitch:l,p="padding"in t?t.padding:i.padding,f=e.P.convert(t.offset),d=i.centerPoint.add(f),m=i.pointLocation(d),{center:g,zoom:y}=i.getConstrained(e.N.convert(t.center||m),null!==(n=t.zoom)&&void 0!==n?n:o);this._normalizeCenter(g,i);let v=i.zoomScale(y-o),x=i.project(m),_=i.project(g).sub(x),b=t.curve,w=Math.max(i.width,i.height),T=w/v,A=_.mag();if("minZoom"in t){let r=e.ac(Math.min(t.minZoom,o,y),i.minZoom,i.maxZoom),n=w/i.zoomScale(r-o);b=Math.sqrt(n/A*2)}let k=b*b;function M(t){let e=(T*T-w*w+(t?-1:1)*k*k*A*A)/(2*(t?T:w)*k*A);return Math.log(Math.sqrt(e*e+1)-e)}function S(t){return(Math.exp(t)-Math.exp(-t))/2}function E(t){return(Math.exp(t)+Math.exp(-t))/2}let C=M(!1),I=function(t){return E(C)/E(C+b*t)},L=function(t){return w*((E(C)*(S(e=C+b*t)/E(e))-S(C))/k)/A;var e},P=(M(!0)-C)/b;if(Math.abs(A)<1e-6||!isFinite(P)){if(Math.abs(w-T)<1e-6)return this.easeTo(t,r);let e=T0,I=t=>Math.exp(e*b*t)}return t.duration="duration"in t?+t.duration:1e3*P/("screenSpeed"in t?+t.screenSpeed/b:+t.speed),t.maxDuration&&t.duration>t.maxDuration&&(t.duration=0),this._zooming=!0,this._rotating=s!==u,this._pitching=h!==l,this._padding=!i.isPaddingEqual(p),this._prepareEase(r,!1),this.terrain&&this._prepareElevation(g),this._ease((n=>{let a=n*P,m=1/I(a);i.zoom=1===n?y:o+i.scaleZoom(m),this._rotating&&(i.bearing=e.y.number(s,u,n)),this._pitching&&(i.pitch=e.y.number(l,h,n)),this._padding&&(i.interpolatePadding(c,p,n),d=i.centerPoint.add(f)),this.terrain&&!t.freezeElevation&&this._updateElevation(n);let v=1===n?g:i.unproject(x.add(_.mult(L(a))).mult(m));i.setLocationAtPoint(i.renderWorldCopies?v.wrap():v,d),this._applyUpdatedTransform(i),this._fireMoveEvents(r)}),(()=>{this.terrain&&t.freezeElevation&&this._finalizeElevation(),this._afterEase(r)}),t),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(t,e){var r;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){let t=this._onEaseEnd;delete this._onEaseEnd,t.call(this,e)}return t||null===(r=this.handlers)||void 0===r||r.stop(!1),this}_ease(t,e,r){!1===r.animate||0===r.duration?(t(1),e()):(this._easeStart=a.now(),this._easeOptions=r,this._onEaseFrame=t,this._onEaseEnd=e,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(t,r){t=e.b3(t,-180,180);let n=Math.abs(t-r);return Math.abs(t-360-r)180?-360:r<-180?360:0}queryTerrainElevation(t){return this.terrain?this.terrain.getElevationForLngLatZoom(e.N.convert(t),this.transform.tileZoom)-this.transform.elevation:null}}let Mi={compact:!0,customAttribution:'MapLibre'};class Si{constructor(t=Mi){this._toggleAttribution=()=>{this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show")):(this._container.classList.add("maplibregl-compact-show"),this._container.removeAttribute("open")))},this._updateData=t=>{!t||"metadata"!==t.sourceDataType&&"visibility"!==t.sourceDataType&&"style"!==t.dataType&&"terrain"!==t.type||this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?!1===this._compact?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=t}getDefaultPosition(){return"bottom-right"}onAdd(t){return this._map=t,this._compact=this.options.compact,this._container=o.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=o.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=o.create("div","maplibregl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){o.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(t,e){let r=this._map._getUIString(`AttributionControl.${e}`);t.title=r,t.setAttribute("aria-label",r)}_updateAttributions(){if(!this._map.style)return;let t=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?t=t.concat(this.options.customAttribution.map((t=>"string"!=typeof t?"":t))):"string"==typeof this.options.customAttribution&&t.push(this.options.customAttribution)),this._map.style.stylesheet){let t=this._map.style.stylesheet;this.styleOwner=t.owner,this.styleId=t.id}let e=this._map.style.sourceCaches;for(let r in e){let n=e[r];if(n.used||n.usedForTerrain){let e=n.getSource();e.attribution&&t.indexOf(e.attribution)<0&&t.push(e.attribution)}}t=t.filter((t=>String(t).trim())),t.sort(((t,e)=>t.length-e.length)),t=t.filter(((e,r)=>{for(let n=r+1;n=0)return!1;return!0}));let r=t.join(" | ");r!==this._attribHTML&&(this._attribHTML=r,t.length?(this._innerContainer.innerHTML=r,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class Ei{constructor(t={}){this._updateCompact=()=>{let t=this._container.children;if(t.length){let e=t[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?!1!==this._compact&&e.classList.add("maplibregl-compact"):e.classList.remove("maplibregl-compact")}},this.options=t}getDefaultPosition(){return"bottom-left"}onAdd(t){this._map=t,this._compact=this.options&&this.options.compact,this._container=o.create("div","maplibregl-ctrl");let e=o.create("a","maplibregl-ctrl-logo");return e.target="_blank",e.rel="noopener nofollow",e.href="https://maplibre.org/",e.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),e.setAttribute("rel","noopener nofollow"),this._container.appendChild(e),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){o.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class Ci{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(t){let e=++this._id;return this._queue.push({callback:t,id:e,cancelled:!1}),e}remove(t){let e=this._currentlyRunning,r=e?this._queue.concat(e):this._queue;for(let e of r)if(e.id===t)return void(e.cancelled=!0)}run(t=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");let e=this._currentlyRunning=this._queue;this._queue=[];for(let r of e)if(!r.cancelled&&(r.callback(t),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var Ii=e.Y([{name:"a_pos3d",type:"Int16",components:3}]);class Li extends e.E{constructor(t){super(),this.sourceCache=t,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,t.usedForTerrain=!0,t.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(t,r){this.sourceCache.update(t,r),this._renderableTilesKeys=[];let n={};for(let i of t.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:r}))n[i.key]=!0,this._renderableTilesKeys.push(i.key),this._tiles[i.key]||(i.posMatrix=new Float64Array(16),e.aP(i.posMatrix,0,e.X,0,e.X,0,1),this._tiles[i.key]=new ct(i,this.tileSize));for(let t in this._tiles)n[t]||delete this._tiles[t]}freeRtt(t){for(let e in this._tiles){let r=this._tiles[e];(!t||r.tileID.equals(t)||r.tileID.isChildOf(t)||t.isChildOf(r.tileID))&&(r.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map((t=>this.getTileByID(t)))}getTileByID(t){return this._tiles[t]}getTerrainCoords(t){let r={};for(let n of this._renderableTilesKeys){let i=this._tiles[n].tileID;if(i.canonical.equals(t.canonical)){let i=t.clone();i.posMatrix=new Float64Array(16),e.aP(i.posMatrix,0,e.X,0,e.X,0,1),r[n]=i}else if(i.canonical.isChildOf(t.canonical)){let a=t.clone();a.posMatrix=new Float64Array(16);let o=i.canonical.z-t.canonical.z,s=i.canonical.x-(i.canonical.x>>o<>o<>o;e.aP(a.posMatrix,0,c,0,c,0,1),e.J(a.posMatrix,a.posMatrix,[-s*c,-l*c,0]),r[n]=a}else if(t.canonical.isChildOf(i.canonical)){let a=t.clone();a.posMatrix=new Float64Array(16);let o=t.canonical.z-i.canonical.z,s=t.canonical.x-(t.canonical.x>>o<>o<>o;e.aP(a.posMatrix,0,e.X,0,e.X,0,1),e.J(a.posMatrix,a.posMatrix,[s*c,l*c,0]),e.K(a.posMatrix,a.posMatrix,[1/2**o,1/2**o,0]),r[n]=a}}return r}getSourceTile(t,e){let r=this.sourceCache._source,n=t.overscaledZ-this.deltaZoom;if(n>r.maxzoom&&(n=r.maxzoom),n=r.minzoom&&(!i||!i.dem);)i=this.sourceCache.getTileByID(t.scaledTo(n--).key);return i}tilesAfterTime(t=Date.now()){return Object.values(this._tiles).filter((e=>e.timeAdded>=t))}}class Pi{constructor(t,e,r){this.painter=t,this.sourceCache=new Li(e),this.options=r,this.exaggeration="number"==typeof r.exaggeration?r.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(t,r,n,i=e.X){var a;if(!(r>=0&&r=0&&nt.canonical.z&&(t.canonical.z>=n?i=t.canonical.z-n:e.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));let a=t.canonical.x-(t.canonical.x>>i<>i<>8<<4|t>>8,r[e+3]=0;let n=new e.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(r.buffer)),i=new w(t,n,t.gl.RGBA,{premultiply:!1});return i.bind(t.gl.NEAREST,t.gl.CLAMP_TO_EDGE),this._coordsTexture=i,i}pointCoordinate(t){this.painter.maybeDrawDepthAndCoords(!0);let r=new Uint8Array(4),n=this.painter.context,i=n.gl,a=Math.round(t.x*this.painter.pixelRatio/devicePixelRatio),o=Math.round(t.y*this.painter.pixelRatio/devicePixelRatio),s=Math.round(this.painter.height/devicePixelRatio);n.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),i.readPixels(a,s-o-1,1,1,i.RGBA,i.UNSIGNED_BYTE,r),n.bindFramebuffer.set(null);let l=r[0]+(r[2]>>4<<8),c=r[1]+((15&r[2])<<8),u=this.coordsIndex[255-r[3]],h=u&&this.sourceCache.getTileByID(u);if(!h)return null;let p=this._coordsTextureSize,f=(1<t.id!==e)),this._recentlyUsed.push(t.id)}stampObject(t){t.stamp=++this._stamp}getOrCreateFreeObject(){for(let t of this._recentlyUsed)if(!this._objects[t].inUse)return this._objects[t];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");let t=this._createObject(this._objects.length);return this._objects.push(t),t}freeObject(t){t.inUse=!1}freeAllObjects(){for(let t of this._objects)this.freeObject(t)}isFull(){return!(this._objects.length!t.inUse))}}let Di={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class Oi{constructor(t,e){this.painter=t,this.terrain=e,this.pool=new zi(t.context,30,e.sourceCache.tileSize*e.qualityFactor)}destruct(){this.pool.destruct()}getTexture(t){return this.pool.getObjectForId(t.rtt[this._stacks.length-1].id).texture}prepareForRender(t,e){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=t._order.filter((r=>!t._layers[r].isHidden(e))),this._coordsDescendingInv={};for(let e in t.sourceCaches){this._coordsDescendingInv[e]={};let r=t.sourceCaches[e].getVisibleCoordinates();for(let t of r){let r=this.terrain.sourceCache.getTerrainCoords(t);for(let t in r)this._coordsDescendingInv[e][t]||(this._coordsDescendingInv[e][t]=[]),this._coordsDescendingInv[e][t].push(r[t])}}this._coordsDescendingInvStr={};for(let e of t._order){let r=t._layers[e],n=r.source;if(Di[r.type]&&!this._coordsDescendingInvStr[n]){this._coordsDescendingInvStr[n]={};for(let t in this._coordsDescendingInv[n])this._coordsDescendingInvStr[n][t]=this._coordsDescendingInv[n][t].map((t=>t.key)).sort().join()}}for(let t of this._renderableTiles)for(let e in this._coordsDescendingInvStr){let r=this._coordsDescendingInvStr[e][t.tileID.key];r&&r!==t.rttCoords[e]&&(t.rtt=[])}}renderLayer(t){if(t.isHidden(this.painter.transform.zoom))return!1;let r=t.type,n=this.painter,i=this._renderableLayerIds[this._renderableLayerIds.length-1]===t.id;if(Di[r]&&(this._prevType&&Di[this._prevType]||this._stacks.push([]),this._prevType=r,this._stacks[this._stacks.length-1].push(t.id),!i))return!0;if(Di[this._prevType]||Di[r]&&i){this._prevType=r;let t=this._stacks.length-1,i=this._stacks[t]||[];for(let r of this._renderableTiles){if(this.pool.isFull()&&(vn(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(r),r.rtt[t]){let e=this.pool.getObjectForId(r.rtt[t].id);if(e.stamp===r.rtt[t].stamp){this.pool.useObject(e);continue}}let a=this.pool.getOrCreateFreeObject();this.pool.useObject(a),this.pool.stampObject(a),r.rtt[t]={id:a.id,stamp:a.stamp},n.context.bindFramebuffer.set(a.fbo.framebuffer),n.context.clear({color:e.aM.transparent,stencil:0}),n.currentStencilSource=void 0;for(let t=0;t{t.touchstart=t.dragStart,t.touchmoveWindow=t.dragMove,t.touchend=t.dragEnd},Ui={showCompass:!0,showZoom:!0,visualizePitch:!1};class Vi{constructor(t,r,n=!1){this.mousedown=t=>{this.startMouse(e.e({},t,{ctrlKey:!0,preventDefault:()=>t.preventDefault()}),o.mousePos(this.element,t)),o.addEventListener(window,"mousemove",this.mousemove),o.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=t=>{this.moveMouse(t,o.mousePos(this.element,t))},this.mouseup=t=>{this.mouseRotate.dragEnd(t),this.mousePitch&&this.mousePitch.dragEnd(t),this.offTemp()},this.touchstart=t=>{1!==t.targetTouches.length?this.reset():(this._startPos=this._lastPos=o.touchPos(this.element,t.targetTouches)[0],this.startTouch(t,this._startPos),o.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),o.addEventListener(window,"touchend",this.touchend))},this.touchmove=t=>{1!==t.targetTouches.length?this.reset():(this._lastPos=o.touchPos(this.element,t.targetTouches)[0],this.moveTouch(t,this._lastPos))},this.touchend=t=>{0===t.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),this.touchRotate.reset(),this.touchPitch&&this.touchPitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10;let i=t.dragRotate._mouseRotate.getClickTolerance(),a=t.dragRotate._mousePitch.getClickTolerance();this.element=r,this.mouseRotate=Jn({clickTolerance:i,enable:!0}),this.touchRotate=(({enable:t,clickTolerance:e,bearingDegreesPerPixelMoved:r=.8})=>{let n=new $n;return new Zn({clickTolerance:e,move:(t,e)=>({bearingDelta:(e.x-t.x)*r}),moveStateManager:n,enable:t,assignEvents:Ni})})({clickTolerance:i,enable:!0}),this.map=t,n&&(this.mousePitch=Qn({clickTolerance:a,enable:!0}),this.touchPitch=(({enable:t,clickTolerance:e,pitchDegreesPerPixelMoved:r=-.5})=>{let n=new $n;return new Zn({clickTolerance:e,move:(t,e)=>({pitchDelta:(e.y-t.y)*r}),moveStateManager:n,enable:t,assignEvents:Ni})})({clickTolerance:a,enable:!0})),o.addEventListener(r,"mousedown",this.mousedown),o.addEventListener(r,"touchstart",this.touchstart,{passive:!1}),o.addEventListener(r,"touchcancel",this.reset)}startMouse(t,e){this.mouseRotate.dragStart(t,e),this.mousePitch&&this.mousePitch.dragStart(t,e),o.disableDrag()}startTouch(t,e){this.touchRotate.dragStart(t,e),this.touchPitch&&this.touchPitch.dragStart(t,e),o.disableDrag()}moveMouse(t,e){let r=this.map,{bearingDelta:n}=this.mouseRotate.dragMove(t,e)||{};if(n&&r.setBearing(r.getBearing()+n),this.mousePitch){let{pitchDelta:n}=this.mousePitch.dragMove(t,e)||{};n&&r.setPitch(r.getPitch()+n)}}moveTouch(t,e){let r=this.map,{bearingDelta:n}=this.touchRotate.dragMove(t,e)||{};if(n&&r.setBearing(r.getBearing()+n),this.touchPitch){let{pitchDelta:n}=this.touchPitch.dragMove(t,e)||{};n&&r.setPitch(r.getPitch()+n)}}off(){let t=this.element;o.removeEventListener(t,"mousedown",this.mousedown),o.removeEventListener(t,"touchstart",this.touchstart,{passive:!1}),o.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),o.removeEventListener(window,"touchend",this.touchend),o.removeEventListener(t,"touchcancel",this.reset),this.offTemp()}offTemp(){o.enableDrag(),o.removeEventListener(window,"mousemove",this.mousemove),o.removeEventListener(window,"mouseup",this.mouseup),o.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),o.removeEventListener(window,"touchend",this.touchend)}}function qi(t,r,n){let i=new e.N(t.lng,t.lat);if(t=new e.N(t.lng,t.lat),r){let i=new e.N(t.lng-360,t.lat),a=new e.N(t.lng+360,t.lat),o=n.locationPoint(t).distSqr(r);n.locationPoint(i).distSqr(r)180;){let e=n.locationPoint(t);if(e.x>=0&&e.y>=0&&e.x<=n.width&&e.y<=n.height)break;t.lng>n.center.lng?t.lng-=360:t.lng+=360}return t.lng!==i.lng&&n.locationPoint(t).y>n.height/2-n.getHorizon()?t:i}let Hi={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function Gi(t,e,r){let n=t.classList;for(let t in Hi)n.remove(`maplibregl-${r}-anchor-${t}`);n.add(`maplibregl-${r}-anchor-${e}`)}class Wi extends e.E{constructor(t){if(super(),this._onKeyPress=t=>{let e=t.code,r=t.charCode||t.keyCode;"Space"!==e&&"Enter"!==e&&32!==r&&13!==r||this.togglePopup()},this._onMapClick=t=>{let e=t.originalEvent.target,r=this._element;this._popup&&(e===r||r.contains(e))&&this.togglePopup()},this._update=t=>{var e;if(!this._map)return;let r=this._map.loaded()&&!this._map.isMoving();("terrain"===t?.type||"render"===t?.type&&!r)&&this._map.once("render",this._update),this._lngLat=this._map.transform.renderWorldCopies?qi(this._lngLat,this._flatPos,this._map.transform):null===(e=this._lngLat)||void 0===e?void 0:e.wrap(),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map.transform.locationPoint(this._lngLat)._add(this._offset));let n="";"viewport"===this._rotationAlignment||"auto"===this._rotationAlignment?n=`rotateZ(${this._rotation}deg)`:"map"===this._rotationAlignment&&(n=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let i="";"viewport"===this._pitchAlignment||"auto"===this._pitchAlignment?i="rotateX(0deg)":"map"===this._pitchAlignment&&(i=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||t&&"moveend"!==t.type||(this._pos=this._pos.round()),o.setTransform(this._element,`${Hi[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${i} ${n}`),a.frameAsync(new AbortController).then((()=>{this._updateOpacity(t&&"moveend"===t.type)})).catch((()=>{}))},this._onMove=t=>{if(!this._isDragging){let e=this._clickTolerance||this._map._clickTolerance;this._isDragging=t.point.dist(this._pointerdownPos)>=e}this._isDragging&&(this._pos=t.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new e.k("dragstart"))),this.fire(new e.k("drag")))},this._onUp=()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),"active"===this._state&&this.fire(new e.k("dragend")),this._state="inactive"},this._addDragHandler=t=>{this._element.contains(t.originalEvent.target)&&(t.preventDefault(),this._positionDelta=t.point.sub(this._pos).add(this._offset),this._pointerdownPos=t.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},this._anchor=t&&t.anchor||"center",this._color=t&&t.color||"#3FB1CE",this._scale=t&&t.scale||1,this._draggable=t&&t.draggable||!1,this._clickTolerance=t&&t.clickTolerance||0,this._subpixelPositioning=t&&t.subpixelPositioning||!1,this._isDragging=!1,this._state="inactive",this._rotation=t&&t.rotation||0,this._rotationAlignment=t&&t.rotationAlignment||"auto",this._pitchAlignment=t&&t.pitchAlignment&&"auto"!==t.pitchAlignment?t.pitchAlignment:this._rotationAlignment,this.setOpacity(),this.setOpacity(t?.opacity,t?.opacityWhenCovered),t&&t.element)this._element=t.element,this._offset=e.P.convert(t&&t.offset||[0,0]);else{this._defaultMarker=!0,this._element=o.create("div");let r=o.createNS("http://www.w3.org/2000/svg","svg"),n=41,i=27;r.setAttributeNS(null,"display","block"),r.setAttributeNS(null,"height",`${n}px`),r.setAttributeNS(null,"width",`${i}px`),r.setAttributeNS(null,"viewBox",`0 0 ${i} ${n}`);let a=o.createNS("http://www.w3.org/2000/svg","g");a.setAttributeNS(null,"stroke","none"),a.setAttributeNS(null,"stroke-width","1"),a.setAttributeNS(null,"fill","none"),a.setAttributeNS(null,"fill-rule","evenodd");let s=o.createNS("http://www.w3.org/2000/svg","g");s.setAttributeNS(null,"fill-rule","nonzero");let l=o.createNS("http://www.w3.org/2000/svg","g");l.setAttributeNS(null,"transform","translate(3.0, 29.0)"),l.setAttributeNS(null,"fill","#000000");let c=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];for(let t of c){let e=o.createNS("http://www.w3.org/2000/svg","ellipse");e.setAttributeNS(null,"opacity","0.04"),e.setAttributeNS(null,"cx","10.5"),e.setAttributeNS(null,"cy","5.80029008"),e.setAttributeNS(null,"rx",t.rx),e.setAttributeNS(null,"ry",t.ry),l.appendChild(e)}let u=o.createNS("http://www.w3.org/2000/svg","g");u.setAttributeNS(null,"fill",this._color);let h=o.createNS("http://www.w3.org/2000/svg","path");h.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),u.appendChild(h);let p=o.createNS("http://www.w3.org/2000/svg","g");p.setAttributeNS(null,"opacity","0.25"),p.setAttributeNS(null,"fill","#000000");let f=o.createNS("http://www.w3.org/2000/svg","path");f.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),p.appendChild(f);let d=o.createNS("http://www.w3.org/2000/svg","g");d.setAttributeNS(null,"transform","translate(6.0, 7.0)"),d.setAttributeNS(null,"fill","#FFFFFF");let m=o.createNS("http://www.w3.org/2000/svg","g");m.setAttributeNS(null,"transform","translate(8.0, 8.0)");let g=o.createNS("http://www.w3.org/2000/svg","circle");g.setAttributeNS(null,"fill","#000000"),g.setAttributeNS(null,"opacity","0.25"),g.setAttributeNS(null,"cx","5.5"),g.setAttributeNS(null,"cy","5.5"),g.setAttributeNS(null,"r","5.4999962");let y=o.createNS("http://www.w3.org/2000/svg","circle");y.setAttributeNS(null,"fill","#FFFFFF"),y.setAttributeNS(null,"cx","5.5"),y.setAttributeNS(null,"cy","5.5"),y.setAttributeNS(null,"r","5.4999962"),m.appendChild(g),m.appendChild(y),s.appendChild(l),s.appendChild(u),s.appendChild(p),s.appendChild(d),s.appendChild(m),r.appendChild(s),r.setAttributeNS(null,"height",n*this._scale+"px"),r.setAttributeNS(null,"width",i*this._scale+"px"),this._element.appendChild(r),this._offset=e.P.convert(t&&t.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",(t=>{t.preventDefault()})),this._element.addEventListener("mousedown",(t=>{t.preventDefault()})),Gi(this._element,this._anchor,"marker"),t&&t.className)for(let e of t.className.split(" "))this._element.classList.add(e);this._popup=null}addTo(t){return this.remove(),this._map=t,this._element.setAttribute("aria-label",t._getUIString("Marker.Title")),t.getCanvasContainer().appendChild(this._element),t.on("move",this._update),t.on("moveend",this._update),t.on("terrain",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("terrain",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),o.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=e.N.convert(t),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(t){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),t){if(!("offset"in t.options)){let e=Math.abs(13.5)/Math.SQRT2;t.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[e,-1*(24.6+e)],"bottom-right":[-e,-1*(24.6+e)],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=t,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}setSubpixelPositioning(t){return this._subpixelPositioning=t,this}getPopup(){return this._popup}togglePopup(){let t=this._popup;return this._element.style.opacity===this._opacityWhenCovered?this:t?(t.isOpen()?t.remove():(t.setLngLat(this._lngLat),t.addTo(this._map)),this):this}_updateOpacity(t=!1){var r,n;if(null===(r=this._map)||void 0===r||!r.terrain)return void(this._element.style.opacity!==this._opacity&&(this._element.style.opacity=this._opacity));if(t)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout((()=>{this._opacityTimeout=null}),100)}let i=this._map,a=i.terrain.depthAtPoint(this._pos),o=i.terrain.getElevationForLngLatZoom(this._lngLat,i.transform.tileZoom);if(i.transform.lngLatToCameraDepth(this._lngLat,o)-a<.006)return void(this._element.style.opacity=this._opacity);let s=-this._offset.y/i.transform._pixelPerMeter,l=Math.sin(i.getPitch()*Math.PI/180)*s,c=i.terrain.depthAtPoint(new e.P(this._pos.x,this._pos.y-this._offset.y)),u=i.transform.lngLatToCameraDepth(this._lngLat,o+l)-c>.006;!(null===(n=this._popup)||void 0===n)&&n.isOpen()&&u&&this._popup.remove(),this._element.style.opacity=u?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(t){return this._offset=e.P.convert(t),this._update(),this}addClassName(t){this._element.classList.add(t)}removeClassName(t){this._element.classList.remove(t)}toggleClassName(t){return this._element.classList.toggle(t)}setDraggable(t){return this._draggable=!!t,this._map&&(t?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(t){return this._rotation=t||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(t){return this._rotationAlignment=t||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(t){return this._pitchAlignment=t&&"auto"!==t?t:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(t,e){return void 0===t&&void 0===e&&(this._opacity="1",this._opacityWhenCovered="0.2"),void 0!==t&&(this._opacity=t),void 0!==e&&(this._opacityWhenCovered=e),this._map&&this._updateOpacity(!0),this}}let Zi={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},Yi=0,Xi=!1,$i={maxWidth:100,unit:"metric"};function Ki(t,e,r){let n=r&&r.maxWidth||100,i=t._container.clientHeight/2,a=t.unproject([0,i]),o=t.unproject([n,i]),s=a.distanceTo(o);if(r&&"imperial"===r.unit){let r=3.2808*s;r>5280?Ji(e,n,r/5280,t._getUIString("ScaleControl.Miles")):Ji(e,n,r,t._getUIString("ScaleControl.Feet"))}else r&&"nautical"===r.unit?Ji(e,n,s/1852,t._getUIString("ScaleControl.NauticalMiles")):s>=1e3?Ji(e,n,s/1e3,t._getUIString("ScaleControl.Kilometers")):Ji(e,n,s,t._getUIString("ScaleControl.Meters"))}function Ji(t,e,r,n){let i=function(t){let e=Math.pow(10,`${Math.floor(t)}`.length-1),r=t/e;return r=r>=10?10:r>=5?5:r>=3?3:r>=2?2:r>=1?1:function(t){let e=Math.pow(10,Math.ceil(-Math.log(t)/Math.LN10));return Math.round(t*e)/e}(r),e*r}(r);t.style.width=e*(i/r)+"px",t.innerHTML=`${i} ${n}`}let Qi={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1},ta=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function ea(t){if(t){if("number"==typeof t){let r=Math.round(Math.abs(t)/Math.SQRT2);return{center:new e.P(0,0),top:new e.P(0,t),"top-left":new e.P(r,r),"top-right":new e.P(-r,r),bottom:new e.P(0,-t),"bottom-left":new e.P(r,-r),"bottom-right":new e.P(-r,-r),left:new e.P(t,0),right:new e.P(-t,0)}}if(t instanceof e.P||Array.isArray(t)){let r=e.P.convert(t);return{center:r,top:r,"top-left":r,"top-right":r,bottom:r,"bottom-left":r,"bottom-right":r,left:r,right:r}}return{center:e.P.convert(t.center||[0,0]),top:e.P.convert(t.top||[0,0]),"top-left":e.P.convert(t["top-left"]||[0,0]),"top-right":e.P.convert(t["top-right"]||[0,0]),bottom:e.P.convert(t.bottom||[0,0]),"bottom-left":e.P.convert(t["bottom-left"]||[0,0]),"bottom-right":e.P.convert(t["bottom-right"]||[0,0]),left:e.P.convert(t.left||[0,0]),right:e.P.convert(t.right||[0,0])}}return ea(new e.P(0,0))}let ra=r;t.AJAXError=e.bh,t.Evented=e.E,t.LngLat=e.N,t.MercatorCoordinate=e.Z,t.Point=e.P,t.addProtocol=e.bi,t.config=e.a,t.removeProtocol=e.bj,t.AttributionControl=Si,t.BoxZoomHandler=Vn,t.CanvasSource=rt,t.CooperativeGesturesHandler=_i,t.DoubleClickZoomHandler=di,t.DragPanHandler=yi,t.DragRotateHandler=vi,t.EdgeInsets=Tn,t.FullscreenControl=class extends e.E{constructor(t={}){super(),this._onFullscreenChange=()=>{var t;let e=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;null!==(t=e?.shadowRoot)&&void 0!==t&&t.fullscreenElement;)e=e.shadowRoot.fullscreenElement;e===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,t&&t.container&&(t.container instanceof HTMLElement?this._container=t.container:e.w("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(t){return this._map=t,this._container||(this._container=this._map.getContainer()),this._controlContainer=o.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){o.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){let t=this._fullscreenButton=o.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);o.create("span","maplibregl-ctrl-icon",t).setAttribute("aria-hidden","true"),t.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){let t=this._getTitle();this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.title=t}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._updateTitle(),this._fullscreen?(this.fire(new e.k("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new e.k("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},t.GeoJSONSource=J,t.GeolocateControl=class extends e.E{constructor(t){super(),this._onSuccess=t=>{if(this._map){if(this._isOutOfMapMaxBounds(t))return this._setErrorState(),this.fire(new e.k("outofmaxbounds",t)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=t,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(t),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(t),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new e.k("geolocate",t)),this._finish()}},this._updateCamera=t=>{let r=new e.N(t.coords.longitude,t.coords.latitude),n=t.coords.accuracy,i=this._map.getBearing(),a=e.e({bearing:i},this.options.fitBoundsOptions),o=Z.fromLngLat(r,n);this._map.fitBounds(o,a,{geolocateSource:!0})},this._updateMarker=t=>{if(t){let r=new e.N(t.coords.longitude,t.coords.latitude);this._accuracyCircleMarker.setLngLat(r).addTo(this._map),this._userLocationDotMarker.setLngLat(r).addTo(this._map),this._accuracy=t.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onZoom=()=>{this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},this._onError=t=>{if(this._map){if(this.options.trackUserLocation)if(1===t.code){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;let t=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===t.code&&Xi)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new e.k("error",t)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",(t=>t.preventDefault())),this._geolocateButton=o.create("button","maplibregl-ctrl-geolocate",this._container),o.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",this._geolocateButton.disabled=!0)},this._finishSetupUI=t=>{if(this._map){if(!1===t){e.w("Geolocation support is not available so the GeolocateControl will be disabled.");let t=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t)}else{let t=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=o.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new Wi({element:this._dotElement}),this._circleElement=o.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Wi({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",(()=>this.trigger())),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",(t=>{t.geolocateSource||"ACTIVE_LOCK"!==this._watchState||t.originalEvent&&"resize"===t.originalEvent.type||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new e.k("trackuserlocationend")),this.fire(new e.k("userlocationlostfocus")))}))}},this.options=e.e({},Zi,t)}onAdd(t){return this._map=t,this._container=o.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),function(){return e._(this,arguments,void 0,(function*(t=!1){if(void 0!==Ri&&!t)return Ri;if(void 0===window.navigator.permissions)return Ri=!!window.navigator.geolocation,Ri;try{Ri="denied"!==(yield window.navigator.permissions.query({name:"geolocation"})).state}catch{Ri=!!window.navigator.geolocation}return Ri}))}().then((t=>this._finishSetupUI(t))),this._container}onRemove(){void 0!==this._geolocationWatchID&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),o.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Yi=0,Xi=!1}_isOutOfMapMaxBounds(t){let e=this._map.getMaxBounds(),r=t.coords;return e&&(r.longitudee.getEast()||r.latitudee.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadius(){let t=this._map.getBounds(),e=t.getSouthEast(),r=t.getNorthEast(),n=e.distanceTo(r),i=Math.ceil(this._accuracy/(n/this._map._container.clientHeight)*2);this._circleElement.style.width=`${i}px`,this._circleElement.style.height=`${i}px`}trigger(){if(!this._setup)return e.w("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new e.k("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Yi--,Xi=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this.fire(new e.k("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new e.k("trackuserlocationstart")),this.fire(new e.k("userlocationfocus"));break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){let t;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),Yi++,Yi>1?(t={maximumAge:6e5,timeout:0},Xi=!0):(t=this.options.positionOptions,Xi=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,t)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},t.Hash=Sn,t.ImageSource=tt,t.KeyboardHandler=ui,t.LngLatBounds=Z,t.LogoControl=Ei,t.Map=class extends ki{constructor(t){e.bf.mark(e.bg.create);let r=Object.assign(Object.assign({},ji),t);if(null!=r.minZoom&&null!=r.maxZoom&&r.minZoom>r.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=r.minPitch&&null!=r.maxPitch&&r.minPitch>r.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=r.minPitch&&r.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=r.maxPitch&&r.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new kn(r.minZoom,r.maxZoom,r.minPitch,r.maxPitch,r.renderWorldCopies),{bearingSnap:r.bearingSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new Ci,this._controls=[],this._mapId=e.a4(),this._contextLost=t=>{t.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.fire(new e.k("webglcontextlost",{originalEvent:t}))},this._contextRestored=t=>{this._setupPainter(),this.resize(),this._update(),this.fire(new e.k("webglcontextrestored",{originalEvent:t}))},this._onMapScroll=t=>{if(t.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=r.interactive,this._maxTileCacheSize=r.maxTileCacheSize,this._maxTileCacheZoomLevels=r.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=!0===r.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=!0===r.preserveDrawingBuffer,this._antialias=!0===r.antialias,this._trackResize=!0===r.trackResize,this._bearingSnap=r.bearingSnap,this._refreshExpiredTiles=!0===r.refreshExpiredTiles,this._fadeDuration=r.fadeDuration,this._crossSourceCollisions=!0===r.crossSourceCollisions,this._collectResourceTiming=!0===r.collectResourceTiming,this._locale=Object.assign(Object.assign({},Fi),r.locale),this._clickTolerance=r.clickTolerance,this._overridePixelRatio=r.pixelRatio,this._maxCanvasSize=r.maxCanvasSize,this.transformCameraUpdate=r.transformCameraUpdate,this.cancelPendingTileRequestsWhileZooming=!0===r.cancelPendingTileRequestsWhileZooming,this._imageQueueHandle=f.addThrottleControl((()=>this.isMoving())),this._requestManager=new d(r.transformRequest),"string"==typeof r.container){if(this._container=document.getElementById(r.container),!this._container)throw new Error(`Container '${r.container}' not found.`)}else{if(!(r.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=r.container}if(r.maxBounds&&this.setMaxBounds(r.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",(()=>this._update(!1))).on("moveend",(()=>this._update(!1))).on("zoom",(()=>this._update(!0))).on("terrain",(()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)})).once("idle",(()=>{this._idleTriggered=!0})),typeof window<"u"){addEventListener("online",this._onWindowOnline,!1);let t=!1,e=Mn((t=>{this._trackResize&&!this._removed&&(this.resize(t),this.redraw())}),50);this._resizeObserver=new ResizeObserver((r=>{t?e(r):t=!0})),this._resizeObserver.observe(this._container)}this.handlers=new Ai(this,r),this._hash=r.hash&&new Sn("string"==typeof r.hash&&r.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:r.center,zoom:r.zoom,bearing:r.bearing,pitch:r.pitch}),r.bounds&&(this.resize(),this.fitBounds(r.bounds,e.e({},r.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=r.localIdeographFontFamily,this._validateStyle=r.validateStyle,r.style&&this.setStyle(r.style,{localIdeographFontFamily:r.localIdeographFontFamily}),r.attributionControl&&this.addControl(new Si("boolean"==typeof r.attributionControl?void 0:r.attributionControl)),r.maplibreLogo&&this.addControl(new Ei,r.logoPosition),this.on("style.load",(()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)})),this.on("data",(t=>{this._update("style"===t.dataType),this.fire(new e.k(`${t.dataType}data`,t))})),this.on("dataloading",(t=>{this.fire(new e.k(`${t.dataType}dataloading`,t))})),this.on("dataabort",(t=>{this.fire(new e.k("sourcedataabort",t))}))}_getMapId(){return this._mapId}addControl(t,r){if(void 0===r&&(r=t.getDefaultPosition?t.getDefaultPosition():"top-right"),!t||!t.onAdd)return this.fire(new e.j(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));let n=t.onAdd(this);this._controls.push(t);let i=this._controlPositions[r];return-1!==r.indexOf("bottom")?i.insertBefore(n,i.firstChild):i.appendChild(n),this}removeControl(t){if(!t||!t.onRemove)return this.fire(new e.j(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));let r=this._controls.indexOf(t);return r>-1&&this._controls.splice(r,1),t.onRemove(this),this}hasControl(t){return this._controls.indexOf(t)>-1}calculateCameraOptionsFromTo(t,e,r,n){return null==n&&this.terrain&&(n=this.terrain.getElevationForLngLatZoom(r,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(t,e,r,n)}resize(t){var r;let n=this._containerDimensions(),i=n[0],a=n[1],o=this._getClampedPixelRatio(i,a);if(this._resizeCanvas(i,a,o),this.painter.resize(i,a,o),this.painter.overLimit()){let t=this.painter.context.gl;this._maxCanvasSize=[t.drawingBufferWidth,t.drawingBufferHeight];let e=this._getClampedPixelRatio(i,a);this._resizeCanvas(i,a,e),this.painter.resize(i,a,e)}this.transform.resize(i,a),null===(r=this._requestedCameraState)||void 0===r||r.resize(i,a);let s=!this._moving;return s&&(this.stop(),this.fire(new e.k("movestart",t)).fire(new e.k("move",t))),this.fire(new e.k("resize",t)),s&&this.fire(new e.k("moveend",t)),this}_getClampedPixelRatio(t,e){let{0:r,1:n}=this._maxCanvasSize,i=this.getPixelRatio(),a=t*i,o=e*i;return Math.min(a>r?r/a:1,o>n?n/o:1)*i}getPixelRatio(){var t;return null!==(t=this._overridePixelRatio)&&void 0!==t?t:devicePixelRatio}setPixelRatio(t){this._overridePixelRatio=t,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(t){return this.transform.setMaxBounds(Z.convert(t)),this._update()}setMinZoom(t){if((t=t??-2)>=-2&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=t,this._update(),this.getZoom()>t&&this.setZoom(t),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(t){if((t=t??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(t>=0&&t<=this.transform.maxPitch)return this.transform.minPitch=t,this._update(),this.getPitch()85)throw new Error("maxPitch must be less than or equal to 85");if(t>=this.transform.minPitch)return this.transform.maxPitch=t,this._update(),this.getPitch()>t&&this.setPitch(t),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(t){return this.transform.renderWorldCopies=t,this._update()}project(t){return this.transform.locationPoint(e.N.convert(t),this.style&&this.terrain)}unproject(t){return this.transform.pointLocation(e.P.convert(t),this.terrain)}isMoving(){var t;return this._moving||(null===(t=this.handlers)||void 0===t?void 0:t.isMoving())}isZooming(){var t;return this._zooming||(null===(t=this.handlers)||void 0===t?void 0:t.isZooming())}isRotating(){var t;return this._rotating||(null===(t=this.handlers)||void 0===t?void 0:t.isRotating())}_createDelegatedListener(t,e,r){if("mouseenter"===t||"mouseover"===t){let n=!1;return{layers:e,listener:r,delegates:{mousemove:i=>{let a=e.filter((t=>this.getLayer(t))),o=0!==a.length?this.queryRenderedFeatures(i.point,{layers:a}):[];o.length?n||(n=!0,r.call(this,new Rn(t,this,i.originalEvent,{features:o}))):n=!1},mouseout:()=>{n=!1}}}}if("mouseleave"===t||"mouseout"===t){let n=!1;return{layers:e,listener:r,delegates:{mousemove:i=>{let a=e.filter((t=>this.getLayer(t)));(0!==a.length?this.queryRenderedFeatures(i.point,{layers:a}):[]).length?n=!0:n&&(n=!1,r.call(this,new Rn(t,this,i.originalEvent)))},mouseout:e=>{n&&(n=!1,r.call(this,new Rn(t,this,e.originalEvent)))}}}}{let n=t=>{let n=e.filter((t=>this.getLayer(t))),i=0!==n.length?this.queryRenderedFeatures(t.point,{layers:n}):[];i.length&&(t.features=i,r.call(this,t),delete t.features)};return{layers:e,listener:r,delegates:{[t]:n}}}}_saveDelegatedListener(t,e){this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[t]=this._delegatedListeners[t]||[],this._delegatedListeners[t].push(e)}_removeDelegatedListener(t,e,r){if(!this._delegatedListeners||!this._delegatedListeners[t])return;let n=this._delegatedListeners[t];for(let t=0;te.includes(t)))){for(let t in i.delegates)this.off(t,i.delegates[t]);return void n.splice(t,1)}}}on(t,e,r){if(void 0===r)return super.on(t,e);let n=this._createDelegatedListener(t,"string"==typeof e?[e]:e,r);this._saveDelegatedListener(t,n);for(let t in n.delegates)this.on(t,n.delegates[t]);return this}once(t,e,r){if(void 0===r)return super.once(t,e);let n="string"==typeof e?[e]:e,i=this._createDelegatedListener(t,n,r);for(let e in i.delegates){let a=i.delegates[e];i.delegates[e]=(...e)=>{this._removeDelegatedListener(t,n,r),a(...e)}}this._saveDelegatedListener(t,i);for(let t in i.delegates)this.once(t,i.delegates[t]);return this}off(t,e,r){return void 0===r?super.off(t,e):(this._removeDelegatedListener(t,"string"==typeof e?[e]:e,r),this)}queryRenderedFeatures(t,r){if(!this.style)return[];let n,i=t instanceof e.P||Array.isArray(t),a=i?t:[[0,0],[this.transform.width,this.transform.height]];if(r=r||(i?{}:t)||{},a instanceof e.P||"number"==typeof a[0])n=[e.P.convert(a)];else{let t=e.P.convert(a[0]),r=e.P.convert(a[1]);n=[t,new e.P(r.x,t.y),r,new e.P(t.x,r.y),t]}return this.style.queryRenderedFeatures(n,r,this.transform)}querySourceFeatures(t,e){return this.style.querySourceFeatures(t,e)}setStyle(t,r){return!1!==(r=e.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},r)).diff&&r.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&t?(this._diffStyle(t,r),this):(this._localIdeographFontFamily=r.localIdeographFontFamily,this._updateStyle(t,r))}setTransformRequest(t){return this._requestManager.setTransformRequest(t),this}_getUIString(t){let e=this._locale[t];if(null==e)throw new Error(`Missing UI string '${t}'`);return e}_updateStyle(t,e){if(e.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",(()=>this._updateStyle(t,e)));let r=this.style&&e.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!t)),t?(this.style=new fe(this,e||{}),this.style.setEventedParent(this,{style:this.style}),"string"==typeof t?this.style.loadURL(t,e,r):this.style.loadJSON(t,e,r),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new fe(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(t,r){if("string"==typeof t){let n=this._requestManager.transformRequest(t,"Style");e.h(n,new AbortController).then((t=>{this._updateDiff(t.data,r)})).catch((t=>{t&&this.fire(new e.j(t))}))}else"object"==typeof t&&this._updateDiff(t,r)}_updateDiff(t,r){try{this.style.setState(t,r)&&this._update(!0)}catch(n){e.w(`Unable to perform style diff: ${n.message||n.error||n}. Rebuilding the style from scratch.`),this._updateStyle(t,r)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():e.w("There is no style added to the map.")}addSource(t,e){return this._lazyInitEmptyStyle(),this.style.addSource(t,e),this._update(!0)}isSourceLoaded(t){let r=this.style&&this.style.sourceCaches[t];if(void 0!==r)return r.loaded();this.fire(new e.j(new Error(`There is no source with ID '${t}'`)))}setTerrain(t){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),t){let r=this.style.sourceCaches[t.source];if(!r)throw new Error(`cannot load terrain, because there exists no source with ID: ${t.source}`);null===this.terrain&&r.reload();for(let r in this.style._layers){let n=this.style._layers[r];"hillshade"===n.type&&n.source===t.source&&e.w("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new Pi(this.painter,r,t),this.painter.renderToTexture=new Oi(this.painter,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._terrainDataCallback=e=>{"style"===e.dataType?this.terrain.sourceCache.freeRtt():"source"===e.dataType&&e.tile&&(e.sourceId!==t.source||this._elevationFreeze||(this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.terrain.sourceCache.freeRtt(e.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform.minElevationForCurrentTile=0,this.transform.elevation=0;return this.fire(new e.k("terrain",{terrain:t})),this}getTerrain(){var t,e;return null!==(e=null===(t=this.terrain)||void 0===t?void 0:t.options)&&void 0!==e?e:null}areTilesLoaded(){let t=this.style&&this.style.sourceCaches;for(let e in t){let r=t[e]._tiles;for(let t in r){let e=r[t];if("loaded"!==e.state&&"errored"!==e.state)return!1}}return!0}removeSource(t){return this.style.removeSource(t),this._update(!0)}getSource(t){return this.style.getSource(t)}addImage(t,r,n={}){let{pixelRatio:i=1,sdf:o=!1,stretchX:s,stretchY:l,content:c,textFitWidth:u,textFitHeight:h}=n;if(this._lazyInitEmptyStyle(),!(r instanceof HTMLImageElement||e.b(r))){if(void 0===r.width||void 0===r.height)return this.fire(new e.j(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));{let{width:n,height:a,data:p}=r,f=r;return this.style.addImage(t,{data:new e.R({width:n,height:a},new Uint8Array(p)),pixelRatio:i,stretchX:s,stretchY:l,content:c,textFitWidth:u,textFitHeight:h,sdf:o,version:0,userImage:f}),f.onAdd&&f.onAdd(this,t),this}}{let{width:n,height:p,data:f}=a.getImageData(r);this.style.addImage(t,{data:new e.R({width:n,height:p},f),pixelRatio:i,stretchX:s,stretchY:l,content:c,textFitWidth:u,textFitHeight:h,sdf:o,version:0})}}updateImage(t,r){let n=this.style.getImage(t);if(!n)return this.fire(new e.j(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));let i=r instanceof HTMLImageElement||e.b(r)?a.getImageData(r):r,{width:o,height:s,data:l}=i;if(void 0===o||void 0===s)return this.fire(new e.j(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(o!==n.data.width||s!==n.data.height)return this.fire(new e.j(new Error("The width and height of the updated image must be that same as the previous version of the image")));let c=!(r instanceof HTMLImageElement||e.b(r));return n.data.replace(l,c),this.style.updateImage(t,n),this}getImage(t){return this.style.getImage(t)}hasImage(t){return t?!!this.style.getImage(t):(this.fire(new e.j(new Error("Missing required image id"))),!1)}removeImage(t){this.style.removeImage(t)}loadImage(t){return f.getImage(this._requestManager.transformRequest(t,"Image"),new AbortController)}listImages(){return this.style.listImages()}addLayer(t,e){return this._lazyInitEmptyStyle(),this.style.addLayer(t,e),this._update(!0)}moveLayer(t,e){return this.style.moveLayer(t,e),this._update(!0)}removeLayer(t){return this.style.removeLayer(t),this._update(!0)}getLayer(t){return this.style.getLayer(t)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(t,e,r){return this.style.setLayerZoomRange(t,e,r),this._update(!0)}setFilter(t,e,r={}){return this.style.setFilter(t,e,r),this._update(!0)}getFilter(t){return this.style.getFilter(t)}setPaintProperty(t,e,r,n={}){return this.style.setPaintProperty(t,e,r,n),this._update(!0)}getPaintProperty(t,e){return this.style.getPaintProperty(t,e)}setLayoutProperty(t,e,r,n={}){return this.style.setLayoutProperty(t,e,r,n),this._update(!0)}getLayoutProperty(t,e){return this.style.getLayoutProperty(t,e)}setGlyphs(t,e={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(t,e),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(t,e,r={}){return this._lazyInitEmptyStyle(),this.style.addSprite(t,e,r,(t=>{t||this._update(!0)})),this}removeSprite(t){return this._lazyInitEmptyStyle(),this.style.removeSprite(t),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(t,e={}){return this._lazyInitEmptyStyle(),this.style.setSprite(t,e,(t=>{t||this._update(!0)})),this}setLight(t,e={}){return this._lazyInitEmptyStyle(),this.style.setLight(t,e),this._update(!0)}getLight(){return this.style.getLight()}setSky(t){return this._lazyInitEmptyStyle(),this.style.setSky(t),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(t,e){return this.style.setFeatureState(t,e),this._update()}removeFeatureState(t,e){return this.style.removeFeatureState(t,e),this._update()}getFeatureState(t){return this.style.getFeatureState(t)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let t=0,e=0;return this._container&&(t=this._container.clientWidth||400,e=this._container.clientHeight||300),[t,e]}_setupContainer(){let t=this._container;t.classList.add("maplibregl-map");let e=this._canvasContainer=o.create("div","maplibregl-canvas-container",t);this._interactive&&e.classList.add("maplibregl-interactive"),this._canvas=o.create("canvas","maplibregl-canvas",e),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex",this._interactive?"0":"-1"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region");let r=this._containerDimensions(),n=this._getClampedPixelRatio(r[0],r[1]);this._resizeCanvas(r[0],r[1],n);let i=this._controlContainer=o.create("div","maplibregl-control-container",t),a=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach((t=>{a[t]=o.create("div",`maplibregl-ctrl-${t} `,i)})),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(t,e,r){this._canvas.width=Math.floor(r*t),this._canvas.height=Math.floor(r*e),this._canvas.style.width=`${t}px`,this._canvas.style.height=`${e}px`}_setupPainter(){let t={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1},e=null;this._canvas.addEventListener("webglcontextcreationerror",(r=>{e={requestedAttributes:t},r&&(e.statusMessage=r.statusMessage,e.type=r.type)}),{once:!0});let r=this._canvas.getContext("webgl2",t)||this._canvas.getContext("webgl",t);if(!r){let t="Failed to initialize WebGL";throw e?(e.message=t,new Error(JSON.stringify(e))):new Error(t)}this.painter=new _n(r,this.transform),c.testSupport(r)}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(t){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||t,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(t){return this._update(),this._renderTaskQueue.add(t)}_cancelRenderFrame(t){this._renderTaskQueue.remove(t)}_render(t){let r=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(t),this._removed)return;let n=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;let t=this.transform.zoom,i=a.now();this.style.zoomHistory.update(t,i);let o=new e.z(t,{now:i,fadeDuration:r,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),s=o.crossFadingFactor();1===s&&s===this._crossFadingFactor||(n=!0,this._crossFadingFactor=s),this.style.update(o)}this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.sourceCache.update(this.transform,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._elevationFreeze||(this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform.minElevationForCurrentTile=0,this.transform.elevation=0),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,r,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:r,showPadding:this.showPadding}),this.fire(new e.k("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,e.bf.mark(e.bg.load),this.fire(new e.k("load"))),this.style&&(this.style.hasTransitions()||n)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();let i=this._sourcesDirty||this._styleDirty||this._placementDirty;return i||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new e.k("idle")),!this._loaded||this._fullyLoaded||i||(this._fullyLoaded=!0,e.bf.mark(e.bg.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var t;this._hash&&this._hash.remove();for(let t of this._controls)t.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&removeEventListener("online",this._onWindowOnline,!1),f.removeThrottleControl(this._imageQueueHandle),null===(t=this._resizeObserver)||void 0===t||t.disconnect();let r=this.painter.context.gl.getExtension("WEBGL_lose_context");r?.loseContext&&r.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),o.remove(this._canvasContainer),o.remove(this._controlContainer),this._container.classList.remove("maplibregl-map"),e.bf.clearMetrics(),this._removed=!0,this.fire(new e.k("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,a.frameAsync(this._frameRequest).then((t=>{e.bf.frame(t),this._frameRequest=null,this._render(t)})).catch((()=>{})))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(t){this._showTileBoundaries!==t&&(this._showTileBoundaries=t,this._update())}get showPadding(){return!!this._showPadding}set showPadding(t){this._showPadding!==t&&(this._showPadding=t,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(t){this._showCollisionBoxes!==t&&(this._showCollisionBoxes=t,t?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(t){this._showOverdrawInspector!==t&&(this._showOverdrawInspector=t,this._update())}get repaint(){return!!this._repaint}set repaint(t){this._repaint!==t&&(this._repaint=t,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(t){this._vertices=t,this._update()}get version(){return Bi}getCameraTargetElevation(){return this.transform.elevation}},t.MapMouseEvent=Rn,t.MapTouchEvent=Fn,t.MapWheelEvent=Bn,t.Marker=Wi,t.NavigationControl=class{constructor(t){this._updateZoomButtons=()=>{let t=this._map.getZoom(),e=t===this._map.getMaxZoom(),r=t===this._map.getMinZoom();this._zoomInButton.disabled=e,this._zoomOutButton.disabled=r,this._zoomInButton.setAttribute("aria-disabled",e.toString()),this._zoomOutButton.setAttribute("aria-disabled",r.toString())},this._rotateCompassArrow=()=>{let t=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${this._map.transform.angle*(180/Math.PI)}deg)`:`rotate(${this._map.transform.angle*(180/Math.PI)}deg)`;this._compassIcon.style.transform=t},this._setButtonTitle=(t,e)=>{let r=this._map._getUIString(`NavigationControl.${e}`);t.title=r,t.setAttribute("aria-label",r)},this.options=e.e({},Ui,t),this._container=o.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",(t=>t.preventDefault())),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",(t=>this._map.zoomIn({},{originalEvent:t}))),o.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",(t=>this._map.zoomOut({},{originalEvent:t}))),o.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",(t=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:t}):this._map.resetNorth({},{originalEvent:t})})),this._compassIcon=o.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(t){return this._map=t,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new Vi(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){o.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(t,e){let r=o.create("button",t,this._container);return r.type="button",r.addEventListener("click",e),r}},t.Popup=class extends e.E{constructor(t){super(),this.remove=()=>(this._content&&o.remove(this._content),this._container&&(o.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new e.k("close"))),this),this._onMouseUp=t=>{this._update(t.point)},this._onMouseMove=t=>{this._update(t.point)},this._onDrag=t=>{this._update(t.point)},this._update=t=>{var e;if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=o.create("div","maplibregl-popup",this._map.getContainer()),this._tip=o.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(let t of this.options.className.split(" "))this._container.classList.add(t);this._closeButton&&this._closeButton.setAttribute("aria-label",this._map._getUIString("Popup.Close")),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._lngLat=this._map.transform.renderWorldCopies&&!this._trackPointer?qi(this._lngLat,this._flatPos,this._map.transform):null===(e=this._lngLat)||void 0===e?void 0:e.wrap(),this._trackPointer&&!t)return;let r=this._flatPos=this._pos=this._trackPointer&&t?t:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&t?t:this._map.transform.locationPoint(this._lngLat));let n=this.options.anchor,i=ea(this.options.offset);if(!n){let t,e=this._container.offsetWidth,a=this._container.offsetHeight;t=r.y+i.bottom.ythis._map.transform.height-a?["bottom"]:[],r.xthis._map.transform.width-e/2&&t.push("right"),n=0===t.length?"bottom":t.join("-")}let a=r.add(i[n]);this.options.subpixelPositioning||(a=a.round()),o.setTransform(this._container,`${Hi[n]} translate(${a.x}px,${a.y}px)`),Gi(this._container,n,"popup")},this._onClose=()=>{this.remove()},this.options=e.e(Object.create(Qi),t)}addTo(t){return this._map&&this.remove(),this._map=t,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new e.k("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=e.N.convert(t),this._pos=null,this._flatPos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._flatPos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(t){return this.setDOMContent(document.createTextNode(t))}setHTML(t){let e,r=document.createDocumentFragment(),n=document.createElement("body");for(n.innerHTML=t;e=n.firstChild,e;)r.appendChild(e);return this.setDOMContent(r)}getMaxWidth(){var t;return null===(t=this._container)||void 0===t?void 0:t.style.maxWidth}setMaxWidth(t){return this.options.maxWidth=t,this._update(),this}setDOMContent(t){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=o.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(t),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(t){return this._container&&this._container.classList.add(t),this}removeClassName(t){return this._container&&this._container.classList.remove(t),this}setOffset(t){return this.options.offset=t,this._update(),this}toggleClassName(t){if(this._container)return this._container.classList.toggle(t)}setSubpixelPositioning(t){this.options.subpixelPositioning=t}_createCloseButton(){this.options.closeButton&&(this._closeButton=o.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;let t=this._container.querySelector(ta);t&&t.focus()}},t.RasterDEMTileSource=K,t.RasterTileSource=$,t.ScaleControl=class{constructor(t){this._onMove=()=>{Ki(this._map,this._container,this.options)},this.setUnit=t=>{this.options.unit=t,Ki(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},$i),t)}getDefaultPosition(){return"bottom-left"}onAdd(t){return this._map=t,this._container=o.create("div","maplibregl-ctrl maplibregl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){o.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},t.ScrollZoomHandler=fi,t.Style=fe,t.TerrainControl=class{constructor(t){this._toggleTerrain=()=>{this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()},this._updateTerrainIcon=()=>{this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.Disable")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.Enable"))},this.options=t}onAdd(t){return this._map=t,this._container=o.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=o.create("button","maplibregl-ctrl-terrain",this._container),o.create("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.type="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){o.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},t.TwoFingersTouchPitchHandler=li,t.TwoFingersTouchRotateHandler=oi,t.TwoFingersTouchZoomHandler=ii,t.TwoFingersTouchZoomRotateHandler=xi,t.VectorTileSource=X,t.VideoSource=et,t.addSourceType=(t,r)=>e._(void 0,void 0,void 0,(function*(){if(it(t))throw new Error(`A source type called "${t}" already exists.`);var e;e=r,nt[t]=e})),t.clearPrewarmedResources=function(){let t=F;t&&(t.isPreloaded()&&1===t.numActive()?(t.release(O),F=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},t.getMaxParallelImageRequests=function(){return e.a.MAX_PARALLEL_IMAGE_REQUESTS},t.getRTLTextPluginStatus=function(){return lt().getRTLTextPluginStatus()},t.getVersion=function(){return ra},t.getWorkerCount=function(){return R.workerCount},t.getWorkerUrl=function(){return e.a.WORKER_URL},t.importScriptInWorkers=function(t){return V().broadcast("IS",t)},t.prewarm=function(){N().acquire(O)},t.setMaxParallelImageRequests=function(t){e.a.MAX_PARALLEL_IMAGE_REQUESTS=t},t.setRTLTextPlugin=function(t,e){return lt().setRTLTextPlugin(t,e)},t.setWorkerCount=function(t){R.workerCount=t},t.setWorkerUrl=function(t){e.a.WORKER_URL=t}})),t},"object"==typeof t&&typeof e<"u"?e.exports=a():(n=typeof globalThis<"u"?globalThis:n||self).maplibregl=a()}}),nb=f({"src/plots/map/layers.js"(t,e){var r=le(),n=Se().sanitizeHTML,i=$_(),a=H_();function o(t,e){this.subplot=t,this.uid=t.uid+"-"+e,this.index=e,this.idSource="source-"+this.uid,this.idLayer=a.layoutLayerPrefix+this.uid,this.sourceType=null,this.source=null,this.layerType=null,this.below=null,this.visible=!1}var s=o.prototype;function l(t){if(!t.visible)return!1;var e=t.source;if(Array.isArray(e)&&e.length>0){for(var n=0;n0}function c(t){var e={},n={};switch(t.type){case"circle":r.extendFlat(n,{"circle-radius":t.circle.radius,"circle-color":t.color,"circle-opacity":t.opacity});break;case"line":r.extendFlat(n,{"line-width":t.line.width,"line-color":t.color,"line-opacity":t.opacity,"line-dasharray":t.line.dash});break;case"fill":r.extendFlat(n,{"fill-color":t.color,"fill-outline-color":t.fill.outlinecolor,"fill-opacity":t.opacity});break;case"symbol":var a=t.symbol,o=i(a.textposition,a.iconsize);r.extendFlat(e,{"icon-image":a.icon+"-15","icon-size":a.iconsize/10,"text-field":a.text,"text-size":a.textfont.size,"text-anchor":o.anchor,"text-offset":o.offset,"symbol-placement":a.placement}),r.extendFlat(n,{"icon-color":t.color,"text-color":a.textfont.color,"text-opacity":t.opacity});break;case"raster":r.extendFlat(n,{"raster-fade-duration":0,"raster-opacity":t.opacity})}return{layout:e,paint:n}}s.update=function(t){this.visible?this.needsNewImage(t)?this.updateImage(t):this.needsNewSource(t)?(this.removeLayer(),this.updateSource(t),this.updateLayer(t)):this.needsNewLayer(t)?this.updateLayer(t):this.updateStyle(t):(this.updateSource(t),this.updateLayer(t)),this.visible=l(t)},s.needsNewImage=function(t){return this.subplot.map.getSource(this.idSource)&&"image"===this.sourceType&&"image"===t.sourcetype&&(this.source!==t.source||JSON.stringify(this.coordinates)!==JSON.stringify(t.coordinates))},s.needsNewSource=function(t){return this.sourceType!==t.sourcetype||JSON.stringify(this.source)!==JSON.stringify(t.source)||this.layerType!==t.type},s.needsNewLayer=function(t){return this.layerType!==t.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},s.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},s.updateImage=function(t){this.subplot.map.getSource(this.idSource).updateImage({url:t.source,coordinates:t.coordinates});var e=this.findFollowingMapLayerId(this.lookupBelow());null!==e&&this.subplot.map.moveLayer(this.idLayer,e)},s.updateSource=function(t){var e=this.subplot.map;if(e.getSource(this.idSource)&&e.removeSource(this.idSource),this.sourceType=t.sourcetype,this.source=t.source,l(t)){var r=function(t){var e,r=t.sourcetype,i=t.source,a={type:r};return"geojson"===r?e="data":"vector"===r?e="string"==typeof i?"url":"tiles":"raster"===r?(e="tiles",a.tileSize=256):"image"===r&&(e="url",a.coordinates=t.coordinates),a[e]=i,t.sourceattribution&&(a.attribution=n(t.sourceattribution)),a}(t);e.addSource(this.idSource,r)}},s.findFollowingMapLayerId=function(t){if("traces"===t)for(var e=this.subplot.getMapLayers(),r=0;r1)for(r=0;r-1&&m(e.originalEvent,n,[r.xaxis],[r.yaxis],r.id,t),i.indexOf("event")>-1&&l.click(n,e.originalEvent)}}},x.updateFx=function(t){var e=this,r=e.map,i=e.gd;if(!e.isStatic){var a,o=t.dragmode;a=function(t,r){r.isRect?(t.range={})[e.id]=[c([r.xmin,r.ymin]),c([r.xmax,r.ymax])]:(t.lassoPoints={})[e.id]=r.map(c)};var l=e.dragOptions;e.dragOptions=n.extendDeep(l||{},{dragmode:t.dragmode,element:e.div,gd:i,plotinfo:{id:e.id,domain:t[e.id].domain,xaxis:e.xaxis,yaxis:e.yaxis,fillRangeItems:a},xaxes:[e.xaxis],yaxes:[e.yaxis],subplot:e.id}),r.off("click",e.onClickInPanHandler),h(o)||u(o)?(r.dragPan.disable(),r.on("zoomstart",e.clearOutline),e.dragOptions.prepFn=function(t,r,n){p(t,r,n,e.dragOptions,o)},s.init(e.dragOptions)):(r.dragPan.enable(),r.off("zoomstart",e.clearOutline),e.div.onmousedown=null,e.div.ontouchstart=null,e.div.removeEventListener("touchstart",e.div._ontouchstart),e.onClickInPanHandler=e.onClickInPanFn(e.dragOptions),r.on("click",e.onClickInPanHandler))}function c(t){var r=e.map.unproject(t);return[r.lng,r.lat]}},x.updateFramework=function(t){var e=t[this.id].domain,r=t._size,n=this.div.style;n.width=r.w*(e.x[1]-e.x[0])+"px",n.height=r.h*(e.y[1]-e.y[0])+"px",n.left=r.l+e.x[0]*r.w+"px",n.top=r.t+(1-e.y[1])*r.h+"px",this.xaxis._offset=r.l+e.x[0]*r.w,this.xaxis._length=r.w*(e.x[1]-e.x[0]),this.yaxis._offset=r.t+(1-e.y[1])*r.h,this.yaxis._length=r.h*(e.y[1]-e.y[0])},x.updateLayers=function(t){var e,r=t[this.id].layers,n=this.layerList;if(r.length!==n.length){for(e=0;ex/2){var _=m.split("|").join("
");y.text(_).attr("data-unformatted",_).call(l.convertToTspans,t),v=s.bBox(y.node())}y.attr("transform",r(-3,8-v.height)),g.insert("rect",".static-attribution").attr({x:-v.width-6,y:-v.height-3,width:v.width+6,height:v.height+3,fill:"rgba(255, 255, 255, 0.75)"});var b=1;v.width+6>x&&(b=x/(v.width+6));var w=[c.l+c.w*f.x[1],c.t+c.h*(1-f.y[0])];g.attr("transform",r(w[0],w[1])+n(b))}},t.updateFx=function(t){for(var e=t._fullLayout,r=e._subplots[u],n=0;n=0;r--)t.removeLayer(e[r][1])},o.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},e.exports=function(t,e){var n=e[0].trace,i=new a(t,n.uid),o=i.sourceId,s=r(e),l=i.below=t.belowLookup["trace-"+n.uid];return t.map.addSource(o,{type:"geojson",data:s.geojson}),i._addLayers(s,l),e[0].trace._glTrace=i,i}}}),fb=f({"src/traces/choroplethmap/index.js"(t,e){e.exports={attributes:cb(),supplyDefaults:ub(),colorbar:Uo(),calc:_g(),plot:pb(),hoverPoints:Tg(),eventData:Ag(),selectPoints:kg(),styleOnSelect:function(t,e){e&&e[0].trace._glTrace.updateOnSelect(e)},getBelow:function(t,e){for(var r=e.getMapLayers(),n=r.length-2;n>=0;n--){var i=r[n].id;if("string"==typeof i&&0===i.indexOf("water"))for(var a=n+1;a0?+f[u]:0),h.push({type:"Feature",geometry:{type:"Point",coordinates:y},properties:v})}}var _=a.extractOpts(e),b=_.reversescale?a.flipScale(_.colorscale):_.colorscale,w=b[0][1],T=["interpolate",["linear"],["heatmap-density"],0,i.opacity(w)<1?w:i.addOpacity(w,0)];for(u=1;u=0;r--)t.removeLayer(e[r][1])},a.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},e.exports=function(t,e){var n=e[0].trace,a=new i(t,n.uid),o=a.sourceId,s=r(e),l=a.below=t.belowLookup["trace-"+n.uid];return t.map.addSource(o,{type:"geojson",data:s.geojson}),a._addLayers(s,l),a}}}),_b=f({"src/traces/densitymap/hover.js"(t,e){var r=ir(),n=Q_().hoverPoints,i=Q_().getExtraText;e.exports=function(t,e,a){var o=n(t,e,a);if(o){var s=o[0],l=s.cd,c=l[0].trace,u=l[s.index];if(delete s.color,"z"in u){var h=s.subplot.mockAxis;s.z=u.z,s.zLabel=r.tickText(h,h.c2l(u.z),"hover").text}return s.extraText=i(c,u,l[0].t.labels),[s]}}}}),bb=f({"src/traces/densitymap/event_data.js"(t,e){e.exports=function(t,e){return t.lon=e.lon,t.lat=e.lat,t.z=e.z,t}}}),wb=f({"src/traces/densitymap/index.js"(t,e){e.exports={attributes:mb(),supplyDefaults:gb(),colorbar:Uo(),formatLabels:X_(),calc:yb(),plot:xb(),hoverPoints:_b(),eventData:bb(),getBelow:function(t,e){for(var r=e.getMapLayers(),n=0;n0;){e=c[c.length-1];var f=t[e];if(a[e]=0&&s[e].push(o[m])}a[e]=d}else{if(n[e]===r[e]){var g=[],y=[],v=0;for(d=l.length-1;d>=0;--d){var x=l[d];if(i[x]=!1,g.push(x),y.push(s[x]),v+=s[x].length,o[x]=h.length,x===e){l.length=d;break}}h.push(g);var _=new Array(v);for(d=0;dx&&(x=l.source[e]),l.target[e]>x&&(x=l.target[e]);var _=x+1;t.node._count=_;var b,w=t.node.groups,T={};for(e=0;e0&&o(C,_)&&o(I,_)&&(!T.hasOwnProperty(C)||!T.hasOwnProperty(I)||T[C]!==T[I])){T.hasOwnProperty(I)&&(I=T[I]),T.hasOwnProperty(C)&&(C=T[C]),I=+I,f[C=+C]=f[I]=!0;var L="";l.label&&l.label[e]&&(L=l.label[e]);var P=null;L&&d.hasOwnProperty(L)&&(P=d[L]),c.push({pointNumber:e,label:L,color:u?l.color[e]:l.color,hovercolor:h?l.hovercolor[e]:l.hovercolor,customdata:p?l.customdata[e]:l.customdata,concentrationscale:P,source:C,target:I,value:+E}),S.source.push(C),S.target.push(I)}}var z=_+w.length,D=a(i.color),O=a(i.customdata),R=[];for(e=0;e_-1,childrenNodes:[],pointNumber:e,label:F,color:D?i.color[e]:i.color,customdata:O?i.customdata[e]:i.customdata})}var B=!1;return function(t,e,i){for(var a=n.init2dArray(t,0),o=0;o1}))}(z,S.source,S.target)&&(B=!0),{circular:B,links:c,nodes:R,groups:w,groupLookup:T}}(e);return i({circular:l.circular,_nodes:l.nodes,_links:l.links,_groups:l.groups,_groupLookup:l.groupLookup})}}}),Eb=f({"node_modules/d3-quadtree/dist/d3-quadtree.js"(t,e){var r,n;r=t,n=function(t){function e(t,e,r,n){if(isNaN(e)||isNaN(r))return t;var i,a,o,s,l,c,u,h,p,f=t._root,d={data:n},m=t._x0,g=t._y0,y=t._x1,v=t._y1;if(!f)return t._root=d,t;for(;f.length;)if((c=e>=(a=(m+y)/2))?m=a:y=a,(u=r>=(o=(g+v)/2))?g=o:v=o,i=f,!(f=f[h=u<<1|c]))return i[h]=d,t;if(s=+t._x.call(null,f.data),l=+t._y.call(null,f.data),e===s&&r===l)return d.next=f,i?i[h]=d:t._root=d,t;do{i=i?i[h]=new Array(4):t._root=new Array(4),(c=e>=(a=(m+y)/2))?m=a:y=a,(u=r>=(o=(g+v)/2))?g=o:v=o}while((h=u<<1|c)==(p=(l>=o)<<1|s>=a));return i[p]=f,i[h]=d,t}function r(t,e,r,n,i){this.node=t,this.x0=e,this.y0=r,this.x1=n,this.y1=i}function n(t){return t[0]}function i(t){return t[1]}function a(t,e,r){var a=new o(e??n,r??i,NaN,NaN,NaN,NaN);return null==t?a:a.addAll(t)}function o(t,e,r,n,i,a){this._x=t,this._y=e,this._x0=r,this._y0=n,this._x1=i,this._y1=a,this._root=void 0}function s(t){for(var e={data:t.data},r=e;t=t.next;)r=r.next={data:t.data};return e}var l=a.prototype=o.prototype;l.copy=function(){var t,e,r=new o(this._x,this._y,this._x0,this._y0,this._x1,this._y1),n=this._root;if(!n)return r;if(!n.length)return r._root=s(n),r;for(t=[{source:n,target:r._root=new Array(4)}];n=t.pop();)for(var i=0;i<4;++i)(e=n.source[i])&&(e.length?t.push({source:e,target:n.target[i]=new Array(4)}):n.target[i]=s(e));return r},l.add=function(t){var r=+this._x.call(null,t),n=+this._y.call(null,t);return e(this.cover(r,n),r,n,t)},l.addAll=function(t){var r,n,i,a,o=t.length,s=new Array(o),l=new Array(o),c=1/0,u=1/0,h=-1/0,p=-1/0;for(n=0;nh&&(h=i),ap&&(p=a));if(c>h||u>p)return this;for(this.cover(c,u).cover(h,p),n=0;nt||t>=i||n>e||e>=a;)switch(s=(ef||(o=c.y0)>d||(s=c.x1)=v)<<1|t>=y)&&(c=m[m.length-1],m[m.length-1]=m[m.length-1-u],m[m.length-1-u]=c)}else{var x=t-+this._x.call(null,g.data),_=e-+this._y.call(null,g.data),b=x*x+_*_;if(b=(s=(d+g)/2))?d=s:g=s,(u=o>=(l=(m+y)/2))?m=l:y=l,e=f,!(f=f[h=u<<1|c]))return this;if(!f.length)break;(e[h+1&3]||e[h+2&3]||e[h+3&3])&&(r=e,p=h)}for(;f.data!==t;)if(n=f,!(f=f.next))return this;return(i=f.next)&&delete f.next,n?(i?n.next=i:delete n.next,this):e?(i?e[h]=i:delete e[h],(f=e[0]||e[1]||e[2]||e[3])&&f===(e[3]||e[2]||e[1]||e[0])&&!f.length&&(r?r[p]=f:this._root=f),this):(this._root=i,this)},l.removeAll=function(t){for(var e=0,r=t.length;e=l.length)return null!=t&&r.sort(t),null!=e?e(r):r;for(var s,c,h,p=-1,f=r.length,d=l[i++],m=n(),g=a();++pl.length)return t;var n,i=c[r-1];return null!=e&&r>=l.length?n=t.entries():(n=[],t.each((function(t,e){n.push({key:e,values:h(t,r)})}))),null!=i?n.sort((function(t,e){return i(t.key,e.key)})):n}return r={object:function(t){return u(t,0,i,a)},map:function(t){return u(t,0,o,s)},entries:function(t){return h(u(t,0,o,s),0)},key:function(t){return l.push(t),r},sortKeys:function(t){return c[l.length-1]=t,r},sortValues:function(e){return t=e,r},rollup:function(t){return e=t,r}}},t.set=u,t.map=n,t.keys=function(t){var e=[];for(var r in t)e.push(r);return e},t.values=function(t){var e=[];for(var r in t)e.push(t[r]);return e},t.entries=function(t){var e=[];for(var r in t)e.push({key:r,value:t[r]});return e},Object.defineProperty(t,"__esModule",{value:!0})}("object"==typeof t&&typeof e<"u"?t:r.d3=r.d3||{})}}),Ib=f({"node_modules/d3-dispatch/dist/d3-dispatch.js"(t,e){var r,n;r=t,n=function(t){var e={value:function(){}};function r(){for(var t,e=0,r=arguments.length,i={};e=0&&(r=t.slice(n+1),t=t.slice(0,n)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:r}}))}(t+"",n),s=-1,l=o.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++s0)for(var r,n,i=new Array(r),a=0;a=0&&r._call.call(null,t),r=r._next;--n}function g(){s=(o=c.now())+l,n=i=0;try{m()}finally{n=0,function(){for(var t,n,i=e,a=1/0;i;)i._call?(a>i._time&&(a=i._time),t=i,i=i._next):(n=i._next,i._next=null,i=t?t._next=n:e=n);r=t,v(a)}(),s=0}}function y(){var t=c.now(),e=t-o;e>1e3&&(l-=e,o=t)}function v(t){n||(i&&(i=clearTimeout(i)),t-s>24?(t<1/0&&(i=setTimeout(g,t-c.now()-l)),a&&(a=clearInterval(a))):(a||(o=c.now(),a=setInterval(y,1e3)),n=1,u(g)))}f.prototype=d.prototype={constructor:f,restart:function(t,n,i){if("function"!=typeof t)throw new TypeError("callback is not a function");i=(null==i?h():+i)+(null==n?0:+n),!this._next&&r!==this&&(r?r._next=this:e=this,r=this),this._call=t,this._time=i,v()},stop:function(){this._call&&(this._call=null,this._time=1/0,v())}},t.interval=function(t,e,r){var n=new f,i=e;return null==e?(n.restart(t,e,r),n):(e=+e,r=null==r?h():+r,n.restart((function a(o){o+=i,n.restart(a,i+=e,r),t(o)}),e,r),n)},t.now=h,t.timeout=function(t,e,r){var n=new f;return e=null==e?0:+e,n.restart((function(r){n.stop(),t(r+e)}),e,r),n},t.timer=d,t.timerFlush=m,Object.defineProperty(t,"__esModule",{value:!0})},n("object"==typeof t&&typeof e<"u"?t:(r=r||self).d3=r.d3||{})}}),Pb=f({"node_modules/d3-force/dist/d3-force.js"(t,e){var r,n;r=t,n=function(t,e,r,n,i){function a(t){return function(){return t}}function o(){return 1e-6*(Math.random()-.5)}function s(t){return t.x+t.vx}function l(t){return t.y+t.vy}function c(t){return t.index}function u(t,e){var r=t.get(e);if(!r)throw new Error("missing: "+e);return r}function h(t){return t.x}function p(t){return t.y}var f=Math.PI*(3-Math.sqrt(5));t.forceCenter=function(t,e){var r;function n(){var n,i,a=r.length,o=0,s=0;for(n=0;np+c||nf+c||au.index){var h=p-s.x-s.vx,g=f-s.y-s.vy,y=h*h+g*g;yt.r&&(t.r=t[e].r)}function p(){if(r){var e,i,a=r.length;for(n=new Array(a),e=0;e=c)){(t.data!==r||t.next)&&(0===h&&(d+=(h=o())*h),0===p&&(d+=(p=o())*p),d1?(null==r?u.remove(t):u.set(t,y(r)),e):u.get(t)},find:function(e,r,n){var i,a,o,s,l,c=0,u=t.length;for(null==n?n=1/0:n*=n,c=0;c1?(p.on(t,r),e):p.on(t)}}},t.forceX=function(t){var e,r,n,i=a(.1);function o(t){for(var i,a=0,o=e.length;an)if(Math.abs(p*c-u*h)>n&&o){var d=i-s,m=a-l,g=c*c+u*u,y=d*d+m*m,v=Math.sqrt(g),x=Math.sqrt(f),_=o*Math.tan((e-Math.acos((g+f-y)/(2*v*x)))/2),b=_/x,w=_/v;Math.abs(b-1)>n&&(this._+="L"+(t+b*h)+","+(r+b*p)),this._+="A"+o+","+o+",0,0,"+ +(p*d>h*m)+","+(this._x1=t+w*c)+","+(this._y1=r+w*u)}else this._+="L"+(this._x1=t)+","+(this._y1=r)},arc:function(t,a,o,s,l,c){t=+t,a=+a,c=!!c;var u=(o=+o)*Math.cos(s),h=o*Math.sin(s),p=t+u,f=a+h,d=1^c,m=c?s-l:l-s;if(o<0)throw new Error("negative radius: "+o);null===this._x1?this._+="M"+p+","+f:(Math.abs(this._x1-p)>n||Math.abs(this._y1-f)>n)&&(this._+="L"+p+","+f),o&&(m<0&&(m=m%r+r),m>i?this._+="A"+o+","+o+",0,1,"+d+","+(t-u)+","+(a-h)+"A"+o+","+o+",0,1,"+d+","+(this._x1=p)+","+(this._y1=f):m>n&&(this._+="A"+o+","+o+",0,"+ +(m>=e)+","+d+","+(this._x1=t+o*Math.cos(l))+","+(this._y1=a+o*Math.sin(l))))},rect:function(t,e,r,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +r+"v"+ +n+"h"+-r+"Z"},toString:function(){return this._}},t.path=o,Object.defineProperty(t,"__esModule",{value:!0})},n("object"==typeof t&&typeof e<"u"?t:(r=r||self).d3=r.d3||{})}}),Db=f({"node_modules/d3-shape/dist/d3-shape.js"(t,e){var r,n;r=t,n=function(t,e){function r(t){return function(){return t}}var n=Math.abs,i=Math.atan2,a=Math.cos,o=Math.max,s=Math.min,l=Math.sin,c=Math.sqrt,u=1e-12,h=Math.PI,p=h/2,f=2*h;function d(t){return t>=1?p:t<=-1?-p:Math.asin(t)}function m(t){return t.innerRadius}function g(t){return t.outerRadius}function y(t){return t.startAngle}function v(t){return t.endAngle}function x(t){return t&&t.padAngle}function _(t,e,r,n,i,a,s){var l=t-r,u=e-n,h=(s?a:-a)/c(l*l+u*u),p=h*u,f=-h*l,d=t+p,m=e+f,g=r+p,y=n+f,v=(d+g)/2,x=(m+y)/2,_=g-d,b=y-m,w=_*_+b*b,T=i-a,A=d*y-g*m,k=(b<0?-1:1)*c(o(0,T*T*w-A*A)),M=(A*b-_*k)/w,S=(-A*_-b*k)/w,E=(A*b+_*k)/w,C=(-A*_+b*k)/w,I=M-v,L=S-x,P=E-v,z=C-x;return I*I+L*L>P*P+z*z&&(M=E,S=C),{cx:M,cy:S,x01:-p,y01:-f,x11:M*(i/T-1),y11:S*(i/T-1)}}function b(t){this._context=t}function w(t){return new b(t)}function T(t){return t[0]}function A(t){return t[1]}function k(){var t=T,n=A,i=r(!0),a=null,o=w,s=null;function l(r){var l,c,u,h=r.length,p=!1;for(null==a&&(s=o(u=e.path())),l=0;l<=h;++l)!(l=h;--p)c.point(y[p],v[p]);c.lineEnd(),c.areaEnd()}g&&(y[u]=+t(f,u,r),v[u]=+i(f,u,r),c.point(n?+n(f,u,r):y[u],a?+a(f,u,r):v[u]))}if(d)return c=null,d+""||null}function h(){return k().defined(o).curve(l).context(s)}return u.x=function(e){return arguments.length?(t="function"==typeof e?e:r(+e),n=null,u):t},u.x0=function(e){return arguments.length?(t="function"==typeof e?e:r(+e),u):t},u.x1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:r(+t),u):n},u.y=function(t){return arguments.length?(i="function"==typeof t?t:r(+t),a=null,u):i},u.y0=function(t){return arguments.length?(i="function"==typeof t?t:r(+t),u):i},u.y1=function(t){return arguments.length?(a=null==t?null:"function"==typeof t?t:r(+t),u):a},u.lineX0=u.lineY0=function(){return h().x(t).y(i)},u.lineY1=function(){return h().x(t).y(a)},u.lineX1=function(){return h().x(n).y(i)},u.defined=function(t){return arguments.length?(o="function"==typeof t?t:r(!!t),u):o},u.curve=function(t){return arguments.length?(l=t,null!=s&&(c=l(s)),u):l},u.context=function(t){return arguments.length?(null==t?s=c=null:c=l(s=t),u):s},u}function S(t,e){return et?1:e>=t?0:NaN}function E(t){return t}b.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 C=L(w);function I(t){this._curve=t}function L(t){function e(e){return new I(t(e))}return e._curve=t,e}function P(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(L(t)):e()._curve},t}function z(){return P(k().curve(C))}function D(){var t=M().curve(C),e=t.curve,r=t.lineX0,n=t.lineX1,i=t.lineY0,a=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 P(r())},delete t.lineX0,t.lineEndAngle=function(){return P(n())},delete t.lineX1,t.lineInnerRadius=function(){return P(i())},delete t.lineY0,t.lineOuterRadius=function(){return P(a())},delete t.lineY1,t.curve=function(t){return arguments.length?e(L(t)):e()._curve},t}function O(t,e){return[(e=+e)*Math.cos(t-=Math.PI/2),e*Math.sin(t)]}I.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))}};var R=Array.prototype.slice;function F(t){return t.source}function B(t){return t.target}function j(t){var n=F,i=B,a=T,o=A,s=null;function l(){var r,l=R.call(arguments),c=n.apply(this,l),u=i.apply(this,l);if(s||(s=r=e.path()),t(s,+a.apply(this,(l[0]=c,l)),+o.apply(this,l),+a.apply(this,(l[0]=u,l)),+o.apply(this,l)),r)return s=null,r+""||null}return l.source=function(t){return arguments.length?(n=t,l):n},l.target=function(t){return arguments.length?(i=t,l):i},l.x=function(t){return arguments.length?(a="function"==typeof t?t:r(+t),l):a},l.y=function(t){return arguments.length?(o="function"==typeof t?t:r(+t),l):o},l.context=function(t){return arguments.length?(s=t??null,l):s},l}function N(t,e,r,n,i){t.moveTo(e,r),t.bezierCurveTo(e=(e+n)/2,r,e,i,n,i)}function U(t,e,r,n,i){t.moveTo(e,r),t.bezierCurveTo(e,r=(r+i)/2,n,r,n,i)}function V(t,e,r,n,i){var a=O(e,r),o=O(e,r=(r+i)/2),s=O(n,r),l=O(n,i);t.moveTo(a[0],a[1]),t.bezierCurveTo(o[0],o[1],s[0],s[1],l[0],l[1])}var q={draw:function(t,e){var r=Math.sqrt(e/h);t.moveTo(r,0),t.arc(0,0,r,0,f)}},H={draw:function(t,e){var r=Math.sqrt(e/5)/2;t.moveTo(-3*r,-r),t.lineTo(-r,-r),t.lineTo(-r,-3*r),t.lineTo(r,-3*r),t.lineTo(r,-r),t.lineTo(3*r,-r),t.lineTo(3*r,r),t.lineTo(r,r),t.lineTo(r,3*r),t.lineTo(-r,3*r),t.lineTo(-r,r),t.lineTo(-3*r,r),t.closePath()}},G=Math.sqrt(1/3),W=2*G,Z={draw:function(t,e){var r=Math.sqrt(e/W),n=r*G;t.moveTo(0,-r),t.lineTo(n,0),t.lineTo(0,r),t.lineTo(-n,0),t.closePath()}},Y=Math.sin(h/10)/Math.sin(7*h/10),X=Math.sin(f/10)*Y,$=-Math.cos(f/10)*Y,K={draw:function(t,e){var r=Math.sqrt(.8908130915292852*e),n=X*r,i=$*r;t.moveTo(0,-r),t.lineTo(n,i);for(var a=1;a<5;++a){var o=f*a/5,s=Math.cos(o),l=Math.sin(o);t.lineTo(l*r,-s*r),t.lineTo(s*n-l*i,l*n+s*i)}t.closePath()}},J={draw:function(t,e){var r=Math.sqrt(e),n=-r/2;t.rect(n,n,r,r)}},Q=Math.sqrt(3),tt={draw:function(t,e){var r=-Math.sqrt(e/(3*Q));t.moveTo(0,2*r),t.lineTo(-Q*r,-r),t.lineTo(Q*r,-r),t.closePath()}},et=-.5,rt=Math.sqrt(3)/2,nt=1/Math.sqrt(12),it=3*(nt/2+1),at={draw:function(t,e){var r=Math.sqrt(e/it),n=r/2,i=r*nt,a=n,o=r*nt+r,s=-a,l=o;t.moveTo(n,i),t.lineTo(a,o),t.lineTo(s,l),t.lineTo(et*n-rt*i,rt*n+et*i),t.lineTo(et*a-rt*o,rt*a+et*o),t.lineTo(et*s-rt*l,rt*s+et*l),t.lineTo(et*n+rt*i,et*i-rt*n),t.lineTo(et*a+rt*o,et*o-rt*a),t.lineTo(et*s+rt*l,et*l-rt*s),t.closePath()}},ot=[q,H,Z,J,K,tt,at];function st(){}function lt(t,e,r){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+r)/6)}function ct(t){this._context=t}function ut(t){this._context=t}function ht(t){this._context=t}function pt(t,e){this._basis=new ct(t),this._beta=e}ct.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:lt(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:lt(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},ut.prototype={areaStart:st,areaEnd:st,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:lt(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},ht.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 r=(this._x0+4*this._x1+t)/6,n=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:lt(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},pt.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,r=t.length-1;if(r>0)for(var n,i=t[0],a=e[0],o=t[r]-i,s=e[r]-a,l=-1;++l<=r;)n=l/r,this._basis.point(this._beta*t[l]+(1-this._beta)*(i+n*o),this._beta*e[l]+(1-this._beta)*(a+n*s));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};var ft=function t(e){function r(t){return 1===e?new ct(t):new pt(t,e)}return r.beta=function(e){return t(+e)},r}(.85);function dt(t,e,r){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-r),t._x2,t._y2)}function mt(t,e){this._context=t,this._k=(1-e)/6}mt.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:dt(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:dt(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}};var gt=function t(e){function r(t){return new mt(t,e)}return r.tension=function(e){return t(+e)},r}(0);function yt(t,e){this._context=t,this._k=(1-e)/6}yt.prototype={areaStart:st,areaEnd:st,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:dt(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}};var vt=function t(e){function r(t){return new yt(t,e)}return r.tension=function(e){return t(+e)},r}(0);function xt(t,e){this._context=t,this._k=(1-e)/6}xt.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:dt(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}};var _t=function t(e){function r(t){return new xt(t,e)}return r.tension=function(e){return t(+e)},r}(0);function bt(t,e,r){var n=t._x1,i=t._y1,a=t._x2,o=t._y2;if(t._l01_a>u){var s=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);n=(n*s-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,i=(i*s-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>u){var c=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,h=3*t._l23_a*(t._l23_a+t._l12_a);a=(a*c+t._x1*t._l23_2a-e*t._l12_2a)/h,o=(o*c+t._y1*t._l23_2a-r*t._l12_2a)/h}t._context.bezierCurveTo(n,i,a,o,t._x2,t._y2)}function wt(t,e){this._context=t,this._alpha=e}wt.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 r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,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:bt(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}};var Tt=function t(e){function r(t){return e?new wt(t,e):new mt(t,0)}return r.alpha=function(e){return t(+e)},r}(.5);function At(t,e){this._context=t,this._alpha=e}At.prototype={areaStart:st,areaEnd:st,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 r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,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:bt(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}};var kt=function t(e){function r(t){return e?new At(t,e):new yt(t,0)}return r.alpha=function(e){return t(+e)},r}(.5);function Mt(t,e){this._context=t,this._alpha=e}Mt.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 r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,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:bt(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}};var St=function t(e){function r(t){return e?new Mt(t,e):new xt(t,0)}return r.alpha=function(e){return t(+e)},r}(.5);function Et(t){this._context=t}function Ct(t){return t<0?-1:1}function It(t,e,r){var n=t._x1-t._x0,i=e-t._x1,a=(t._y1-t._y0)/(n||i<0&&-0),o=(r-t._y1)/(i||n<0&&-0),s=(a*i+o*n)/(n+i);return(Ct(a)+Ct(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function Lt(t,e){var r=t._x1-t._x0;return r?(3*(t._y1-t._y0)/r-e)/2:e}function Pt(t,e,r){var n=t._x0,i=t._y0,a=t._x1,o=t._y1,s=(a-n)/3;t._context.bezierCurveTo(n+s,i+s*e,a-s,o-s*r,a,o)}function zt(t){this._context=t}function Dt(t){this._context=new Ot(t)}function Ot(t){this._context=t}function Rt(t){this._context=t}function Ft(t){var e,r,n=t.length-1,i=new Array(n),a=new Array(n),o=new Array(n);for(i[0]=0,a[0]=2,o[0]=t[0]+2*t[1],e=1;e=0;--e)i[e]=(o[e]-i[e+1])/a[e];for(a[n-1]=(t[n]+i[n-1])/2,e=0;e1)for(var r,n,i,a=1,o=t[e[0]],s=o.length;a=0;)r[e]=e;return r}function Ut(t,e){return t[e]}function Vt(t){var e=t.map(qt);return Nt(t).sort((function(t,r){return e[t]-e[r]}))}function qt(t){for(var e,r=-1,n=0,i=t.length,a=-1/0;++ra&&(a=e,n=r);return n}function Ht(t){var e=t.map(Gt);return Nt(t).sort((function(t,r){return e[t]-e[r]}))}function Gt(t){for(var e,r=0,n=-1,i=t.length;++n=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 r=this._x*(1-this._t)+t*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,e)}}this._x=t,this._y=e}},t.arc=function(){var t=m,o=g,b=r(0),w=null,T=y,A=v,k=x,M=null;function S(){var r,m,g=+t.apply(this,arguments),y=+o.apply(this,arguments),v=T.apply(this,arguments)-p,x=A.apply(this,arguments)-p,S=n(x-v),E=x>v;if(M||(M=r=e.path()),yu)if(S>f-u)M.moveTo(y*a(v),y*l(v)),M.arc(0,0,y,v,x,!E),g>u&&(M.moveTo(g*a(x),g*l(x)),M.arc(0,0,g,x,v,E));else{var C,I,L=v,P=x,z=v,D=x,O=S,R=S,F=k.apply(this,arguments)/2,B=F>u&&(w?+w.apply(this,arguments):c(g*g+y*y)),j=s(n(y-g)/2,+b.apply(this,arguments)),N=j,U=j;if(B>u){var V=d(B/g*l(F)),q=d(B/y*l(F));(O-=2*V)>u?(z+=V*=E?1:-1,D-=V):(O=0,z=D=(v+x)/2),(R-=2*q)>u?(L+=q*=E?1:-1,P-=q):(R=0,L=P=(v+x)/2)}var H=y*a(L),G=y*l(L),W=g*a(D),Z=g*l(D);if(j>u){var Y,X=y*a(P),$=y*l(P),K=g*a(z),J=g*l(z);if(S1?0:t<-1?h:Math.acos(t)}((Q*et+tt*rt)/(c(Q*Q+tt*tt)*c(et*et+rt*rt)))/2),it=c(Y[0]*Y[0]+Y[1]*Y[1]);N=s(j,(g-it)/(nt-1)),U=s(j,(y-it)/(nt+1))}}R>u?U>u?(C=_(K,J,H,G,y,U,E),I=_(X,$,W,Z,y,U,E),M.moveTo(C.cx+C.x01,C.cy+C.y01),Uu&&O>u?N>u?(C=_(W,Z,X,$,g,-N,E),I=_(H,G,K,J,g,-N,E),M.lineTo(C.cx+C.x01,C.cy+C.y01),N0&&(d+=h);for(null!=e?m.sort((function(t,r){return e(g[t],g[r])})):null!=n&&m.sort((function(t,e){return n(r[t],r[e])})),s=0,c=d?(v-p*_)/d:0;s0?h*c:0)+_,g[l]={data:r[l],index:s,value:h,startAngle:y,endAngle:u,padAngle:x};return g}return s.value=function(e){return arguments.length?(t="function"==typeof e?e:r(+e),s):t},s.sortValues=function(t){return arguments.length?(e=t,n=null,s):e},s.sort=function(t){return arguments.length?(n=t,e=null,s):n},s.startAngle=function(t){return arguments.length?(i="function"==typeof t?t:r(+t),s):i},s.endAngle=function(t){return arguments.length?(a="function"==typeof t?t:r(+t),s):a},s.padAngle=function(t){return arguments.length?(o="function"==typeof t?t:r(+t),s):o},s},t.pointRadial=O,t.radialArea=D,t.radialLine=z,t.stack=function(){var t=r([]),e=Nt,n=jt,i=Ut;function a(r){var a,o,s=t.apply(this,arguments),l=r.length,c=s.length,u=new Array(c);for(a=0;a0)for(var r,n,i,a,o,s,l=0,c=t[e[0]].length;l0?(n[0]=a,n[1]=a+=i):i<0?(n[1]=o,n[0]=o+=i):(n[0]=0,n[1]=i)},t.stackOffsetExpand=function(t,e){if((n=t.length)>0){for(var r,n,i,a=0,o=t[0].length;a0){for(var r,n=0,i=t[e[0]],a=i.length;n0&&(n=(r=t[e[0]]).length)>0){for(var r,n,i,a=0,o=1;oa&&(_=a);var o=e.min(i,(function(t){return(v-n-(t.length-1)*_)/e.sum(t,u)}));i.forEach((function(t){t.forEach((function(t,e){t.y1=(t.y0=e)+t.value*o}))})),t.links.forEach((function(t){t.width=t.value*o}))})(),d();for(var a=1,o=k;o>0;--o)l(a*=.99),d(),s(a),d();function s(t){i.forEach((function(r){r.forEach((function(r){if(r.targetLinks.length){var n=(e.sum(r.targetLinks,p)/e.sum(r.targetLinks,u)-h(r))*t;r.y0+=n,r.y1+=n}}))}))}function l(t){i.slice().reverse().forEach((function(r){r.forEach((function(r){if(r.sourceLinks.length){var n=(e.sum(r.sourceLinks,f)/e.sum(r.sourceLinks,u)-h(r))*t;r.y0+=n,r.y1+=n}}))}))}function d(){i.forEach((function(t){var e,r,i,a=n,o=t.length;for(t.sort(c),i=0;i0&&(e.y0+=r,e.y1+=r),a=e.y1+_;if((r=a-_-v)>0)for(a=e.y0-=r,e.y1-=r,i=o-2;i>=0;--i)(r=(e=t[i]).y1+_-a)>0&&(e.y0-=r,e.y1-=r),a=e.y0}))}}(a),E(a),a}function E(t){t.nodes.forEach((function(t){t.sourceLinks.sort(l),t.targetLinks.sort(s)})),t.nodes.forEach((function(t){var e=t.y0,r=e;t.sourceLinks.forEach((function(t){t.y0=e+t.width/2,e+=t.width})),t.targetLinks.forEach((function(t){t.y1=r+t.width/2,r+=t.width}))}))}return S.update=function(t){return E(t),t},S.nodeId=function(t){return arguments.length?(b="function"==typeof t?t:o(t),S):b},S.nodeAlign=function(t){return arguments.length?(w="function"==typeof t?t:o(t),S):w},S.nodeWidth=function(t){return arguments.length?(x=+t,S):x},S.nodePadding=function(t){return arguments.length?(_=+t,S):_},S.nodes=function(t){return arguments.length?(T="function"==typeof t?t:o(t),S):T},S.links=function(t){return arguments.length?(A="function"==typeof t?t:o(t),S):A},S.size=function(e){return arguments.length?(t=n=0,i=+e[0],v=+e[1],S):[i-t,v-n]},S.extent=function(e){return arguments.length?(t=+e[0][0],i=+e[1][0],n=+e[0][1],v=+e[1][1],S):[[t,n],[i,v]]},S.iterations=function(t){return arguments.length?(k=+t,S):k},S},t.sankeyCenter=function(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?e.min(t.sourceLinks,i)-1:0},t.sankeyLeft=function(t){return t.depth},t.sankeyRight=function(t,e){return e-1-t.height},t.sankeyJustify=a,t.sankeyLinkHorizontal=function(){return n.linkHorizontal().source(v).target(x)},Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof t&&typeof e<"u"?n(t,lg(),Cb(),Db()):n(r.d3=r.d3||{},r.d3,r.d3,r.d3)}}),Rb=f({"node_modules/elementary-circuits-directed-graph/johnson.js"(t,e){var r=Mb();e.exports=function(t,e){var n,i=[],a=[],o=[],s={},l=[];function c(t){o[t]=!1,s.hasOwnProperty(t)&&Object.keys(s[t]).forEach((function(e){delete s[t][e],o[e]&&c(e)}))}function u(t){var e,r,i=!1;for(a.push(t),o[t]=!0,e=0;e=e}))}(e);for(var n,i=r(t).components.filter((function(t){return t.length>1})),a=1/0,o=0;oe.source.column)}function M(t,e){var r=0;t.sourceLinks.forEach((function(t){r=t.circular&&!W(t,e)?r+1:r}));var n=0;return t.targetLinks.forEach((function(t){n=t.circular&&!W(t,e)?n+1:n})),r+n}function S(t){var e=t.source.sourceLinks,r=0;e.forEach((function(t){r=t.circular?r+1:r}));var n=t.target.targetLinks,i=0;return n.forEach((function(t){i=t.circular?i+1:i})),!(r>1||i>1)}function E(t,e,r){return t.sort(I),t.forEach((function(n,i){var a=0;if(W(n,r)&&S(n))n.circularPathData.verticalBuffer=a+n.width/2;else{for(var o=0;oa?s:a}n.circularPathData.verticalBuffer=a+n.width/2}})),t}function C(t,r,i,a){var o=e.min(t.links,(function(t){return t.source.y0}));t.links.forEach((function(t){t.circular&&(t.circularPathData={})})),E(t.links.filter((function(t){return"top"==t.circularLinkType})),r,a),E(t.links.filter((function(t){return"bottom"==t.circularLinkType})),r,a),t.links.forEach((function(e){if(e.circular){if(e.circularPathData.arcRadius=e.width+w,e.circularPathData.leftNodeBuffer=5,e.circularPathData.rightNodeBuffer=5,e.circularPathData.sourceWidth=e.source.x1-e.source.x0,e.circularPathData.sourceX=e.source.x0+e.circularPathData.sourceWidth,e.circularPathData.targetX=e.target.x0,e.circularPathData.sourceY=e.y0,e.circularPathData.targetY=e.y1,W(e,a)&&S(e))e.circularPathData.leftSmallArcRadius=w+e.width/2,e.circularPathData.leftLargeArcRadius=w+e.width/2,e.circularPathData.rightSmallArcRadius=w+e.width/2,e.circularPathData.rightLargeArcRadius=w+e.width/2,"bottom"==e.circularLinkType?(e.circularPathData.verticalFullExtent=e.source.y1+b+e.circularPathData.verticalBuffer,e.circularPathData.verticalLeftInnerExtent=e.circularPathData.verticalFullExtent-e.circularPathData.leftLargeArcRadius,e.circularPathData.verticalRightInnerExtent=e.circularPathData.verticalFullExtent-e.circularPathData.rightLargeArcRadius):(e.circularPathData.verticalFullExtent=e.source.y0-b-e.circularPathData.verticalBuffer,e.circularPathData.verticalLeftInnerExtent=e.circularPathData.verticalFullExtent+e.circularPathData.leftLargeArcRadius,e.circularPathData.verticalRightInnerExtent=e.circularPathData.verticalFullExtent+e.circularPathData.rightLargeArcRadius);else{var s=e.source.column,l=e.circularLinkType,c=t.links.filter((function(t){return t.source.column==s&&t.circularLinkType==l}));"bottom"==e.circularLinkType?c.sort(P):c.sort(L);var u=0;c.forEach((function(t,n){t.circularLinkID==e.circularLinkID&&(e.circularPathData.leftSmallArcRadius=w+e.width/2+u,e.circularPathData.leftLargeArcRadius=w+e.width/2+n*r+u),u+=t.width})),s=e.target.column,c=t.links.filter((function(t){return t.target.column==s&&t.circularLinkType==l})),"bottom"==e.circularLinkType?c.sort(D):c.sort(z),u=0,c.forEach((function(t,n){t.circularLinkID==e.circularLinkID&&(e.circularPathData.rightSmallArcRadius=w+e.width/2+u,e.circularPathData.rightLargeArcRadius=w+e.width/2+n*r+u),u+=t.width})),"bottom"==e.circularLinkType?(e.circularPathData.verticalFullExtent=Math.max(i,e.source.y1,e.target.y1)+b+e.circularPathData.verticalBuffer,e.circularPathData.verticalLeftInnerExtent=e.circularPathData.verticalFullExtent-e.circularPathData.leftLargeArcRadius,e.circularPathData.verticalRightInnerExtent=e.circularPathData.verticalFullExtent-e.circularPathData.rightLargeArcRadius):(e.circularPathData.verticalFullExtent=o-b-e.circularPathData.verticalBuffer,e.circularPathData.verticalLeftInnerExtent=e.circularPathData.verticalFullExtent+e.circularPathData.leftLargeArcRadius,e.circularPathData.verticalRightInnerExtent=e.circularPathData.verticalFullExtent+e.circularPathData.rightLargeArcRadius)}e.circularPathData.leftInnerExtent=e.circularPathData.sourceX+e.circularPathData.leftNodeBuffer,e.circularPathData.rightInnerExtent=e.circularPathData.targetX-e.circularPathData.rightNodeBuffer,e.circularPathData.leftFullExtent=e.circularPathData.sourceX+e.circularPathData.leftLargeArcRadius+e.circularPathData.leftNodeBuffer,e.circularPathData.rightFullExtent=e.circularPathData.targetX-e.circularPathData.rightLargeArcRadius-e.circularPathData.rightNodeBuffer}if(e.circular)e.path=function(t){return"top"==t.circularLinkType?"M"+t.circularPathData.sourceX+" "+t.circularPathData.sourceY+" L"+t.circularPathData.leftInnerExtent+" "+t.circularPathData.sourceY+" A"+t.circularPathData.leftLargeArcRadius+" "+t.circularPathData.leftSmallArcRadius+" 0 0 0 "+t.circularPathData.leftFullExtent+" "+(t.circularPathData.sourceY-t.circularPathData.leftSmallArcRadius)+" L"+t.circularPathData.leftFullExtent+" "+t.circularPathData.verticalLeftInnerExtent+" A"+t.circularPathData.leftLargeArcRadius+" "+t.circularPathData.leftLargeArcRadius+" 0 0 0 "+t.circularPathData.leftInnerExtent+" "+t.circularPathData.verticalFullExtent+" L"+t.circularPathData.rightInnerExtent+" "+t.circularPathData.verticalFullExtent+" A"+t.circularPathData.rightLargeArcRadius+" "+t.circularPathData.rightLargeArcRadius+" 0 0 0 "+t.circularPathData.rightFullExtent+" "+t.circularPathData.verticalRightInnerExtent+" L"+t.circularPathData.rightFullExtent+" "+(t.circularPathData.targetY-t.circularPathData.rightSmallArcRadius)+" A"+t.circularPathData.rightLargeArcRadius+" "+t.circularPathData.rightSmallArcRadius+" 0 0 0 "+t.circularPathData.rightInnerExtent+" "+t.circularPathData.targetY+" L"+t.circularPathData.targetX+" "+t.circularPathData.targetY:"M"+t.circularPathData.sourceX+" "+t.circularPathData.sourceY+" L"+t.circularPathData.leftInnerExtent+" "+t.circularPathData.sourceY+" A"+t.circularPathData.leftLargeArcRadius+" "+t.circularPathData.leftSmallArcRadius+" 0 0 1 "+t.circularPathData.leftFullExtent+" "+(t.circularPathData.sourceY+t.circularPathData.leftSmallArcRadius)+" L"+t.circularPathData.leftFullExtent+" "+t.circularPathData.verticalLeftInnerExtent+" A"+t.circularPathData.leftLargeArcRadius+" "+t.circularPathData.leftLargeArcRadius+" 0 0 1 "+t.circularPathData.leftInnerExtent+" "+t.circularPathData.verticalFullExtent+" L"+t.circularPathData.rightInnerExtent+" "+t.circularPathData.verticalFullExtent+" A"+t.circularPathData.rightLargeArcRadius+" "+t.circularPathData.rightLargeArcRadius+" 0 0 1 "+t.circularPathData.rightFullExtent+" "+t.circularPathData.verticalRightInnerExtent+" L"+t.circularPathData.rightFullExtent+" "+(t.circularPathData.targetY+t.circularPathData.rightSmallArcRadius)+" A"+t.circularPathData.rightLargeArcRadius+" "+t.circularPathData.rightSmallArcRadius+" 0 0 1 "+t.circularPathData.rightInnerExtent+" "+t.circularPathData.targetY+" L"+t.circularPathData.targetX+" "+t.circularPathData.targetY}(e);else{var h=n.linkHorizontal().source((function(t){return[t.source.x0+(t.source.x1-t.source.x0),t.y0]})).target((function(t){return[t.target.x0,t.y1]}));e.path=h(e)}}))}function I(t,e){return O(t)==O(e)?"bottom"==t.circularLinkType?P(t,e):L(t,e):O(e)-O(t)}function L(t,e){return t.y0-e.y0}function P(t,e){return e.y0-t.y0}function z(t,e){return t.y1-e.y1}function D(t,e){return e.y1-t.y1}function O(t){return t.target.column-t.source.column}function R(t){return t.target.x0-t.source.x1}function F(t,e){var r=A(t),n=R(e)/Math.tan(r);return"up"==G(t)?t.y1+n:t.y1-n}function B(t,e){var r=A(t),n=R(e)/Math.tan(r);return"up"==G(t)?t.y1-n:t.y1+n}function j(t,e,r,n){t.links.forEach((function(i){if(!i.circular&&i.target.column-i.source.column>1){var a=i.source.column+1,o=i.target.column-1,s=1,l=o-a+1;for(s=1;a<=o;a++,s++)t.nodes.forEach((function(o){if(o.column==a){var c,u=s/(l+1),h=Math.pow(1-u,3),p=3*u*Math.pow(1-u,2),f=3*Math.pow(u,2)*(1-u),d=Math.pow(u,3),m=h*i.y0+p*i.y0+f*i.y1+d*i.y1,g=m-i.width/2,y=m+i.width/2;g>o.y0&&go.y0&&yo.y1)&&(c=y-o.y0+10,o=U(o,c,e,r),t.nodes.forEach((function(t){_(t,n)==_(o,n)||t.column!=o.column||t.y0o.y1&&U(t,c,e,r)})))}}))}}))}function N(t,e){return t.y0>e.y0&&t.y0e.y0&&t.y1e.y1}function U(t,e,r,n){return t.y0+e>=r&&t.y1+e<=n&&(t.y0=t.y0+e,t.y1=t.y1+e,t.targetLinks.forEach((function(t){t.y1=t.y1+e})),t.sourceLinks.forEach((function(t){t.y0=t.y0+e}))),t}function V(t,e,r,n){t.nodes.forEach((function(i){n&&i.y+(i.y1-i.y0)>e&&(i.y=i.y-(i.y+(i.y1-i.y0)-e));var a=t.links.filter((function(t){return _(t.source,r)==_(i,r)})),o=a.length;o>1&&a.sort((function(t,e){if(!t.circular&&!e.circular){if(t.target.column==e.target.column)return t.y1-e.y1;if(!H(t,e))return t.y1-e.y1;if(t.target.column>e.target.column){var r=B(e,t);return t.y1-r}if(e.target.column>t.target.column)return B(t,e)-e.y1}return t.circular&&!e.circular?"top"==t.circularLinkType?-1:1:e.circular&&!t.circular?"top"==e.circularLinkType?1:-1:t.circular&&e.circular?t.circularLinkType===e.circularLinkType&&"top"==t.circularLinkType?t.target.column===e.target.column?t.target.y1-e.target.y1:e.target.column-t.target.column:t.circularLinkType===e.circularLinkType&&"bottom"==t.circularLinkType?t.target.column===e.target.column?e.target.y1-t.target.y1:t.target.column-e.target.column:"top"==t.circularLinkType?-1:1:void 0}));var s=i.y0;a.forEach((function(t){t.y0=s+t.width/2,s+=t.width})),a.forEach((function(t,e){if("bottom"==t.circularLinkType){for(var r=e+1,n=0;r1&&n.sort((function(t,e){if(!t.circular&&!e.circular){if(t.source.column==e.source.column)return t.y0-e.y0;if(!H(t,e))return t.y0-e.y0;if(e.source.column0?"up":"down"}function W(t,e){return _(t.source,e)==_(t.target,e)}t.sankeyCircular=function(){var t,n,a=0,_=0,A=1,k=1,S=24,E=g,I=o,L=y,P=v,z=32,D=2,O=null;function R(){var o={nodes:L.apply(null,arguments),links:P.apply(null,arguments)};(function(t){t.nodes.forEach((function(t,e){t.index=e,t.sourceLinks=[],t.targetLinks=[]}));var e=r.map(t.nodes,E);t.links.forEach((function(t,r){t.index=r;var n=t.source,i=t.target;"object"!==(typeof n>"u"?"undefined":l(n))&&(n=t.source=x(e,n)),"object"!==(typeof i>"u"?"undefined":l(i))&&(i=t.target=x(e,i)),n.sourceLinks.push(t),i.targetLinks.push(t)}))})(o),function(t,e,r){var n=0;if(null===r){for(var a=[],o=0;o0?r+b+w:r,bottom:n=n>0?n+b+w:n,left:a=a>0?a+b+w:a,right:i=i>0?i+b+w:i}}(i),u=function(t,r){var n=e.max(t.nodes,(function(t){return t.column})),i=A-a,o=k-_,s=i/(i+r.right+r.left),l=o/(o+r.top+r.bottom);return a=a*s+r.left,A=0==r.right?A:A*s,_=_*l+r.top,k*=l,t.nodes.forEach((function(t){t.x0=a+t.column*((A-a-S)/n),t.x1=t.x0+S})),l}(i,c);s*=u,i.links.forEach((function(t){t.width=t.value*s})),l.forEach((function(t){var e=t.length;t.forEach((function(t,n){t.depth==l.length-1&&1==e||0==t.depth&&1==e?(t.y0=k/2-t.value*s,t.y1=t.y0+t.value*s):t.partOfCycle?0==M(t,r)?(t.y0=k/2+n,t.y1=t.y0+t.value*s):"top"==t.circularLinkType?(t.y0=_+n,t.y1=t.y0+t.value*s):(t.y0=k-t.value*s-n,t.y1=t.y0+t.value*s):0==c.top||0==c.bottom?(t.y0=(k-_)/e*n,t.y1=t.y0+t.value*s):(t.y0=(k-_)/2-e/2+n,t.y1=t.y0+t.value*s)}))}))})(s),y();for(var c=1,u=o;u>0;--u)g(c*=.99,s),y();function g(t,r){var n=l.length;l.forEach((function(i){var a=i.length,o=i[0].depth;i.forEach((function(i){var s;if((i.sourceLinks.length||i.targetLinks.length)&&!(i.partOfCycle&&M(i,r)>0))if(0==o&&1==a)s=i.y1-i.y0,i.y0=k/2-s/2,i.y1=k/2+s/2;else if(o==n-1&&1==a)s=i.y1-i.y0,i.y0=k/2-s/2,i.y1=k/2+s/2;else{var l=e.mean(i.sourceLinks,m),c=e.mean(i.targetLinks,d),u=((l&&c?(l+c)/2:l||c)-f(i))*t;i.y0+=u,i.y1+=u}}))}))}function y(){l.forEach((function(e){var r,n,i,a=_,o=e.length;for(e.sort(h),i=0;i0&&(r.y0+=n,r.y1+=n),a=r.y1+t;if((n=a-t-k)>0)for(a=r.y0-=n,r.y1-=n,i=o-2;i>=0;--i)(n=(r=e[i]).y1+t-a)>0&&(r.y0-=n,r.y1-=n),a=r.y0}))}}(o,z,E),F(o);for(var s=0;s<4;s++)V(o,k,E),q(o,0,E),j(o,_,k,E),V(o,k,E),q(o,0,E);return function(t,r,n){var i=t.nodes,a=t.links,o=!1,s=!1;if(a.forEach((function(t){"top"==t.circularLinkType?o=!0:"bottom"==t.circularLinkType&&(s=!0)})),0==o||0==s){var l=e.min(i,(function(t){return t.y0})),c=e.max(i,(function(t){return t.y1})),u=(n-r)/(c-l);i.forEach((function(t){var e=(t.y1-t.y0)*u;t.y0=(t.y0-l)*u,t.y1=t.y0+e})),a.forEach((function(t){t.y0=(t.y0-l)*u,t.y1=(t.y1-l)*u,t.width=t.width*u}))}}(o,_,k),C(o,D,k,E),o}function F(t){t.nodes.forEach((function(t){t.sourceLinks.sort(u),t.targetLinks.sort(c)})),t.nodes.forEach((function(t){var e=t.y0,r=e,n=t.y1,i=n;t.sourceLinks.forEach((function(t){t.circular?(t.y0=n-t.width/2,n-=t.width):(t.y0=e+t.width/2,e+=t.width)})),t.targetLinks.forEach((function(t){t.circular?(t.y1=i-t.width/2,i-=t.width):(t.y1=r+t.width/2,r+=t.width)}))}))}return R.nodeId=function(t){return arguments.length?(E="function"==typeof t?t:s(t),R):E},R.nodeAlign=function(t){return arguments.length?(I="function"==typeof t?t:s(t),R):I},R.nodeWidth=function(t){return arguments.length?(S=+t,R):S},R.nodePadding=function(e){return arguments.length?(t=+e,R):t},R.nodes=function(t){return arguments.length?(L="function"==typeof t?t:s(t),R):L},R.links=function(t){return arguments.length?(P="function"==typeof t?t:s(t),R):P},R.size=function(t){return arguments.length?(a=_=0,A=+t[0],k=+t[1],R):[A-a,k-_]},R.extent=function(t){return arguments.length?(a=+t[0][0],A=+t[1][0],_=+t[0][1],k=+t[1][1],R):[[a,_],[A,k]]},R.iterations=function(t){return arguments.length?(z=+t,R):z},R.circularLinkGap=function(t){return arguments.length?(D=+t,R):D},R.nodePaddingRatio=function(t){return arguments.length?(n=+t,R):n},R.sortNodes=function(t){return arguments.length?(O=t,R):O},R.update=function(t){return T(t,E),F(t),t.links.forEach((function(t){t.circular&&(t.circularLinkType=t.y0+t.y1o+d&&(a+=1,e=s.x0),o=s.x0,i[a]||(i[a]=[]),i[a].push(s),r=e-s.x0,s.x0+=r,s.x1+=r}return i})(x=k.nodes).forEach((function(t){var e,r,n,i=0,a=t.length;for(t.sort((function(t,e){return t.y0-e.y0})),n=0;n=i||(r=i-e.y0)>1e-6&&(e.y0+=r,e.y1+=r),i=e.y1+f}));n.update(k)}return{circular:b,key:r,trace:c,guid:h.randstr(),horizontal:p,width:g,height:y,nodePad:c.node.pad,nodeLineColor:c.node.line.color,nodeLineWidth:c.node.line.width,linkLineColor:c.link.line.color,linkLineWidth:c.link.line.width,linkArrowLength:c.link.arrowlen,valueFormat:c.valueformat,valueSuffix:c.valuesuffix,textFont:c.textfont,translateX:u.x[0]*t.width+t.margin.l,translateY:t.height-u.y[1]*t.height+t.margin.t,dragParallel:p?y:g,dragPerpendicular:p?g:y,arrangement:c.arrangement,sankey:n,graph:k,forceLayouts:{},interactionState:{dragInProgress:!1,hovered:!1}}}function M(t,e,r){var n=l(e.color),i=l(e.hovercolor),a=e.source.label+"|"+e.target.label+"__"+r;return e.trace=t.trace,e.curveNumber=t.trace.index,{circular:t.circular,key:a,traceId:t.key,pointNumber:e.pointNumber,link:e,tinyColorHue:c.tinyRGB(n),tinyColorAlpha:n.getAlpha(),tinyColorHoverHue:c.tinyRGB(i),tinyColorHoverAlpha:i.getAlpha(),linkPath:S,linkLineColor:t.linkLineColor,linkLineWidth:t.linkLineWidth,linkArrowLength:t.linkArrowLength,valueFormat:t.valueFormat,valueSuffix:t.valueSuffix,sankey:t.sankey,parent:t,interactionState:t.interactionState,flow:e.flow}}function S(){return function(t){var e=t.linkArrowLength;if(t.link.circular)return function(t,e){var r="",n=t.width/2,i=t.circularPathData,a=i.sourceX+i.verticalBuffer0?" L "+i.targetX+" "+i.targetY:"")+"Z"):(r="M "+(i.targetX-e)+" "+(i.targetY-n)+" L "+(i.rightInnerExtent-e)+" "+(i.targetY-n)+" A "+(i.rightLargeArcRadius+n)+" "+(i.rightSmallArcRadius+n)+" 0 0 0 "+(i.rightFullExtent-n-e)+" "+(i.targetY+i.rightSmallArcRadius)+" L "+(i.rightFullExtent-n-e)+" "+i.verticalRightInnerExtent,r+=a&&o?" A "+(i.rightLargeArcRadius+n)+" "+(i.rightLargeArcRadius+n)+" 0 0 0 "+(i.rightInnerExtent-n-e)+" "+(i.verticalFullExtent+n)+" L "+(i.rightFullExtent+n-e-(i.rightLargeArcRadius-n))+" "+(i.verticalFullExtent+n)+" A "+(i.rightLargeArcRadius+n)+" "+(i.rightLargeArcRadius+n)+" 0 0 0 "+(i.leftFullExtent+n)+" "+i.verticalLeftInnerExtent:a?" A "+(i.rightLargeArcRadius-n)+" "+(i.rightSmallArcRadius-n)+" 0 0 1 "+(i.rightFullExtent-e-n-(i.rightLargeArcRadius-n))+" "+(i.verticalFullExtent-n)+" L "+(i.leftFullExtent+n+(i.rightLargeArcRadius-n))+" "+(i.verticalFullExtent-n)+" A "+(i.rightLargeArcRadius-n)+" "+(i.rightSmallArcRadius-n)+" 0 0 1 "+(i.leftFullExtent+n)+" "+i.verticalLeftInnerExtent:" A "+(i.rightLargeArcRadius+n)+" "+(i.rightLargeArcRadius+n)+" 0 0 0 "+(i.rightInnerExtent-e)+" "+(i.verticalFullExtent+n)+" L "+i.leftInnerExtent+" "+(i.verticalFullExtent+n)+" A "+(i.leftLargeArcRadius+n)+" "+(i.leftLargeArcRadius+n)+" 0 0 0 "+(i.leftFullExtent+n)+" "+i.verticalLeftInnerExtent,r+=" L "+(i.leftFullExtent+n)+" "+(i.sourceY+i.leftSmallArcRadius)+" A "+(i.leftLargeArcRadius+n)+" "+(i.leftSmallArcRadius+n)+" 0 0 0 "+i.leftInnerExtent+" "+(i.sourceY-n)+" L "+i.sourceX+" "+(i.sourceY-n)+" L "+i.sourceX+" "+(i.sourceY+n)+" L "+i.leftInnerExtent+" "+(i.sourceY+n)+" A "+(i.leftLargeArcRadius-n)+" "+(i.leftSmallArcRadius-n)+" 0 0 1 "+(i.leftFullExtent-n)+" "+(i.sourceY+i.leftSmallArcRadius)+" L "+(i.leftFullExtent-n)+" "+i.verticalLeftInnerExtent,r+=a&&o?" A "+(i.rightLargeArcRadius-n)+" "+(i.rightSmallArcRadius-n)+" 0 0 1 "+(i.leftFullExtent-n-(i.rightLargeArcRadius-n))+" "+(i.verticalFullExtent-n)+" L "+(i.rightFullExtent+n-e+(i.rightLargeArcRadius-n))+" "+(i.verticalFullExtent-n)+" A "+(i.rightLargeArcRadius-n)+" "+(i.rightSmallArcRadius-n)+" 0 0 1 "+(i.rightFullExtent+n-e)+" "+i.verticalRightInnerExtent:a?" A "+(i.rightLargeArcRadius+n)+" "+(i.rightLargeArcRadius+n)+" 0 0 0 "+(i.leftFullExtent+n)+" "+(i.verticalFullExtent+n)+" L "+(i.rightFullExtent-e-n)+" "+(i.verticalFullExtent+n)+" A "+(i.rightLargeArcRadius+n)+" "+(i.rightLargeArcRadius+n)+" 0 0 0 "+(i.rightFullExtent+n-e)+" "+i.verticalRightInnerExtent:" A "+(i.leftLargeArcRadius-n)+" "+(i.leftLargeArcRadius-n)+" 0 0 1 "+i.leftInnerExtent+" "+(i.verticalFullExtent-n)+" L "+(i.rightInnerExtent-e)+" "+(i.verticalFullExtent-n)+" A "+(i.rightLargeArcRadius-n)+" "+(i.rightLargeArcRadius-n)+" 0 0 1 "+(i.rightFullExtent+n-e)+" "+i.verticalRightInnerExtent,r+=" L "+(i.rightFullExtent+n-e)+" "+(i.targetY+i.rightSmallArcRadius)+" A "+(i.rightLargeArcRadius-n)+" "+(i.rightSmallArcRadius-n)+" 0 0 1 "+(i.rightInnerExtent-e)+" "+(i.targetY+n)+" L "+(i.targetX-e)+" "+(i.targetY+n)+(e>0?" L "+i.targetX+" "+i.targetY:"")+"Z"),r}(t.link,e);var r=Math.abs((t.link.target.x0-t.link.source.x1)/2);e>r&&(e=r);var i=t.link.source.x1,a=t.link.target.x0-e,o=n(i,a),s=o(.5),l=o(.5),c=t.link.y0-t.link.width/2,u=t.link.y0+t.link.width/2,h=t.link.y1-t.link.width/2,p=t.link.y1+t.link.width/2,f="M"+i+","+c,d="C"+s+","+c+" "+l+","+h+" "+a+","+h,m="C"+l+","+p+" "+s+","+u+" "+i+","+u,g=e>0?"L"+(a+e)+","+(h+t.link.width/2):"";return f+d+(g+="L"+a+","+p)+m+"Z"}}function E(t,e){var r=l(e.color),n=s.nodePadAcross,i=t.nodePad/2;e.dx=e.x1-e.x0,e.dy=e.y1-e.y0;var a=e.dx,o=Math.max(.5,e.dy),u="node_"+e.pointNumber;return e.group&&(u=h.randstr()),e.trace=t.trace,e.curveNumber=t.trace.index,{index:e.pointNumber,key:u,partOfGroup:e.partOfGroup||!1,group:e.group,traceId:t.key,trace:t.trace,node:e,nodePad:t.nodePad,nodeLineColor:t.nodeLineColor,nodeLineWidth:t.nodeLineWidth,textFont:t.textFont,size:t.horizontal?t.height:t.width,visibleWidth:Math.ceil(a),visibleHeight:o,zoneX:-n,zoneY:-i,zoneWidth:a+2*n,zoneHeight:o+2*i,labelY:t.horizontal?e.dy/2+1:e.dx/2+1,left:1===e.originalLayer,sizeAcross:t.width,forceLayouts:t.forceLayouts,horizontal:t.horizontal,darkBackground:r.getBrightness()<=128,tinyColorHue:c.tinyRGB(r),tinyColorAlpha:r.getAlpha(),valueFormat:t.valueFormat,valueSuffix:t.valueSuffix,sankey:t.sankey,graph:t.graph,arrangement:t.arrangement,uniqueNodeLabelPathId:[t.guid,t.key,u].join("_"),interactionState:t.interactionState,figure:t}}function C(t){t.attr("transform",(function(t){return p(t.node.x0.toFixed(3),t.node.y0.toFixed(3))}))}function I(t){t.call(C)}function L(t,e){t.call(I),e.attr("d",S())}function P(t){t.attr("width",(function(t){return t.node.x1-t.node.x0})).attr("height",(function(t){return t.visibleHeight}))}function z(t){return t.link.width>1||t.linkLineWidth>0}function D(t){return p(t.translateX,t.translateY)+(t.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)")}function R(t,e,r){t.on(".basic",null).on("mouseover.basic",(function(t){!t.interactionState.dragInProgress&&!t.partOfGroup&&(r.hover(this,t,e),t.interactionState.hovered=[this,t])})).on("mousemove.basic",(function(t){!t.interactionState.dragInProgress&&!t.partOfGroup&&(r.follow(this,t),t.interactionState.hovered=[this,t])})).on("mouseout.basic",(function(t){!t.interactionState.dragInProgress&&!t.partOfGroup&&(r.unhover(this,t,e),t.interactionState.hovered=!1)})).on("click.basic",(function(t){t.interactionState.hovered&&(r.unhover(this,t,e),t.interactionState.hovered=!1),!t.interactionState.dragInProgress&&!t.partOfGroup&&r.select(this,t,e)}))}function F(t,e,n,a){var o=i.behavior.drag().origin((function(t){return{x:t.node.x0+t.visibleWidth/2,y:t.node.y0+t.visibleHeight/2}})).on("dragstart",(function(i){if("fixed"!==i.arrangement&&(h.ensureSingle(a._fullLayout._infolayer,"g","dragcover",(function(t){a._fullLayout._dragCover=t})),h.raiseToTop(this),i.interactionState.dragInProgress=i.node,j(i.node),i.interactionState.hovered&&(n.nodeEvents.unhover.apply(0,i.interactionState.hovered),i.interactionState.hovered=!1),"snap"===i.arrangement)){var o=i.traceId+"|"+i.key;i.forceLayouts[o]?i.forceLayouts[o].alpha(1):function(t,e,n){!function(t){for(var e=0;e0&&n.forceLayouts[e].alpha(0)}}(0,e,i,n)).stop()}(0,o,i),function(t,e,r,n,i){window.requestAnimationFrame((function a(){var o;for(o=0;o0)window.requestAnimationFrame(a);else{var l=r.node.originalX;r.node.x0=l-r.visibleWidth/2,r.node.x1=l+r.visibleWidth/2,B(r,i)}}))}(t,e,i,o,a)}})).on("drag",(function(r){if("fixed"!==r.arrangement){var n=i.event.x,a=i.event.y;"snap"===r.arrangement?(r.node.x0=n-r.visibleWidth/2,r.node.x1=n+r.visibleWidth/2,r.node.y0=a-r.visibleHeight/2,r.node.y1=a+r.visibleHeight/2):("freeform"===r.arrangement&&(r.node.x0=n-r.visibleWidth/2,r.node.x1=n+r.visibleWidth/2),a=Math.max(0,Math.min(r.size-r.visibleHeight/2,a)),r.node.y0=a-r.visibleHeight/2,r.node.y1=a+r.visibleHeight/2),j(r.node),"snap"!==r.arrangement&&(r.sankey.update(r.graph),L(t.filter(N(r)),e))}})).on("dragend",(function(t){if("fixed"!==t.arrangement){t.interactionState.dragInProgress=!1;for(var e=0;e"),color:b(l,"bgcolor")||s.addOpacity(m.color,1),borderColor:b(l,"bordercolor"),fontFamily:b(l,"font.family"),fontSize:b(l,"font.size"),fontColor:b(l,"font.color"),fontWeight:b(l,"font.weight"),fontStyle:b(l,"font.style"),fontVariant:b(l,"font.variant"),fontTextcase:b(l,"font.textcase"),fontLineposition:b(l,"font.lineposition"),fontShadow:b(l,"font.shadow"),nameLength:b(l,"namelength"),textAlign:b(l,"align"),idealAlign:r.event.x"),color:b(s,"bgcolor")||a.tinyColorHue,borderColor:b(s,"bordercolor"),fontFamily:b(s,"font.family"),fontSize:b(s,"font.size"),fontColor:b(s,"font.color"),fontWeight:b(s,"font.weight"),fontStyle:b(s,"font.style"),fontVariant:b(s,"font.variant"),fontTextcase:b(s,"font.textcase"),fontLineposition:b(s,"font.lineposition"),fontShadow:b(s,"font.shadow"),nameLength:b(s,"namelength"),textAlign:b(s,"align"),idealAlign:"left",hovertemplate:s.hovertemplate,hovertemplateLabels:v,eventData:[a.node]},{container:n._hoverlayer.node(),outerContainer:n._paper.node(),gd:t});p(w,.85),f(w)}}},unhover:function(e,i,a){!1!==t._fullLayout.hovermode&&(r.select(e).call(y,i,a),"skip"!==i.node.trace.node.hoverinfo&&(i.node.fullData=i.node.trace,t.emit("plotly_unhover",{event:r.event,points:[i.node]})),o.loneUnhover(n._hoverlayer.node()))},select:function(e,n,i){var a=n.node;a.originalEvent=r.event,t._hoverdata=[a],r.select(e).call(y,n,i),o.click(t,{target:!0})}}})}}}),Ub=f({"src/traces/sankey/base_plot.js"(t){var e=Pt().overrideAll,r=we().getModuleCalcData,n=Nb(),i=j(),a=fr(),o=pr(),s=En().prepSelect,l=le(),c=qt(),u="sankey";function h(t,e){var r=t._fullData[e],n=t._fullLayout,i=n.dragmode,u="pan"===n.dragmode?"move":"crosshair",h=r._bgRect;if(h&&"pan"!==i&&"zoom"!==i){a(h,u);var p={_id:"x",c2p:l.identity,_offset:r._sankey.translateX,_length:r._sankey.width},f={_id:"y",c2p:l.identity,_offset:r._sankey.translateY,_length:r._sankey.height},d={gd:t,element:h.node(),plotinfo:{id:e,xaxis:p,yaxis:f,fillRangeItems:l.noop},subplot:e,xaxes:[p],yaxes:[f],doneFnCompleted:function(r){var n,i=t._fullData[e],a=i.node.groups.slice(),o=[];function s(t){for(var e=i._sankey.graph.nodes,r=0;r0}function A(t){t.each((function(t){v.stroke(r.select(this),t.line.color)})).each((function(t){v.fill(r.select(this),t.color)})).style("stroke-width",(function(t){return t.line.width}))}function k(t,e,r){var n=t._fullLayout,i=a.extendFlat({type:"linear",ticks:"outside",range:r,showline:!0},e),o={type:"linear",_id:"x"+e._id},s={letter:"x",font:n.font,noAutotickangles:!0,noHover:!0,noTickson:!0};function l(t,e){return a.coerce(i,o,y,t,e)}return d(i,o,l,s,n),m(i,o,l,s),o}function M(t,e,r){return[Math.min(e/t.width,r/t.height),t,e+"x"+r]}function S(t,e,n,i){var a=document.createElementNS("http://www.w3.org/2000/svg","text"),o=r.select(a);return o.text(t).attr("x",0).attr("y",0).attr("text-anchor",n).attr("data-unformatted",t).call(p.convertToTspans,i).call(u.font,e),u.bBox(o.node())}function E(t,e,r,n,i,o){var s="_cache"+e;t[s]&&t[s].key===i||(t[s]={key:i,value:r});var l=a.aggNums(o,null,[t[s].value,n],2);return t[s].value=l,l}e.exports=function(t,e,d,m){var g,y=t._fullLayout;T(d)&&m&&(g=m()),a.makeTraceGroups(y._indicatorlayer,e,"trace").each((function(e){var m,x,C,I,L,P=e[0].trace,z=r.select(this),D=P._hasGauge,O=P._isAngular,R=P._isBullet,F=P.domain,B={w:y._size.w*(F.x[1]-F.x[0]),h:y._size.h*(F.y[1]-F.y[0]),l:y._size.l+y._size.w*F.x[0],r:y._size.r+y._size.w*(1-F.x[1]),t:y._size.t+y._size.h*(1-F.y[1]),b:y._size.b+y._size.h*F.y[0]},j=B.l+B.w/2,N=B.t+B.h/2,U=Math.min(B.w/2,B.h),V=h.innerRadius*U,q=P.align||"center";if(x=N,D){if(O&&(m=j,x=N+U/2,C=function(t){return function(t,e){return[e/Math.sqrt(t.width/2*(t.width/2)+t.height*t.height),t,e]}(t,.9*V)}),R){var H=h.bulletPadding,G=1-h.bulletNumberDomainSize+H;m=B.l+(G+(1-G)*b[q])*B.w,C=function(t){return M(t,(h.bulletNumberDomainSize-H)*B.w,B.h)}}}else m=B.l+b[q]*B.w,C=function(t){return M(t,B.w,B.h)};!function(t,e,n,l){var c,h,d,m=n[0].trace,g=l.numbersX,y=l.numbersY,x=m.align||"center",A=_[x],M=l.transitionOpts,C=l.onComplete,I=a.ensureSingle(e,"g","numbers"),L=[];m._hasNumber&&L.push("number"),m._hasDelta&&(L.push("delta"),"left"===m.delta.position&&L.reverse());var P=I.selectAll("text").data(L);function z(e,r,n,i){if(!e.match("s")||n>=0==i>=0||r(n).slice(-1).match(w)||r(i).slice(-1).match(w))return r;var a=e.slice().replace("s","f").replace(/\d+/,(function(t){return parseInt(t)-1})),o=k(t,{tickformat:a});return function(t){return Math.abs(t)<1?f.tickText(o,t).text:r(t)}}P.enter().append("text"),P.attr("text-anchor",(function(){return A})).attr("class",(function(t){return t})).attr("x",null).attr("y",null).attr("dx",null).attr("dy",null),P.exit().remove();var D,O=m.mode+m.align;if(m._hasDelta&&(D=function(){var e=k(t,{tickformat:m.delta.valueformat},m._range);e.setScale(),f.prepTicks(e);var a=function(t){return f.tickText(e,t).text},o=m.delta.suffix,s=m.delta.prefix,l=function(t){return m.delta.relative?t.relativeDelta:t.delta},c=function(t,e){return 0===t||"number"!=typeof t||isNaN(t)?"-":(t>0?m.delta.increasing.symbol:m.delta.decreasing.symbol)+s+e(t)+o},d=function(t){return t.delta>=0?m.delta.increasing.color:m.delta.decreasing.color};void 0===m._deltaLastValue&&(m._deltaLastValue=l(n[0]));var g=I.select("text.delta");function y(){g.text(c(l(n[0]),a)).call(v.fill,d(n[0])).call(p.convertToTspans,t)}return g.call(u.font,m.delta.font).call(v.fill,d({delta:m._deltaLastValue})),T(M)?g.transition().duration(M.duration).ease(M.easing).tween("text",(function(){var t=r.select(this),e=l(n[0]),o=m._deltaLastValue,s=z(m.delta.valueformat,a,o,e),u=i(o,e);return m._deltaLastValue=e,function(e){t.text(c(u(e),s)),t.call(v.fill,d({delta:u(e)}))}})).each("end",(function(){y(),C&&C()})).each("interrupt",(function(){y(),C&&C()})):y(),h=S(c(l(n[0]),a),m.delta.font,A,t),g}(),O+=m.delta.position+m.delta.font.size+m.delta.font.family+m.delta.valueformat,O+=m.delta.increasing.symbol+m.delta.decreasing.symbol,d=h),m._hasNumber&&(function(){var e=k(t,{tickformat:m.number.valueformat},m._range);e.setScale(),f.prepTicks(e);var a=function(t){return f.tickText(e,t).text},o=m.number.suffix,s=m.number.prefix,l=I.select("text.number");function h(){var e="number"==typeof n[0].y?s+a(n[0].y)+o:"-";l.text(e).call(u.font,m.number.font).call(p.convertToTspans,t)}T(M)?l.transition().duration(M.duration).ease(M.easing).each("end",(function(){h(),C&&C()})).each("interrupt",(function(){h(),C&&C()})).attrTween("text",(function(){var t=r.select(this),e=i(n[0].lastY,n[0].y);m._lastValue=n[0].y;var l=z(m.number.valueformat,a,n[0].lastY,n[0].y);return function(r){t.text(s+l(e(r))+o)}})):h(),c=S(s+a(n[0].y)+o,m.number.font,A,t)}(),O+=m.number.font.size+m.number.font.family+m.number.valueformat+m.number.suffix+m.number.prefix,d=c),m._hasDelta&&m._hasNumber){var R,F,B=[(c.left+c.right)/2,(c.top+c.bottom)/2],j=[(h.left+h.right)/2,(h.top+h.bottom)/2],N=.75*m.delta.font.size;"left"===m.delta.position&&(R=E(m,"deltaPos",0,-1*(c.width*b[m.align]+h.width*(1-b[m.align])+N),O,Math.min),F=B[1]-j[1],d={width:c.width+h.width+N,height:Math.max(c.height,h.height),left:h.left+R,right:c.right,top:Math.min(c.top,h.top+F),bottom:Math.max(c.bottom,h.bottom+F)}),"right"===m.delta.position&&(R=E(m,"deltaPos",0,c.width*(1-b[m.align])+h.width*b[m.align]+N,O,Math.max),F=B[1]-j[1],d={width:c.width+h.width+N,height:Math.max(c.height,h.height),left:c.left,right:h.right+R,top:Math.min(c.top,h.top+F),bottom:Math.max(c.bottom,h.bottom+F)}),"bottom"===m.delta.position&&(R=null,F=h.height,d={width:Math.max(c.width,h.width),height:c.height+h.height,left:Math.min(c.left,h.left),right:Math.max(c.right,h.right),top:c.bottom-c.height,bottom:c.bottom+h.height}),"top"===m.delta.position&&(R=null,F=c.top,d={width:Math.max(c.width,h.width),height:c.height+h.height,left:Math.min(c.left,h.left),right:Math.max(c.right,h.right),top:c.bottom-c.height-h.height,bottom:c.bottom}),D.attr({dx:R,dy:F})}(m._hasNumber||m._hasDelta)&&I.attr("transform",(function(){var t=l.numbersScaler(d);O+=t[2];var e,r=E(m,"numbersScale",1,t[0],O,Math.min);m._scaleNumbers||(r=1),e=m._isAngular?y-r*d.bottom:y-r*(d.top+d.bottom)/2,m._numbersTop=r*d.top+e;var n=d[x];"center"===x&&(n=(d.left+d.right)/2);var i=g-r*n;return i=E(m,"numbersTranslate",0,i,O,Math.max),s(i,e)+o(r)}))}(t,z,e,{numbersX:m,numbersY:x,numbersScaler:C,transitionOpts:d,onComplete:g}),D&&(I={range:P.gauge.axis.range,color:P.gauge.bgcolor,line:{color:P.gauge.bordercolor,width:0},thickness:1},L={range:P.gauge.axis.range,color:"rgba(0, 0, 0, 0)",line:{color:P.gauge.bordercolor,width:P.gauge.borderwidth},thickness:1});var W=z.selectAll("g.angular").data(O?e:[]);W.exit().remove();var Z=z.selectAll("g.angularaxis").data(O?e:[]);Z.exit().remove(),O&&function(t,e,i,a){var o,u,h,p,d=i[0].trace,m=a.size,g=a.radius,y=a.innerRadius,v=a.gaugeBg,x=a.gaugeOutline,_=[m.l+m.w/2,m.t+m.h/2+g/2],b=a.gauge,w=a.layer,M=a.transitionOpts,S=a.onComplete,E=Math.PI/2;function C(t){var e=d.gauge.axis.range[0],r=(t-e)/(d.gauge.axis.range[1]-e)*Math.PI-E;return r<-E?-E:r>E?E:r}function I(t){return r.svg.arc().innerRadius((y+g)/2-t/2*(g-y)).outerRadius((y+g)/2+t/2*(g-y)).startAngle(-E)}function L(t){t.attr("d",(function(t){return I(t.thickness).startAngle(C(t.range[0])).endAngle(C(t.range[1]))()}))}b.enter().append("g").classed("angular",!0),b.attr("transform",s(_[0],_[1])),w.enter().append("g").classed("angularaxis",!0).classed("crisp",!0),w.selectAll("g.xangularaxistick,path,text").remove(),(o=k(t,d.gauge.axis)).type="linear",o.range=d.gauge.axis.range,o._id="xangularaxis",o.ticklabeloverflow="allow",o.setScale();var P=function(t){return(o.range[0]-t.x)/(o.range[1]-o.range[0])*Math.PI+Math.PI},z={},D=f.makeLabelFns(o,0).labelStandoff;z.xFn=function(t){var e=P(t);return Math.cos(e)*D},z.yFn=function(t){var e=P(t),r=Math.sin(e)>0?.2:1;return-Math.sin(e)*(D+t.fontSize*r)+Math.abs(Math.cos(e))*(t.fontSize*c)},z.anchorFn=function(t){var e=P(t),r=Math.cos(e);return Math.abs(r)<.1?"middle":r>0?"start":"end"},z.heightFn=function(t,e,r){var n=P(t);return-.5*(1+Math.sin(n))*r};var O=function(t){return s(_[0]+g*Math.cos(t),_[1]-g*Math.sin(t))};h=function(t){return O(P(t))};if(u=f.calcTicks(o),p=f.getTickSigns(o)[2],o.visible){p="inside"===o.ticks?-1:1;var R=(o.linewidth||1)/2;f.drawTicks(t,o,{vals:u,layer:w,path:"M"+p*R+",0h"+p*o.ticklen,transFn:function(t){var e=P(t);return O(e)+"rotate("+-l(e)+")"}}),f.drawLabels(t,o,{vals:u,layer:w,transFn:h,labelFns:z})}var F=[v].concat(d.gauge.steps),B=b.selectAll("g.bg-arc").data(F);B.enter().append("g").classed("bg-arc",!0).append("path"),B.select("path").call(L).call(A),B.exit().remove();var j=I(d.gauge.bar.thickness),N=b.selectAll("g.value-arc").data([d.gauge.bar]);N.enter().append("g").classed("value-arc",!0).append("path");var U=N.select("path");T(M)?(U.transition().duration(M.duration).ease(M.easing).each("end",(function(){S&&S()})).each("interrupt",(function(){S&&S()})).attrTween("d",function(t,e,r){return function(){var i=n(e,r);return function(e){return t.endAngle(i(e))()}}}(j,C(i[0].lastY),C(i[0].y))),d._lastValue=i[0].y):U.attr("d","number"==typeof i[0].y?j.endAngle(C(i[0].y)):"M0,0Z"),U.call(A),N.exit().remove(),F=[];var V=d.gauge.threshold.value;(V||0===V)&&F.push({range:[V,V],color:d.gauge.threshold.color,line:{color:d.gauge.threshold.line.color,width:d.gauge.threshold.line.width},thickness:d.gauge.threshold.thickness});var q=b.selectAll("g.threshold-arc").data(F);q.enter().append("g").classed("threshold-arc",!0).append("path"),q.select("path").call(L).call(A),q.exit().remove();var H=b.selectAll("g.gauge-outline").data([x]);H.enter().append("g").classed("gauge-outline",!0).append("path"),H.select("path").call(L).call(A),H.exit().remove()}(t,0,e,{radius:U,innerRadius:V,gauge:W,layer:Z,size:B,gaugeBg:I,gaugeOutline:L,transitionOpts:d,onComplete:g});var Y=z.selectAll("g.bullet").data(R?e:[]);Y.exit().remove();var X=z.selectAll("g.bulletaxis").data(R?e:[]);X.exit().remove(),R&&function(t,e,r,n){var i,a,o,l,c,u=r[0].trace,p=n.gauge,d=n.layer,m=n.gaugeBg,g=n.gaugeOutline,y=n.size,x=u.domain,_=n.transitionOpts,b=n.onComplete;p.enter().append("g").classed("bullet",!0),p.attr("transform",s(y.l,y.t)),d.enter().append("g").classed("bulletaxis",!0).classed("crisp",!0),d.selectAll("g.xbulletaxistick,path,text").remove();var w=y.h,M=u.gauge.bar.thickness*w,S=x.x[0],E=x.x[0]+(x.x[1]-x.x[0])*(u._hasNumber||u._hasDelta?1-h.bulletNumberDomainSize:1);function C(t){t.attr("width",(function(t){return Math.max(0,i.c2p(t.range[1])-i.c2p(t.range[0]))})).attr("x",(function(t){return i.c2p(t.range[0])})).attr("y",(function(t){return.5*(1-t.thickness)*w})).attr("height",(function(t){return t.thickness*w}))}(i=k(t,u.gauge.axis))._id="xbulletaxis",i.domain=[S,E],i.setScale(),a=f.calcTicks(i),o=f.makeTransTickFn(i),l=f.getTickSigns(i)[2],c=y.t+y.h,i.visible&&(f.drawTicks(t,i,{vals:"inside"===i.ticks?f.clipEnds(i,a):a,layer:d,path:f.makeTickPath(i,c,l),transFn:o}),f.drawLabels(t,i,{vals:a,layer:d,transFn:o,labelFns:f.makeLabelFns(i,c)}));var I=[m].concat(u.gauge.steps),L=p.selectAll("g.bg-bullet").data(I);L.enter().append("g").classed("bg-bullet",!0).append("rect"),L.select("rect").call(C).call(A),L.exit().remove();var P=p.selectAll("g.value-bullet").data([u.gauge.bar]);P.enter().append("g").classed("value-bullet",!0).append("rect"),P.select("rect").attr("height",M).attr("y",(w-M)/2).call(A),T(_)?P.select("rect").transition().duration(_.duration).ease(_.easing).each("end",(function(){b&&b()})).each("interrupt",(function(){b&&b()})).attr("width",Math.max(0,i.c2p(Math.min(u.gauge.axis.range[1],r[0].y)))):P.select("rect").attr("width","number"==typeof r[0].y?Math.max(0,i.c2p(Math.min(u.gauge.axis.range[1],r[0].y))):0),P.exit().remove();var z=r.filter((function(){return u.gauge.threshold.value||0===u.gauge.threshold.value})),D=p.selectAll("g.threshold-bullet").data(z);D.enter().append("g").classed("threshold-bullet",!0).append("line"),D.select("line").attr("x1",i.c2p(u.gauge.threshold.value)).attr("x2",i.c2p(u.gauge.threshold.value)).attr("y1",(1-u.gauge.threshold.thickness)/2*w).attr("y2",(1-(1-u.gauge.threshold.thickness)/2)*w).call(v.stroke,u.gauge.threshold.line.color).style("stroke-width",u.gauge.threshold.line.width),D.exit().remove();var O=p.selectAll("g.gauge-outline").data([g]);O.enter().append("g").classed("gauge-outline",!0).append("rect"),O.select("rect").call(C).call(A),O.exit().remove()}(t,0,e,{gauge:Y,layer:X,size:B,gaugeBg:I,gaugeOutline:L,transitionOpts:d,onComplete:g});var $=z.selectAll("text.title").data(e);$.exit().remove(),$.enter().append("text").classed("title",!0),$.attr("text-anchor",(function(){return R?_.right:_[P.title.align]})).text(P.title.text).call(u.font,P.title.font).call(p.convertToTspans,t),$.attr("transform",(function(){var t,e=B.l+B.w*b[P.title.align],r=h.titlePadding,n=u.bBox($.node());return D?(O&&(t=P.gauge.axis.visible?u.bBox(Z.node()).top-r-n.bottom:B.t+B.h/2-U/2-n.bottom-r),R&&(t=x-(n.top+n.bottom)/2,e=B.l-h.bulletPadding*B.w)):t=P._numbersTop-r-n.bottom,s(e,t)}))}))}}}),Kb=f({"src/traces/indicator/index.js"(t,e){e.exports={moduleType:"trace",name:"indicator",basePlotModule:Gb(),categories:["svg","noOpacity","noHover"],animatable:!0,attributes:Wb(),supplyDefaults:Yb().supplyDefaults,calc:Xb().calc,plot:$b(),meta:{}}}}),Jb=f({"lib/indicator.js"(t,e){e.exports=Kb()}}),Qb=f({"src/traces/table/attributes.js"(t,e){var r=_n(),n=R().extendFlat,i=Pt().overrideAll,a=F(),o=Aa().attributes,s=Ce().descriptionOnlyNumbers;e.exports=i({domain:o({name:"table",trace:!0}),columnwidth:{valType:"number",arrayOk:!0,dflt:null},columnorder:{valType:"data_array"},header:{values:{valType:"data_array",dflt:[]},format:{valType:"data_array",dflt:[],description:s("cell value")},prefix:{valType:"string",arrayOk:!0,dflt:null},suffix:{valType:"string",arrayOk:!0,dflt:null},height:{valType:"number",dflt:28},align:n({},r.align,{arrayOk:!0}),line:{width:{valType:"number",arrayOk:!0,dflt:1},color:{valType:"color",arrayOk:!0,dflt:"grey"}},fill:{color:{valType:"color",arrayOk:!0,dflt:"white"}},font:n({},a({arrayOk:!0}))},cells:{values:{valType:"data_array",dflt:[]},format:{valType:"data_array",dflt:[],description:s("cell value")},prefix:{valType:"string",arrayOk:!0,dflt:null},suffix:{valType:"string",arrayOk:!0,dflt:null},height:{valType:"number",dflt:20},align:n({},r.align,{arrayOk:!0}),line:{width:{valType:"number",arrayOk:!0,dflt:1},color:{valType:"color",arrayOk:!0,dflt:"grey"}},fill:{color:{valType:"color",arrayOk:!0,dflt:"white"}},font:n({},a({arrayOk:!0}))}},"calc","from-root")}}),tw=f({"src/traces/table/defaults.js"(t,e){var r=le(),n=Qb(),i=Aa().defaults;e.exports=function(t,e,a,o){function s(i,a){return r.coerce(t,e,n,i,a)}i(e,o,s),s("columnwidth"),s("header.values"),s("header.format"),s("header.align"),s("header.prefix"),s("header.suffix"),s("header.height"),s("header.line.width"),s("header.line.color"),s("header.fill.color"),r.coerceFont(s,"header.font",o.font),function(t,e){for(var r=t.columnorder||[],n=t.header.values.length,i=r.slice(0,n),a=i.slice().sort((function(t,e){return t-e})),o=i.map((function(t){return a.indexOf(t)})),s=o.length;s",maxDimensionCount:60,overdrag:45,releaseTransitionDuration:120,releaseTransitionEase:"cubic-out",scrollbarCaptureWidth:18,scrollbarHideDelay:1e3,scrollbarHideDuration:1e3,scrollbarOffset:5,scrollbarWidth:8,transitionDuration:100,transitionEase:"cubic-out",uplift:5,wrapSpacer:" ",wrapSplitCharacter:" ",cn:{table:"table",tableControlView:"table-control-view",scrollBackground:"scroll-background",yColumn:"y-column",columnBlock:"column-block",scrollAreaClip:"scroll-area-clip",scrollAreaClipRect:"scroll-area-clip-rect",columnBoundary:"column-boundary",columnBoundaryClippath:"column-boundary-clippath",columnBoundaryRect:"column-boundary-rect",columnCells:"column-cells",columnCell:"column-cell",cellRect:"cell-rect",cellText:"cell-text",cellTextHolder:"cell-text-holder",scrollbarKit:"scrollbar-kit",scrollbar:"scrollbar",scrollbarSlider:"scrollbar-slider",scrollbarGlyph:"scrollbar-glyph",scrollbarCaptureZone:"scrollbar-capture-zone"}}}}),nw=f({"src/traces/table/data_preparation_helper.js"(t,e){var r=rw(),n=R().extendFlat,i=A(),a=E().isTypedArray,o=E().isArrayOrTypedArray;function s(t){if(o(t)){for(var e=0,r=0;r=e||c===t.length-1)&&(n[i]=o,o.key=l++,o.firstRowIndex=s,o.lastRowIndex=c,o={firstRowIndex:null,lastRowIndex:null,rows:[]},i+=a,s=c+1,a=0);return n}e.exports=function(t,e){var a=c(e.cells.values),d=function(t){return t.slice(e.header.values.length,t.length)},m=c(e.header.values);m.length&&!m[0].length&&(m[0]=[""],m=c(m));var g=m.concat(d(a).map((function(){return u((m[0]||[""]).length)}))),y=e.domain,v=Math.floor(t._fullLayout._size.w*(y.x[1]-y.x[0])),x=Math.floor(t._fullLayout._size.h*(y.y[1]-y.y[0])),_=e.header.values.length?g[0].map((function(){return e.header.height})):[r.emptyHeaderHeight],b=a.length?a[0].map((function(){return e.cells.height})):[],w=_.reduce(l,0),T=f(b,x-w+r.uplift),A=p(f(_,w),[]),k=p(T,A),M={},S=e._fullInput.columnorder;o(S)&&(S=Array.from(S)),S=S.concat(d(a.map((function(t,e){return e}))));var E=g.map((function(t,r){var n=o(e.columnwidth)?e.columnwidth[Math.min(r,e.columnwidth.length-1)]:e.columnwidth;return i(n)?Number(n):1})),C=E.reduce(l,0);E=E.map((function(t){return t/C*v}));var I=Math.max(s(e.header.line.width),s(e.cells.line.width)),L={key:e.uid+t._context.staticPlot,translateX:y.x[0]*t._fullLayout._size.w,translateY:t._fullLayout._size.h*(1-y.y[1]),size:t._fullLayout._size,width:v,maxLineWidth:I,height:x,columnOrder:S,groupHeight:x,rowBlocks:k,headerRowBlocks:A,scrollY:0,cells:n({},e.cells,{values:a}),headerCells:n({},e.header,{values:g}),gdColumns:g.map((function(t){return t[0]})),gdColumnsOriginalOrder:g.map((function(t){return t[0]})),prevPages:[0,0],scrollbarState:{scrollbarScrollInProgress:!1},columns:g.map((function(t,e){var r=M[t];return M[t]=(r||0)+1,{key:t+"__"+M[t],label:t,specIndex:e,xIndex:S[e],xScale:h,x:void 0,calcdata:void 0,columnWidth:E[e]}}))};return L.columns.forEach((function(t){t.calcdata=L,t.x=h(t)})),L}}}),iw=f({"src/traces/table/data_split_helpers.js"(t){var e=R().extendFlat;t.splitToPanels=function(t){var r=[0,0],n=e({},t,{key:"header",type:"header",page:0,prevPages:r,currentRepaint:[null,null],dragHandle:!0,values:t.calcdata.headerCells.values[t.specIndex],rowBlocks:t.calcdata.headerRowBlocks,calcdata:e({},t.calcdata,{cells:t.calcdata.headerCells})});return[e({},t,{key:"cells1",type:"cells",page:0,prevPages:r,currentRepaint:[null,null],dragHandle:!1,values:t.calcdata.cells.values[t.specIndex],rowBlocks:t.calcdata.rowBlocks}),e({},t,{key:"cells2",type:"cells",page:1,prevPages:r,currentRepaint:[null,null],dragHandle:!1,values:t.calcdata.cells.values[t.specIndex],rowBlocks:t.calcdata.rowBlocks}),n]},t.splitToCells=function(t){var e=function(t){var e=t.rowBlocks[t.page],r=e?e.rows[0].rowIndex:0;return[r,e?r+e.rows.length:0]}(t);return(t.values||[]).slice(e[0],e[1]).map((function(r,n){return{keyWithinBlock:n+("string"==typeof r&&r.match(/[<$&> ]/)?"_keybuster_"+Math.random():""),key:e[0]+n,column:t,calcdata:t.calcdata,page:t.page,rowBlocks:t.rowBlocks,value:r}}))}}}),aw=f({"src/traces/table/plot.js"(t,e){var r=rw(),n=x(),i=le(),a=i.numberFormat,o=Ix(),s=Qe(),l=Se(),c=le().raiseToTop,u=le().strTranslate,h=le().cancelTransition,p=nw(),f=iw(),d=H();function m(t){return Math.ceil(t.calcdata.maxLineWidth/2)}function g(t,e){return"clip"+t._fullLayout._uid+"_scrollAreaBottomClip_"+e.key}function y(t,e){return"clip"+t._fullLayout._uid+"_columnBoundaryClippath_"+e.calcdata.key+"_"+e.specIndex}function v(t){return[].concat.apply([],t.map((function(t){return t}))).map((function(t){return t.__data__}))}function _(t,e,i){var a=t.selectAll("."+r.cn.scrollbarKit).data(o.repeat,o.keyFun);a.enter().append("g").classed(r.cn.scrollbarKit,!0).style("shape-rendering","geometricPrecision"),a.each((function(t){var e=t.scrollbarState;e.totalHeight=function(t){var e=t.rowBlocks;return R(e,e.length-1)+(e.length?F(e[e.length-1],1/0):1)}(t),e.scrollableAreaHeight=t.groupHeight-E(t),e.currentlyVisibleHeight=Math.min(e.totalHeight,e.scrollableAreaHeight),e.ratio=e.currentlyVisibleHeight/e.totalHeight,e.barLength=Math.max(e.ratio*e.currentlyVisibleHeight,r.goldenRatio*r.scrollbarWidth),e.barWiggleRoom=e.currentlyVisibleHeight-e.barLength,e.wiggleRoom=Math.max(0,e.totalHeight-e.scrollableAreaHeight),e.topY=0===e.barWiggleRoom?0:t.scrollY/e.wiggleRoom*e.barWiggleRoom,e.bottomY=e.topY+e.barLength,e.dragMultiplier=e.wiggleRoom/e.barWiggleRoom})).attr("transform",(function(t){var e=t.width+r.scrollbarWidth/2+r.scrollbarOffset;return u(e,E(t))}));var s=a.selectAll("."+r.cn.scrollbar).data(o.repeat,o.keyFun);s.enter().append("g").classed(r.cn.scrollbar,!0);var l=s.selectAll("."+r.cn.scrollbarSlider).data(o.repeat,o.keyFun);l.enter().append("g").classed(r.cn.scrollbarSlider,!0),l.attr("transform",(function(t){return u(0,t.scrollbarState.topY||0)}));var c=l.selectAll("."+r.cn.scrollbarGlyph).data(o.repeat,o.keyFun);c.enter().append("line").classed(r.cn.scrollbarGlyph,!0).attr("stroke","black").attr("stroke-width",r.scrollbarWidth).attr("stroke-linecap","round").attr("y1",r.scrollbarWidth/2),c.attr("y2",(function(t){return t.scrollbarState.barLength-r.scrollbarWidth/2})).attr("stroke-opacity",(function(t){return t.columnDragInProgress||!t.scrollbarState.barWiggleRoom||i?0:.4})),c.transition().delay(0).duration(0),c.transition().delay(r.scrollbarHideDelay).duration(r.scrollbarHideDuration).attr("stroke-opacity",0);var h=s.selectAll("."+r.cn.scrollbarCaptureZone).data(o.repeat,o.keyFun);h.enter().append("line").classed(r.cn.scrollbarCaptureZone,!0).attr("stroke","white").attr("stroke-opacity",.01).attr("stroke-width",r.scrollbarCaptureWidth).attr("stroke-linecap","butt").attr("y1",0).on("mousedown",(function(r){var i=n.event.y,a=this.getBoundingClientRect(),o=r.scrollbarState,s=i-a.top,l=n.scale.linear().domain([0,o.scrollableAreaHeight]).range([0,o.totalHeight]).clamp(!0);o.topY<=s&&s<=o.bottomY||I(e,t,null,l(s-o.barLength/2))(r)})).call(n.behavior.drag().origin((function(t){return n.event.stopPropagation(),t.scrollbarState.scrollbarScrollInProgress=!0,t})).on("drag",I(e,t)).on("dragend",(function(){}))),h.attr("y2",(function(t){return t.scrollbarState.scrollableAreaHeight})),e._context.staticPlot&&(c.remove(),h.remove())}function b(t,e,i,a){var l=function(t){var e=t.selectAll("."+r.cn.columnCells).data(o.repeat,o.keyFun);return e.enter().append("g").classed(r.cn.columnCells,!0),e.exit().remove(),e}(i),c=function(t){var e=t.selectAll("."+r.cn.columnCell).data(f.splitToCells,(function(t){return t.keyWithinBlock}));return e.enter().append("g").classed(r.cn.columnCell,!0),e.exit().remove(),e}(l);!function(t){t.each((function(t,e){var r=t.calcdata.cells.font,n=t.column.specIndex,i={size:A(r.size,n,e),color:A(r.color,n,e),family:A(r.family,n,e),weight:A(r.weight,n,e),style:A(r.style,n,e),variant:A(r.variant,n,e),textcase:A(r.textcase,n,e),lineposition:A(r.lineposition,n,e),shadow:A(r.shadow,n,e)};t.rowNumber=t.key,t.align=A(t.calcdata.cells.align,n,e),t.cellBorderWidth=A(t.calcdata.cells.line.width,n,e),t.font=i}))}(c);var u=function(t){var e=t.selectAll("."+r.cn.cellRect).data(o.repeat,(function(t){return t.keyWithinBlock}));return e.enter().append("rect").classed(r.cn.cellRect,!0),e}(c);!function(t){t.attr("width",(function(t){return t.column.columnWidth})).attr("stroke-width",(function(t){return t.cellBorderWidth})).each((function(t){var e=n.select(this);d.stroke(e,A(t.calcdata.cells.line.color,t.column.specIndex,t.rowNumber)),d.fill(e,A(t.calcdata.cells.fill.color,t.column.specIndex,t.rowNumber))}))}(u);var h=function(t){var e=t.selectAll("."+r.cn.cellTextHolder).data(o.repeat,(function(t){return t.keyWithinBlock}));return e.enter().append("g").classed(r.cn.cellTextHolder,!0).style("shape-rendering","geometricPrecision"),e}(c),p=function(t){var e=t.selectAll("."+r.cn.cellText).data(o.repeat,(function(t){return t.keyWithinBlock}));return e.enter().append("text").classed(r.cn.cellText,!0).style("cursor",(function(){return"auto"})).on("mousedown",(function(){n.event.stopPropagation()})),e}(h);(function(t){t.each((function(t){s.font(n.select(this),t.font)}))})(p),w(p,e,a,t),O(c)}function w(t,e,i,o){t.text((function(t){var e=t.column.specIndex,n=t.rowNumber,i=t.value,o="string"==typeof i,s=o&&i.match(/
/i),l=!o||s;t.mayHaveMarkup=o&&i.match(/[<&>]/);var c=function(t){return"string"==typeof t&&t.match(r.latexCheck)}(i);t.latex=c;var u,h,p=c?"":A(t.calcdata.cells.prefix,e,n)||"",f=c?"":A(t.calcdata.cells.suffix,e,n)||"",d=c?null:A(t.calcdata.cells.format,e,n)||null,m=p+(d?a(d)(t.value):t.value)+f;if(t.wrappingNeeded=!t.wrapped&&!l&&!c&&(u=T(m)),t.cellHeightMayIncrease=s||c||t.mayHaveMarkup||(void 0===u?T(m):u),t.needsConvertToTspans=t.mayHaveMarkup||t.wrappingNeeded||t.latex,t.wrappingNeeded){var g=(" "===r.wrapSplitCharacter?m.replace(/i&&n.push(a),i+=l}return n}(i,l,s);1===c.length&&(c[0]===i.length-1?c.unshift(c[0]-1):c.push(c[0]+1)),c[0]%2&&c.reverse(),e.each((function(t,e){t.page=c[e],t.scrollY=l})),e.attr("transform",(function(t){var e=R(t.rowBlocks,t.page)-t.scrollY;return u(0,e)})),t&&(L(t,r,e,c,n.prevPages,n,0),L(t,r,e,c,n.prevPages,n,1),_(r,t))}}function I(t,e,i,a){return function(o){var s=o.calcdata?o.calcdata:o,l=e.filter((function(t){return s.key===t.key})),c=i||s.scrollbarState.dragMultiplier,u=s.scrollY;s.scrollY=void 0===a?s.scrollY+c*n.event.dy:a;var h=l.selectAll("."+r.cn.yColumn).selectAll("."+r.cn.columnBlock).filter(M);return C(t,h,l),s.scrollY===u}}function L(t,e,r,n,i,a,o){n[o]!==i[o]&&(clearTimeout(a.currentRepaint[o]),a.currentRepaint[o]=setTimeout((function(){var a=r.filter((function(t,e){return e===o&&n[e]!==i[e]}));b(t,e,a,r),i[o]=n[o]})))}function P(t,e,i,a){return function(){var o=n.select(e.parentNode);o.each((function(t){var e=t.fragments;o.selectAll("tspan.line").each((function(t,r){e[r].width=this.getComputedTextLength()}));var n,i,a=e[e.length-1].width,s=e.slice(0,-1),l=[],c=0,u=t.column.columnWidth-2*r.cellPad;for(t.value="";s.length;)c+(i=(n=s.shift()).width+a)>u&&(t.value+=l.join(r.wrapSpacer)+r.lineBreaker,l=[],c=0),l.push(n.text),c+=i;c&&(t.value+=l.join(r.wrapSpacer)),t.wrapped=!0})),o.selectAll("tspan.line").remove(),w(o.select("."+r.cn.cellText),i,t,a),n.select(e.parentNode.parentNode).call(O)}}function z(t,e,i,a,o){return function(){if(!o.settledY){var s=n.select(e.parentNode),l=j(o),c=o.key-l.firstRowIndex,h=l.rows[c].rowHeight,p=o.cellHeightMayIncrease?e.parentNode.getBoundingClientRect().height+2*r.cellPad:h,f=Math.max(p,h);f-l.rows[c].rowHeight&&(l.rows[c].rowHeight=f,t.selectAll("."+r.cn.columnCell).call(O),C(null,t.filter(M),0),_(i,a,!0)),s.attr("transform",(function(){var t=this,e=t.parentNode.getBoundingClientRect(),i=n.select(t.parentNode).select("."+r.cn.cellRect).node().getBoundingClientRect(),a=t.transform.baseVal.consolidate(),s=i.top-e.top+(a?a.matrix.f:r.cellPad);return u(D(o,n.select(t.parentNode).select("."+r.cn.cellTextHolder).node().getBoundingClientRect().width),s)})),o.settledY=!0}}}function D(t,e){switch(t.align){case"left":default:return r.cellPad;case"right":return t.column.columnWidth-(e||0)-r.cellPad;case"center":return(t.column.columnWidth-(e||0))/2}}function O(t){t.attr("transform",(function(t){var e=t.rowBlocks[0].auxiliaryBlocks.reduce((function(t,e){return t+F(e,1/0)}),0),r=F(j(t),t.key);return u(0,r+e)})).selectAll("."+r.cn.cellRect).attr("height",(function(t){return function(t,e){return t.rows[e-t.firstRowIndex]}(j(t),t.key).rowHeight}))}function R(t,e){for(var r=0,n=e-1;n>=0;n--)r+=B(t[n]);return r}function F(t,e){for(var r=0,n=0;ne.length&&(t=t.slice(0,e.length)):t=[],i=0;i90&&(f-=180,l=-l),{angle:f,flip:l,p:t.c2p(n,e,r),offsetMultplier:c}}}}),vw=f({"src/traces/carpet/plot.js"(t,e){var r=x(),n=Qe(),i=mw(),a=gw(),o=yw(),s=Se(),l=le(),c=l.strRotate,u=l.strTranslate,h=Me();function p(t,e,o,s,l,c,u){var h="const-"+l+"-lines",p=o.selectAll("."+h).data(c);p.enter().append("path").classed(h,!0).style("vector-effect",u?"none":"non-scaling-stroke"),p.each((function(o){var s=o,l=s.x,c=s.y,u=i([],l,t.c2p),h=i([],c,e.c2p),p="M"+a(u,h,s.smoothing);r.select(this).attr("d",p).style("stroke-width",s.width).style("stroke",s.color).style("stroke-dasharray",n.dashStyle(s.dash,s.width)).style("fill","none")})),p.exit().remove()}function f(t,e,i,a,l,h,p,f){var d=h.selectAll("text."+f).data(p);d.enter().append("text").classed(f,!0);var m=0,g={};return d.each((function(l,h){var p;if("auto"===l.axis.tickangle)p=o(a,e,i,l.xy,l.dxy);else{var f=(l.axis.tickangle+180)*Math.PI/180;p=o(a,e,i,l.xy,[Math.cos(f),Math.sin(f)])}h||(g={angle:p.angle,flip:p.flip});var d=(l.endAnchor?-1:1)*p.flip,y=r.select(this).attr({"text-anchor":d>0?"start":"end","data-notex":1}).call(n.font,l.font).text(l.text).call(s.convertToTspans,t),v=n.bBox(this);y.attr("transform",u(p.p[0],p.p[1])+c(p.angle)+u(l.axis.labelpadding*d,.3*v.height)),m=Math.max(m,v.width+l.axis.labelpadding)})),d.exit().remove(),g.maxExtent=m,g}e.exports=function(t,e,n,s){var c=t._context.staticPlot,u=e.xaxis,h=e.yaxis,d=t._fullLayout._clips;l.makeTraceGroups(s,n,"trace").each((function(e){var n=r.select(this),s=e[0],m=s.trace,y=m.aaxis,v=m.baxis,x=l.ensureSingle(n,"g","minorlayer"),_=l.ensureSingle(n,"g","majorlayer"),b=l.ensureSingle(n,"g","boundarylayer"),w=l.ensureSingle(n,"g","labellayer");n.style("opacity",m.opacity),p(u,h,_,0,"a",y._gridlines,!0),p(u,h,_,0,"b",v._gridlines,!0),p(u,h,x,0,"a",y._minorgridlines,!0),p(u,h,x,0,"b",v._minorgridlines,!0),p(u,h,b,0,"a-boundary",y._boundarylines,c),p(u,h,b,0,"b-boundary",v._boundarylines,c);var T=f(t,u,h,m,0,w,y._labels,"a-label"),A=f(t,u,h,m,0,w,v._labels,"b-label");(function(t,e,r,n,i,a,s,c){var u,h,p,f,d=l.aggNums(Math.min,null,r.a),m=l.aggNums(Math.max,null,r.a),y=l.aggNums(Math.min,null,r.b),v=l.aggNums(Math.max,null,r.b);u=.5*(d+m),h=y,p=r.ab2xy(u,h,!0),f=r.dxyda_rough(u,h),void 0===s.angle&&l.extendFlat(s,o(r,i,a,p,r.dxydb_rough(u,h))),g(t,e,r,0,p,f,r.aaxis,i,a,s,"a-title"),u=d,h=.5*(y+v),p=r.ab2xy(u,h,!0),f=r.dxydb_rough(u,h),void 0===c.angle&&l.extendFlat(c,o(r,i,a,p,r.dxyda_rough(u,h))),g(t,e,r,0,p,f,r.baxis,i,a,c,"b-title")})(t,w,m,0,u,h,T,A),function(t,e,r,n,o){var s,c,u,h,p=r.select("#"+t._clipPathId);p.size()||(p=r.append("clipPath").classed("carpetclip",!0));var f=l.ensureSingle(p,"path","carpetboundary"),d=e.clipsegments,m=[];for(h=0;h90&&v<270,_=r.select(this);_.text(p.title.text).call(s.convertToTspans,t),x&&(b=(-s.lineCount(_)+m)*d*a-b),_.attr("transform",u(e.p[0],e.p[1])+c(e.angle)+u(0,b)).attr("text-anchor","middle").call(n.font,p.title.font)})),_.exit().remove()}}}),xw=f({"src/traces/carpet/cheater_basis.js"(t,e){var r=le().isArrayOrTypedArray;e.exports=function(t,e,n){var i,a,o,s,l,c=[],u=r(t)?t.length:t,h=r(e)?e.length:e,p=r(t)?t:null,f=r(e)?e:null;p&&(o=(p.length-1)/(p[p.length-1]-p[0])/(u-1)),f&&(s=(f.length-1)/(f[f.length-1]-f[0])/(h-1));var d,m=1/0,g=-1/0;for(a=0;a=10)return null;for(var i=1/0,a=-1/0,o=t.length,s=0;s0&&(f=t.dxydi([],n-1,o,0,s),y.push(l[0]+f[0]/3),v.push(l[1]+f[1]/3),d=t.dxydi([],n-1,o,1,s),y.push(h[0]-d[0]/3),v.push(h[1]-d[1]/3)),y.push(h[0]),v.push(h[1]),l=h;else for(n=t.a2i(r),c=Math.floor(Math.max(0,Math.min(I-2,n))),u=n-c,x.length=I,x.crossLength=L,x.xy=function(e){return t.evalxy([],n,e)},x.dxy=function(e,r){return t.dxydj([],c,e,u,r)},a=0;a0&&(m=t.dxydj([],c,a-1,u,0),y.push(l[0]+m[0]/3),v.push(l[1]+m[1]/3),g=t.dxydj([],c,a-1,u,1),y.push(h[0]-g[0]/3),v.push(h[1]-g[1]/3)),y.push(h[0]),v.push(h[1]),l=h;return x.axisLetter=e,x.axis=_,x.crossAxis=k,x.value=r,x.constvar=i,x.index=p,x.x=y,x.y=v,x.smoothing=k.smoothing,x}function D(r){var n,a,o,s,l,c=[],u=[],h={};if(h.length=x.length,h.crossLength=A.length,"b"===e)for(o=Math.max(0,Math.min(L-2,r)),l=Math.min(1,Math.max(0,r-o)),h.xy=function(e){return t.evalxy([],e,r)},h.dxy=function(e,r){return t.dxydi([],e,o,r,l)},n=0;nx.length-1)&&b.push(n(D(o),{color:_.gridcolor,width:_.gridwidth,dash:_.griddash}));for(p=u;px.length-1||m<0||m>x.length-1))for(g=x[s],y=x[m],a=0;a<_.minorgridcount;a++)!((v=m-s)<=0)&&!((d=g+(y-g)*(a+1)/(_.minorgridcount+1)*(_.arraydtick/v))x[x.length-1])&&w.push(n(z(d),{color:_.minorgridcolor,width:_.minorgridwidth,dash:_.minorgriddash}));_.startline&&T.push(n(D(0),{color:_.startlinecolor,width:_.startlinewidth})),_.endline&&T.push(n(D(x.length-1),{color:_.endlinecolor,width:_.endlinewidth}))}else{for(l=5e-15,u=(c=[Math.floor((x[x.length-1]-_.tick0)/_.dtick*(1+l)),Math.ceil((x[0]-_.tick0)/_.dtick/(1+l))].sort((function(t,e){return t-e})))[0],h=c[1],p=u;p<=h;p++)f=_.tick0+_.dtick*p,b.push(n(z(f),{color:_.gridcolor,width:_.gridwidth,dash:_.griddash}));for(p=u-1;px[x.length-1])&&w.push(n(z(d),{color:_.minorgridcolor,width:_.minorgridwidth,dash:_.minorgriddash}));_.startline&&T.push(n(z(x[0]),{color:_.startlinecolor,width:_.startlinewidth})),_.endline&&T.push(n(z(x[x.length-1]),{color:_.endlinecolor,width:_.endlinewidth}))}}}}),ww=f({"src/traces/carpet/calc_labels.js"(t,e){var r=ir(),n=R().extendFlat;e.exports=function(t,e){var i,a,o,s=e._labels=[],l=e._gridlines;for(i=0;i=0;i--)a[u-i]=t[h][i],o[u-i]=e[h][i];for(s.push({x:a,y:o,bicubic:l}),i=h,a=[],o=[];i>=0;i--)a[h-i]=t[i][0],o[h-i]=e[i][0];return s.push({x:a,y:o,bicubic:c}),s}}}),Aw=f({"src/traces/carpet/smooth_fill_2d_array.js"(t,e){var r=le();e.exports=function(t,e,n){var i,a,o,s,l,c,u,h,p=[],f=[],d=t[0].length,m=t.length,g=0;for(i=0;i0&&void 0!==(c=t[l][s-1])&&(h++,u+=c),s0&&void 0!==(c=t[l-1][s])&&(h++,u+=c),l0&&a0&&i1e-5);return r.log("Smoother converged to",E,"after",C,"iterations"),t}}}),kw=f({"src/traces/carpet/constants.js"(t,e){e.exports={RELATIVE_CULL_TOLERANCE:1e-6}}}),Mw=f({"src/traces/carpet/catmull_rom.js"(t,e){e.exports=function(t,e,r,n){var i=t[0]-e[0],a=t[1]-e[1],o=r[0]-e[0],s=r[1]-e[1],l=Math.pow(i*i+a*a,.25),c=Math.pow(o*o+s*s,.25),u=(c*c*i-l*l*o)*n,h=(c*c*a-l*l*s)*n,p=c*(l+c)*3,f=l*(l+c)*3;return[[e[0]+(p&&u/p),e[1]+(p&&h/p)],[e[0]-(f&&u/f),e[1]-(f&&h/f)]]}}}),Sw=f({"src/traces/carpet/compute_control_points.js"(t,e){var r=Mw(),n=le().ensureArray;function i(t,e,r){var n=-.5*r[0]+1.5*e[0],i=-.5*r[1]+1.5*e[1];return[(2*n+t[0])/3,(2*i+t[1])/3]}e.exports=function(t,e,a,o,s,l){var c,u,h,p,f,d,m,g,y,v,x=a[0].length,_=a.length,b=s?3*x-2:x,w=l?3*_-2:_;for(t=n(t,w),e=n(e,w),h=0;hf&&tm&&ed||eg},t.setScale=function(){var e=t._x,r=t._y,n=i(t._xctrl,t._yctrl,e,r,h.smoothing,p.smoothing);t._xctrl=n[0],t._yctrl=n[1],t.evalxy=a([t._xctrl,t._yctrl],c,u,h.smoothing,p.smoothing),t.dxydi=o([t._xctrl,t._yctrl],h.smoothing,p.smoothing),t.dxydj=s([t._xctrl,t._yctrl],h.smoothing,p.smoothing)},t.i2a=function(t){var r=Math.max(0,Math.floor(t[0]),c-2),n=t[0]-r;return(1-n)*e[r]+n*e[r+1]},t.j2b=function(t){var e=Math.max(0,Math.floor(t[1]),c-2),r=t[1]-e;return(1-r)*l[e]+r*l[e+1]},t.ij2ab=function(e){return[t.i2a(e[0]),t.j2b(e[1])]},t.a2i=function(t){var r=Math.max(0,Math.min(n(t,e),c-2)),i=e[r],a=e[r+1];return Math.max(0,Math.min(c-1,r+(t-i)/(a-i)))},t.b2j=function(t){var e=Math.max(0,Math.min(n(t,l),u-2)),r=l[e],i=l[e+1];return Math.max(0,Math.min(u-1,e+(t-r)/(i-r)))},t.ab2ij=function(e){return[t.a2i(e[0]),t.b2j(e[1])]},t.i2c=function(e,r){return t.evalxy([],e,r)},t.ab2xy=function(r,n,i){if(!i&&(re[c-1]|nl[u-1]))return[!1,!1];var a=t.a2i(r),o=t.b2j(n),s=t.evalxy([],a,o);if(i){var h,p,f,d,m=0,g=0,y=[];re[c-1]?(h=c-2,p=1,m=(r-e[c-1])/(e[c-1]-e[c-2])):p=a-(h=Math.max(0,Math.min(c-2,Math.floor(a)))),nl[u-1]?(f=u-2,d=1,g=(n-l[u-1])/(l[u-1]-l[u-2])):d=o-(f=Math.max(0,Math.min(u-2,Math.floor(o)))),m&&(t.dxydi(y,h,f,p,d),s[0]+=y[0]*m,s[1]+=y[1]*m),g&&(t.dxydj(y,h,f,p,d),s[0]+=y[0]*g,s[1]+=y[1]*g)}return s},t.c2p=function(t,e,r){return[e.c2p(t[0]),r.c2p(t[1])]},t.p2x=function(t,e,r){return[e.p2c(t[0]),r.p2c(t[1])]},t.dadi=function(t){var r=Math.max(0,Math.min(e.length-2,t));return e[r+1]-e[r]},t.dbdj=function(t){var e=Math.max(0,Math.min(l.length-2,t));return l[e+1]-l[e]},t.dxyda=function(e,r,n,i){var a=t.dxydi(null,e,r,n,i),o=t.dadi(e,n);return[a[0]/o,a[1]/o]},t.dxydb=function(e,r,n,i){var a=t.dxydj(null,e,r,n,i),o=t.dbdj(r,i);return[a[0]/o,a[1]/o]},t.dxyda_rough=function(e,r,n){var i=y*(n||.1),a=t.ab2xy(e+i,r,!0),o=t.ab2xy(e-i,r,!0);return[.5*(a[0]-o[0])/i,.5*(a[1]-o[1])/i]},t.dxydb_rough=function(e,r,n){var i=v*(n||.1),a=t.ab2xy(e,r+i,!0),o=t.ab2xy(e,r-i,!0);return[.5*(a[0]-o[0])/i,.5*(a[1]-o[1])/i]},t.dpdx=function(t){return t._m},t.dpdy=function(t){return t._m}}}}),Pw=f({"src/traces/carpet/calc.js"(t,e){var r=ir(),n=le().isArray1D,i=xw(),a=_w(),o=bw(),s=ww(),l=Tw(),c=zo(),u=Aw(),h=Po(),p=Lw();e.exports=function(t,e){var f=r.getFromId(t,e.xaxis),d=r.getFromId(t,e.yaxis),m=e.aaxis,g=e.baxis,y=e.x,v=e.y,x=[];y&&n(y)&&x.push("x"),v&&n(v)&&x.push("y"),x.length&&h(e,m,g,"a","b",x);var _=e._a=e._a||e.a,b=e._b=e._b||e.b;y=e._x||e.x,v=e._y||e.y;var w={};if(e._cheater){var T="index"===m.cheatertype?_.length:_,A="index"===g.cheatertype?b.length:b;y=i(T,A,e.cheaterslope)}e._x=y=c(y),e._y=v=c(v),u(y,_,b),u(v,_,b),p(e),e.setScale();var k=a(y),M=a(v),S=.5*(k[1]-k[0]),E=.5*(k[1]+k[0]),C=.5*(M[1]-M[0]),I=.5*(M[1]+M[0]),L=1.3;return k=[E-S*L,E+S*L],M=[I-C*L,I+C*L],e._extremes[f._id]=r.findExtremes(f,k,{padded:!0}),e._extremes[d._id]=r.findExtremes(d,M,{padded:!0}),o(e,"a","b"),o(e,"b","a"),s(e,m),s(e,g),w.clipsegments=l(e._xctrl,e._yctrl,m,g),w.x=y,w.y=v,w.a=_,w.b=b,[w]}}}),zw=f({"src/traces/carpet/index.js"(t,e){e.exports={attributes:uw(),supplyDefaults:dw(),plot:vw(),calc:Pw(),animatable:!0,isContainer:!0,moduleType:"trace",name:"carpet",basePlotModule:Si(),categories:["cartesian","svg","carpet","carpetAxis","notLegendIsolatable","noMultiCategory","noHover","noSortingByValue"],meta:{}}}}),Dw=f({"lib/carpet.js"(t,e){e.exports=zw()}}),Ow=f({"src/traces/scattercarpet/attributes.js"(t,e){var r=wn(),n=Tn(),i=U(),a=Ot().hovertemplateAttrs,o=Ot().texttemplateAttrs,s=Pe(),l=R().extendFlat,c=n.marker,u=n.line,h=c.line;e.exports={carpet:{valType:"string",editType:"calc"},a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},mode:l({},n.mode,{dflt:"markers"}),text:l({},n.text,{}),texttemplate:o({editType:"plot"},{keys:["a","b","text"]}),hovertext:l({},n.hovertext,{}),line:{color:u.color,width:u.width,dash:u.dash,backoff:u.backoff,shape:l({},u.shape,{values:["linear","spline"]}),smoothing:u.smoothing,editType:"calc"},connectgaps:n.connectgaps,fill:l({},n.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:r(),marker:l({symbol:c.symbol,opacity:c.opacity,maxdisplayed:c.maxdisplayed,angle:c.angle,angleref:c.angleref,standoff:c.standoff,size:c.size,sizeref:c.sizeref,sizemin:c.sizemin,sizemode:c.sizemode,line:l({width:h.width,editType:"calc"},s("marker.line")),gradient:c.gradient,editType:"calc"},s("marker")),textfont:n.textfont,textposition:n.textposition,selected:n.selected,unselected:n.unselected,hoverinfo:l({},i.hoverinfo,{flags:["a","b","text","name"]}),hoveron:n.hoveron,hovertemplate:a(),zorder:n.zorder}}}),Rw=f({"src/traces/scattercarpet/defaults.js"(t,e){var r=le(),n=bn(),i=Ye(),a=Zn(),o=Yn(),s=Xn(),l=$n(),c=Kn(),u=Ow();e.exports=function(t,e,h,p){function f(n,i){return r.coerce(t,e,u,n,i)}f("carpet"),e.xaxis="x",e.yaxis="y";var d=f("a"),m=f("b"),g=Math.min(d.length,m.length);if(g){e._length=g,f("text"),f("texttemplate"),f("hovertext"),f("mode",g")}return o}function v(t,e){var r;r=t.labelprefix&&t.labelprefix.length>0?t.labelprefix.replace(/ = $/,""):t._hovertitle,g.push(r+": "+e.toFixed(3)+t.labelsuffix)}}}}),Vw=f({"src/traces/scattercarpet/event_data.js"(t,e){e.exports=function(t,e,r,n,i){var a=n[i];return t.a=a.a,t.b=a.b,t.y=a.y,t}}}),qw=f({"src/traces/scattercarpet/index.js"(t,e){e.exports={attributes:Ow(),supplyDefaults:Rw(),colorbar:fi(),formatLabels:Fw(),calc:jw(),plot:Nw(),style:mi().style,styleOnSelect:mi().styleOnSelect,hoverPoints:Uw(),selectPoints:vi(),eventData:Vw(),moduleType:"trace",name:"scattercarpet",basePlotModule:Si(),categories:["svg","carpet","symbols","showLegend","carpetDependent","zoomScale"],meta:{}}}}),Hw=f({"lib/scattercarpet.js"(t,e){e.exports=qw()}}),Gw=f({"src/traces/contourcarpet/attributes.js"(t,e){var r=bo(),n=ls(),i=Pe(),a=R().extendFlat,o=n.contours;e.exports=a({carpet:{valType:"string",editType:"calc"},z:r.z,a:r.x,a0:r.x0,da:r.dx,b:r.y,b0:r.y0,db:r.dy,text:r.text,hovertext:r.hovertext,transpose:r.transpose,atype:r.xtype,btype:r.ytype,fillcolor:n.fillcolor,autocontour:n.autocontour,ncontours:n.ncontours,contours:{type:o.type,start:o.start,end:o.end,size:o.size,coloring:{valType:"enumerated",values:["fill","lines","none"],dflt:"fill",editType:"calc"},showlines:o.showlines,showlabels:o.showlabels,labelfont:o.labelfont,labelformat:o.labelformat,operation:o.operation,value:o.value,editType:"calc",impliedEdits:{autocontour:!1}},line:{color:n.line.color,width:n.line.width,dash:n.line.dash,smoothing:n.line.smoothing,editType:"plot"},zorder:n.zorder},i("",{cLetter:"z",autoColorDflt:!1}))}}),Ww=f({"src/traces/contourcarpet/defaults.js"(t,e){var r=le(),n=wo(),i=Gw(),a=Ls(),o=us(),s=ps();e.exports=function(t,e,l,c){function u(n,a){return r.coerce(t,e,i,n,a)}if(u("carpet"),t.a&&t.b){if(!n(t,e,u,c,"a","b"))return void(e.visible=!1);u("text"),"constraint"===u("contours.type")?a(t,e,u,c,l,{hasHover:!1}):(o(t,e,u,(function(n){return r.coerce2(t,e,i,n)})),s(t,e,u,c,{hasHover:!1}))}else e._defaultColor=l,e._length=null;u("zorder")}}}),Zw=f({"src/traces/contourcarpet/calc.js"(t,e){var r=We(),n=le(),i=Po(),a=zo(),o=Do(),s=Oo(),l=Ro(),c=Ww(),u=Bw(),h=ds();e.exports=function(t,e){var p=e._carpetTrace=u(t,e);if(p&&p.visible&&"legendonly"!==p.visible){if(!e.a||!e.b){var f=t.data[p.index],d=t.data[e.index];d.a||(d.a=f.a),d.b||(d.b=f.b),c(d,e,e._defaultColor,t._fullLayout)}var m=function(t,e){var c,u,h,p,f,d,m,g=e._carpetTrace,y=g.aaxis,v=g.baxis;y._minDtick=0,v._minDtick=0,n.isArray1D(e.z)&&i(e,y,v,"a","b",["z"]),c=e._a=e._a||e.a,p=e._b=e._b||e.b,c=c?y.makeCalcdata(e,"_a"):[],p=p?v.makeCalcdata(e,"_b"):[],u=e.a0||0,h=e.da||1,f=e.b0||0,d=e.db||1,m=e._z=a(e._z||e.z,e.transpose),e._emptypoints=s(m),o(m,e._emptypoints);var x=n.maxRowLength(m),_="scaled"===e.xtype?"":c,b=l(e,_,u,h,x,y),w="scaled"===e.ytype?"":p,T={a:b,b:l(e,w,f,d,m.length,v),z:m};return"levels"===e.contours.type&&"none"!==e.contours.coloring&&r(t,e,{vals:m,containerStr:"",cLetter:"z"}),[T]}(t,e);return h(e,e._z),m}}}}),Yw=f({"src/traces/carpet/axis_aligned_line.js"(t,e){var r=le().isArrayOrTypedArray;e.exports=function(t,e,n,i){var a,o,s,l,c,u,h,p,f,d,m,g,y,v=r(n)?"a":"b",x=("a"===v?t.aaxis:t.baxis).smoothing,_="a"===v?t.a2i:t.b2j,b="a"===v?n:i,w="a"===v?i:n,T="a"===v?e.a.length:e.b.length,A="a"===v?e.b.length:e.a.length,k=Math.floor("a"===v?t.b2j(w):t.a2i(w)),M="a"===v?function(e){return t.evalxy([],e,k)}:function(e){return t.evalxy([],k,e)};x&&(s=Math.max(0,Math.min(A-2,k)),l=k-s,o="a"===v?function(e,r){return t.dxydi([],e,s,r,l)}:function(e,r){return t.dxydj([],s,e,l,r)});var S=_(b[0]),E=_(b[1]),C=S0?Math.floor:Math.ceil,P=C>0?Math.ceil:Math.floor,z=C>0?Math.min:Math.max,D=C>0?Math.max:Math.min,O=L(S+I),R=P(E-I),F=[[h=M(S)]];for(a=O;a*C=0;U--)B=M.clipsegments[U],j=n([],B.x,b.c2p),N=n([],B.y,w.c2p),j.reverse(),N.reverse(),V.push(i(j,N,B.bicubic));var q="M"+V.join("L")+"Z";(function(t,e,r,a,s,l){var c,u,h,p,f=o.ensureSingle(t,"g","contourbg").selectAll("path").data("fill"!==l||s?[]:[0]);f.enter().append("path"),f.exit().remove();var d=[];for(p=0;p=0&&(p=C,d=g):Math.abs(h[1]-p[1])=0&&(p=C,d=g):o.log("endpt to newendpt is not vert. or horz.",h,p,C)}if(d>=0)break;v+=S(h,p),h=p}if(d===e.edgepaths.length){o.log("unclosed perimeter path");break}u=d,(_=-1===x.indexOf(u))&&(u=x[0],v+=S(h,p)+"Z",h=null)}for(u=0;um&&(n.max=m),n.len=n.max-n.min}function x(t,e){var r,n=0,o=.1;return(Math.abs(t[0]-l)y):g=k>w,y=k;var M=c(w,T,A,k);M.pos=b,M.yc=(w+k)/2,M.i=_,M.dir=g?"increasing":"decreasing",M.x=M.pos,M.y=[A,T],v&&(M.orig_p=a[_]),d&&(M.tx=e.text[_]),m&&(M.htx=e.hovertext[_]),x.push(M)}else x.push({pos:b,empty:!0})}return e._extremes[l._id]=i.findExtremes(l,r.concat(p,h),{padded:!0}),x.length&&(x[0].t={labels:{open:n(t,"open:")+" ",high:n(t,"high:")+" ",low:n(t,"low:")+" ",close:n(t,"close:")+" "}}),x}e.exports={calc:function(t,e){var n=i.getFromId(t,e.xaxis),o=i.getFromId(t,e.yaxis),c=function(t,e,n){var i=n._minDiff;if(!i){var o,s=t._fullData,l=[];for(i=1/0,o=0;o"+u.labels[x]+r.hoverLabelText(s,_,l.yhoverformat):((v=n.extendFlat({},p)).y0=v.y1=b,v.yLabelVal=_,v.yLabel=u.labels[x]+r.hoverLabelText(s,_,l.yhoverformat),v.name="",h.push(v),g[_]=v)}return h}function h(t,e,n,i){var a=t.cd,s=t.ya,u=a[0].trace,h=a[0].t,p=c(t,e,n,i);if(!p)return[];var f=a[p.index],d=p.index=f.i,m=f.dir;function g(t){return h.labels[t]+r.hoverLabelText(s,u[t][d],u.yhoverformat)}var y=f.hi||u.hoverinfo,v=y.split("+"),x="all"===y,_=x||-1!==v.indexOf("y"),b=x||-1!==v.indexOf("text"),w=_?[g("open"),g("high"),g("low"),g("close")+" "+l[m]]:[];return b&&o(f,u,w),p.extraText=w.join("
"),p.y0=p.y1=s.c2p(f.yc,!0),[p]}e.exports={hoverPoints:function(t,e,r,n){return t.cd[0].trace.hoverlabel.split?u(t,e,r,n):h(t,e,r,n)},hoverSplit:u,hoverOnPoints:h}}}),aT=f({"src/traces/ohlc/select.js"(t,e){e.exports=function(t,e){var r,n=t.cd,i=t.xaxis,a=t.yaxis,o=[],s=n[0].t.bPos||0;if(!1===e)for(r=0;rn?function(t){return t<=0}:function(t){return t>=0};t.c2g=function(r){var n=t.c2l(r)-e;return(s(n)?n:0)+o},t.g2c=function(r){return t.l2c(r+e-o)},t.g2p=function(t){return t*a},t.c2p=function(e){return t.g2p(t.c2g(e))}}}(t,e);break;case"angularaxis":!function(t,e){var n=t.type;if("linear"===n){var o=t.d2c,s=t.c2d;t.d2c=function(t,e){return function(t,e){return"degrees"===e?i(t):t}(o(t),e)},t.c2d=function(t,e){return s(function(t,e){return"degrees"===e?a(t):t}(t,e))}}t.makeCalcdata=function(e,r){var n,i,a=e[r],o=e._length,s=function(r){return t.d2c(r,e.thetaunit)};if(a)for(n=new Array(o),i=0;i1e-10?t:0}function h(t,e,r){e=e||0,r=r||0;for(var n=t.length,i=new Array(n),a=0;a0?r:1/0})),a=r.mod(n+1,e.length);return[e[n],e[a]]},findIntersectionXY:l,findXYatLength:function(t,e,r,n){var i=-e*r,a=e*e+1,o=2*(e*i-r),s=i*i+r*r-t*t,l=Math.sqrt(o*o-4*a*s),c=(-o+l)/(2*a),u=(-o-l)/(2*a);return[[c,e*c+i+n],[u,e*u+i+n]]},clampTiny:u,pathPolygon:function(t,e,r,n,i,a){return"M"+h(c(t,e,r,n),i,a).join("L")},pathPolygonAnnulus:function(t,e,r,n,i,a,o){var s,l;t0?1:0}function n(t){var e=t[0],r=t[1];if(!isFinite(e)||!isFinite(r))return[1,0];var n=(e+1)*(e+1)+r*r;return[(e*e+r*r-1)/n,2*r/n]}function i(t,e){var r=e[0],n=e[1];return[r*t.radius+t.cx,-n*t.radius+t.cy]}function a(t,e){return e*t.radius}e.exports={smith:n,reactanceArc:function(t,e,r,o){var s=i(t,n([r,e])),l=s[0],c=s[1],u=i(t,n([o,e])),h=u[0],p=u[1];if(0===e)return["M"+l+","+c,"L"+h+","+p].join(" ");var f=a(t,1/Math.abs(e));return["M"+l+","+c,"A"+f+","+f+" 0 0,"+(e<0?1:0)+" "+h+","+p].join(" ")},resistanceArc:function(t,e,o,s){var l=a(t,1/(e+1)),c=i(t,n([e,o])),u=c[0],h=c[1],p=i(t,n([e,s])),f=p[0],d=p[1];if(r(o)!==r(s)){var m=i(t,n([e,0]));return["M"+u+","+h,"A"+l+","+l+" 0 0,"+(0=90||i>90&&a>=450?1:s<=0&&c<=0?0:Math.max(s,c),[i<=180&&a>=180||i>180&&a>=540?-1:o>=0&&l>=0?0:Math.min(o,l),i<=270&&a>=270||i>270&&a>=630?-1:s>=0&&c>=0?0:Math.min(s,c),a>=360?1:o<=0&&l<=0?0:Math.max(o,l),e]}(d),b=_[2]-_[0],w=_[3]-_[1],T=f/p,A=Math.abs(w/b);T>A?(m=p,x=(f-(g=p*A))/i.h/2,y=[u[0],u[1]],v=[h[0]+x,h[1]-x]):(g=f,x=(p-(m=f/A))/i.w/2,y=[u[0]+x,u[1]-x],v=[h[0],h[1]]),r.xLength2=m,r.yLength2=g,r.xDomain2=y,r.yDomain2=v;var k,M=r.xOffset2=i.l+i.w*y[0],S=r.yOffset2=i.t+i.h*(1-v[1]),E=r.radius=m/b,C=r.innerRadius=r.getHole(e)*E,I=r.cx=M-E*_[0],L=r.cy=S+E*_[3],P=r.cxx=I-M,z=r.cyy=L-S,D=a.side;"counterclockwise"===D?(k=D,D="top"):"clockwise"===D&&(k=D,D="bottom"),r.radialAxis=r.mockAxis(t,e,a,{_id:"x",side:D,_trueSide:k,domain:[C/i.w,E/i.w]}),r.angularAxis=r.mockAxis(t,e,o,{side:"right",domain:[0,Math.PI],autorange:!1}),r.doAutoRange(t,e),r.updateAngularAxis(t,e),r.updateRadialAxis(t,e),r.updateRadialAxisTitle(t,e),r.xaxis=r.mockCartesianAxis(t,e,{_id:"x",domain:y}),r.yaxis=r.mockCartesianAxis(t,e,{_id:"y",domain:v});var O=r.pathSubplot();r.clipPaths.forTraces.select("path").attr("d",O).attr("transform",s(P,z)),n.frontplot.attr("transform",s(M,S)).call(c.setClipUrl,r._hasClipOnAxisFalse?null:r.clipIds.forTraces,r.gd),n.bg.attr("d",O).attr("transform",s(I,L)).call(l.fill,e.bgcolor)},N.mockAxis=function(t,e,r,n){var i=a.extendFlat({},r,n);return f(i,e,t),i},N.mockCartesianAxis=function(t,e,r){var n=this,i=n.isSmith,o=r._id,s=a.extendFlat({type:"linear"},r);p(s,t);var l={x:[0,2],y:[1,3]};return s.setRange=function(){var t=n.sectorBBox,r=l[o],i=n.radialAxis._rl,a=(i[1]-i[0])/(1-n.getHole(e));s.range=[t[r[0]]*a,t[r[1]]*a]},s.isPtWithinRange="x"!==o||i?function(){return!0}:function(t){return n.isPtInside(t)},s.setRange(),s.setScale(),s},N.doAutoRange=function(t,e){var r=this,n=r.gd,i=r.radialAxis,a=r.getRadial(e);d(n,i);var o=i.range;if(a.range=o.slice(),a._input.range=o.slice(),i._rl=[i.r2l(o[0],null,"gregorian"),i.r2l(o[1],null,"gregorian")],void 0!==i.minallowed){var s=i.r2l(i.minallowed);i._rl[0]>i._rl[1]?i._rl[1]=Math.max(i._rl[1],s):i._rl[0]=Math.max(i._rl[0],s)}if(void 0!==i.maxallowed){var l=i.r2l(i.maxallowed);i._rl[0]90&&m<=270&&(g.tickangle=180);var x=v?function(t){var e=z(r,I([t.x,0]));return s(e[0]-p,e[1]-f)}:function(t){return s(g.l2p(t.x)+u,0)},_=v?function(t){return P(r,t.x,-1/0,1/0)}:function(t){return r.pathArc(g.r2p(t.x)+u)},b=U(d);if(r.radialTickLayout!==b&&(i["radial-axis"].selectAll(".xtick").remove(),r.radialTickLayout=b),y){g.setScale();var w=0,T=v?(g.tickvals||[]).filter((function(t){return t>=0})).map((function(t){return h.tickText(g,t,!0,!1)})):h.calcTicks(g),A=v?T:h.clipEnds(g,T),k=h.getTickSigns(g)[2];v&&(("top"===g.ticks&&"bottom"===g.side||"bottom"===g.ticks&&"top"===g.side)&&(k=-k),"top"===g.ticks&&"top"===g.side&&(w=-g.ticklen),"bottom"===g.ticks&&"bottom"===g.side&&(w=g.ticklen)),h.drawTicks(n,g,{vals:T,layer:i["radial-axis"],path:h.makeTickPath(g,0,k),transFn:x,crisp:!1}),h.drawGrid(n,g,{vals:A,layer:i["radial-grid"],path:_,transFn:a.noop,crisp:!1}),h.drawLabels(n,g,{vals:T,layer:i["radial-axis"],transFn:x,labelFns:h.makeLabelFns(g,w)})}var M=r.radialAxisAngle=r.vangles?B(V(F(d.angle),r.vangles)):d.angle,S=s(p,f),E=S+o(-M);q(i["radial-axis"],y&&(d.showticklabels||d.ticks),{transform:E}),q(i["radial-grid"],y&&d.showgrid,{transform:v?"":S}),q(i["radial-line"].select("line"),y&&d.showline,{x1:v?-c:u,y1:0,x2:c,y2:0,transform:E}).attr("stroke-width",d.linewidth).call(l.stroke,d.linecolor)},N.updateRadialAxisTitle=function(t,e,r){if(!this.isSmith){var n=this,i=n.gd,a=n.radius,o=n.cx,s=n.cy,l=n.getRadial(e),u=n.id+"title",h=0;if(l.title){var p=c.bBox(n.layers["radial-axis"].node()).height,f=l.title.font.size,d=l.side;h="top"===d?f:"counterclockwise"===d?-(p+.4*f):p+.8*f}var m=void 0!==r?r:n.radialAxisAngle,g=F(m),y=Math.cos(g),x=Math.sin(g),_=o+a/2*y+h*x,b=s-a/2*x+h*y;n.layers["radial-axis-title"]=v.draw(i,u,{propContainer:l,propName:n.id+".radialaxis.title",placeholder:D(i,"Click to enter radial axis title"),attributes:{x:_,y:b,"text-anchor":"middle"},transform:{rotate:-m}})}},N.updateAngularAxis=function(t,e){var r=this,n=r.gd,i=r.layers,c=r.radius,u=r.innerRadius,p=r.cx,f=r.cy,d=r.getAngular(e),m=r.angularAxis,g=r.isSmith;g||(r.fillViewInitialKey("angularaxis.rotation",d.rotation),m.setGeometry(),m.setScale());var y=g?function(t){var e=z(r,I([0,t.x]));return Math.atan2(e[0]-p,e[1]-f)-Math.PI/2}:function(t){return m.t2g(t.x)};"linear"===m.type&&"radians"===m.thetaunit&&(m.tick0=B(m.tick0),m.dtick=B(m.dtick));var v=function(t){return s(p+c*Math.cos(t),f-c*Math.sin(t))},x=g?function(t){var e=z(r,I([0,t.x]));return s(e[0],e[1])}:function(t){return v(y(t))},_=g?function(t){var e=z(r,I([0,t.x])),n=Math.atan2(e[0]-p,e[1]-f)-Math.PI/2;return s(e[0],e[1])+o(-B(n))}:function(t){var e=y(t);return v(e)+o(-B(e))},b=g?function(t){return L(r,t.x,0,1/0)}:function(t){var e=y(t),r=Math.cos(e),n=Math.sin(e);return"M"+[p+u*r,f-u*n]+"L"+[p+c*r,f-c*n]},w=h.makeLabelFns(m,0).labelStandoff,T={xFn:function(t){var e=y(t);return Math.cos(e)*w},yFn:function(t){var e=y(t),r=Math.sin(e)>0?.2:1;return-Math.sin(e)*(w+t.fontSize*r)+Math.abs(Math.cos(e))*(t.fontSize*M)},anchorFn:function(t){var e=y(t),r=Math.cos(e);return Math.abs(r)<.1?"middle":r>0?"start":"end"},heightFn:function(t,e,r){var n=y(t);return-.5*(1+Math.sin(n))*r}},A=U(d);r.angularTickLayout!==A&&(i["angular-axis"].selectAll("."+m._id+"tick").remove(),r.angularTickLayout=A);var k,S=g?[1/0].concat(m.tickvals||[]).map((function(t){return h.tickText(m,t,!0,!1)})):h.calcTicks(m);if(g&&(S[0].text="∞",S[0].fontSize*=1.75),"linear"===e.gridshape?(k=S.map(y),a.angleDelta(k[0],k[1])<0&&(k=k.slice().reverse())):k=null,r.vangles=k,"category"===m.type&&(S=S.filter((function(t){return a.isAngleInsideSector(y(t),r.sectorInRad)}))),m.visible){var E="inside"===m.ticks?-1:1,C=(m.linewidth||1)/2;h.drawTicks(n,m,{vals:S,layer:i["angular-axis"],path:"M"+E*C+",0h"+E*m.ticklen,transFn:_,crisp:!1}),h.drawGrid(n,m,{vals:S,layer:i["angular-grid"],path:b,transFn:a.noop,crisp:!1}),h.drawLabels(n,m,{vals:S,layer:i["angular-axis"],repositionOnUpdate:!0,transFn:x,labelFns:T})}q(i["angular-line"].select("path"),d.showline,{d:r.pathSubplot(),transform:s(p,f)}).attr("stroke-width",d.linewidth).call(l.stroke,d.linecolor)},N.updateFx=function(t,e){this.gd._context.staticPlot||(!this.isSmith&&(this.updateAngularDrag(t),this.updateRadialDrag(t,e,0),this.updateRadialDrag(t,e,1)),this.updateHoverAndMainDrag(t))},N.updateHoverAndMainDrag=function(t){var e,o,l=this,c=l.isSmith,u=l.gd,h=l.layers,p=t._zoomlayer,f=S.MINZOOM,d=S.OFFEDGE,v=l.radius,x=l.innerRadius,T=l.cx,A=l.cy,k=l.cxx,M=l.cyy,C=l.sectorInRad,I=l.vangles,L=l.radialAxis,P=E.clampTiny,z=E.findXYatLength,D=E.findEnclosingVertexAngles,O=S.cornerHalfWidth,R=S.cornerLen/2,F=m.makeDragger(h,"path","maindrag",!1===t.dragmode?"none":"crosshair");r.select(F).attr("d",l.pathSubplot()).attr("transform",s(T,A)),F.onmousemove=function(t){y.hover(u,t,l.id),u._fullLayout._lasthover=F,u._fullLayout._hoversubplot=l.id},F.onmouseout=function(t){u._dragging||g.unhover(u,t)};var B,j,N,U,V,q,H,G,W,Z={element:F,gd:u,subplot:l.id,plotinfo:{id:l.id,xaxis:l.xaxis,yaxis:l.yaxis},xaxes:[l.xaxis],yaxes:[l.yaxis]};function Y(t,e){return Math.sqrt(t*t+e*e)}function X(t,e){return Y(t-k,e-M)}function $(t,e){return Math.atan2(M-e,t-k)}function K(t,e){return[t*Math.cos(e),t*Math.sin(-e)]}function J(t,e){if(0===t)return l.pathSector(2*O);var r=R/t,n=e-r,i=e+r,a=Math.max(0,Math.min(t,v)),o=a-O,s=a+O;return"M"+K(o,n)+"A"+[o,o]+" 0,0,0 "+K(o,i)+"L"+K(s,i)+"A"+[s,s]+" 0,0,1 "+K(s,n)+"Z"}function Q(t,e,r){if(0===t)return l.pathSector(2*O);var n,i,a=K(t,e),o=K(t,r),s=P((a[0]+o[0])/2),c=P((a[1]+o[1])/2);if(s&&c){var u=c/s,h=-1/u,p=z(O,u,s,c);n=z(R,h,p[0][0],p[0][1]),i=z(R,h,p[1][0],p[1][1])}else{var f,d;c?(f=R,d=O):(f=O,d=R),n=[[s-f,c-d],[s+f,c-d]],i=[[s-f,c+d],[s+f,c+d]]}return"M"+n.join("L")+"L"+i.reverse().join("L")+"Z"}function tt(t,e){return e=Math.max(Math.min(e,v),x),tf?(t-1&&1===t&&b(e,u,[l.xaxis],[l.yaxis],l.id,Z),r.indexOf("event")>-1&&y.click(u,e,l.id)}Z.prepFn=function(t,r,i){var s=u._fullLayout.dragmode,h=F.getBoundingClientRect();u._fullLayout._calcInverseTransform(u);var f=u._fullLayout._invTransform;e=u._fullLayout._invScaleX,o=u._fullLayout._invScaleY;var d=a.apply3DTransform(f)(r-h.left,i-h.top);if(B=d[0],j=d[1],I){var g=E.findPolygonOffset(v,C[0],C[1],I);B+=k+g[0],j+=M+g[1]}switch(s){case"zoom":Z.clickFn=st,c||(Z.moveFn=I?it:rt,Z.doneFn=at,function(){N=null,U=null,V=l.pathSubplot(),q=!1;var t=u._fullLayout[l.id];H=n(t.bgcolor).getLuminance(),(G=m.makeZoombox(p,H,T,A,V)).attr("fill-rule","evenodd"),W=m.makeCorners(p,T,A),w(u)}());break;case"select":case"lasso":_(t,r,i,Z,s)}},g.init(Z)},N.updateRadialDrag=function(t,e,n){var l=this,c=l.gd,u=l.layers,h=l.radius,p=l.innerRadius,f=l.cx,d=l.cy,y=l.radialAxis,v=S.radialDragBoxSize,x=v/2;if(y.visible){var _,b,T,M=F(l.radialAxisAngle),E=y._rl,C=E[0],I=E[1],L=E[n],P=.75*(E[1]-E[0])/(1-l.getHole(e))/h;n?(_=f+(h+x)*Math.cos(M),b=d-(h+x)*Math.sin(M),T="radialdrag"):(_=f+(p-x)*Math.cos(M),b=d-(p-x)*Math.sin(M),T="radialdrag-inner");var z,D,O,R=m.makeRectDragger(u,T,"crosshair",-x,-x,v,v),j={element:R,gd:c};!1===t.dragmode&&(j.dragmode=!1),q(r.select(R),y.visible&&p0==(n?O>C:O")}}e.exports={hoverPoints:function(t,e,i,a){var o=r(t,e,i,a);if(o&&!1!==o[0].index){var s=o[0];if(void 0===s.index)return o;var l=t.subplot,c=s.cd[s.index],u=s.trace;if(l.isPtInside(c))return s.xLabelVal=void 0,s.yLabelVal=void 0,n(c,u,l,s),s.hovertemplate=u.hovertemplate,o}},makeHoverPointText:n}}}),ST=f({"src/traces/scatterpolar/index.js"(t,e){e.exports={moduleType:"trace",name:"scatterpolar",basePlotModule:_T(),categories:["polar","symbols","showLegend","scatter-like"],attributes:bT(),supplyDefaults:wT().supplyDefaults,colorbar:fi(),formatLabels:TT(),calc:AT(),plot:kT(),style:mi().style,styleOnSelect:mi().styleOnSelect,hoverPoints:MT().hoverPoints,selectPoints:vi(),meta:{}}}}),ET=f({"lib/scatterpolar.js"(t,e){e.exports=ST()}}),CT=f({"src/traces/scatterpolargl/attributes.js"(t,e){var r=bT(),n=Ig(),i=Ot().texttemplateAttrs;e.exports={mode:r.mode,r:r.r,theta:r.theta,r0:r.r0,dr:r.dr,theta0:r.theta0,dtheta:r.dtheta,thetaunit:r.thetaunit,text:r.text,texttemplate:i({editType:"plot"},{keys:["r","theta","text"]}),hovertext:r.hovertext,hovertemplate:r.hovertemplate,line:{color:n.line.color,width:n.line.width,dash:n.line.dash,editType:"calc"},connectgaps:n.connectgaps,marker:n.marker,fill:n.fill,fillcolor:n.fillcolor,textposition:n.textposition,textfont:n.textfont,hoverinfo:r.hoverinfo,selected:r.selected,unselected:r.unselected}}}),IT=f({"src/traces/scatterpolargl/defaults.js"(t,e){var r=le(),n=Ye(),i=wT().handleRThetaDefaults,a=Zn(),o=Yn(),s=$n(),l=Kn(),c=bn().PTS_LINESONLY,u=CT();e.exports=function(t,e,h,p){function f(n,i){return r.coerce(t,e,u,n,i)}var d=i(t,e,p,f);d?(f("thetaunit"),f("mode",d=l&&(v.marker.cluster=d.tree),v.marker&&(v.markerSel.positions=v.markerUnsel.positions=v.marker.positions=b),v.line&&b.length>1&&s.extendFlat(v.line,o.linePositions(t,f,b)),v.text&&(s.extendFlat(v.text,{positions:b},o.textPosition(t,f,v.text,v.marker)),s.extendFlat(v.textSel,{positions:b},o.textPosition(t,f,v.text,v.markerSel)),s.extendFlat(v.textUnsel,{positions:b},o.textPosition(t,f,v.text,v.markerUnsel))),v.fill&&!p.fill2d&&(p.fill2d=!0),v.marker&&!p.scatter2d&&(p.scatter2d=!0),v.line&&!p.line2d&&(p.line2d=!0),v.text&&!p.glText&&(p.glText=!0),p.lineOptions.push(v.line),p.fillOptions.push(v.fill),p.markerOptions.push(v.marker),p.markerSelectedOptions.push(v.markerSel),p.markerUnselectedOptions.push(v.markerUnsel),p.textOptions.push(v.text),p.textSelectedOptions.push(v.textSel),p.textUnselectedOptions.push(v.textUnsel),p.selectBatch.push([]),p.unselectBatch.push([]),d.x=w,d.y=T,d.rawx=w,d.rawy=T,d.r=g,d.theta=y,d.positions=b,d._scene=p,d.index=p.count,p.count++}})),i(t,e,c)}},e.exports.reglPrecompiled={}}}),RT=f({"src/traces/scatterpolargl/index.js"(t,e){var r=DT();r.plot=OT(),e.exports=r}}),FT=f({"lib/scatterpolargl.js"(t,e){e.exports=RT()}}),BT=f({"src/traces/barpolar/attributes.js"(t,e){var r,n=Ot().hovertemplateAttrs,i=R().extendFlat,a=bT(),o=Ga();e.exports={r:a.r,theta:a.theta,r0:a.r0,dr:a.dr,theta0:a.theta0,dtheta:a.dtheta,thetaunit:a.thetaunit,base:i({},o.base,{}),offset:i({},o.offset,{}),width:i({},o.width,{}),text:i({},o.text,{}),hovertext:i({},o.hovertext,{}),marker:(r=i({},o.marker),delete r.cornerradius,r),hoverinfo:a.hoverinfo,hovertemplate:n(),selected:o.selected,unselected:o.unselected}}}),jT=f({"src/traces/barpolar/layout_attributes.js"(t,e){e.exports={barmode:{valType:"enumerated",values:["stack","overlay"],dflt:"stack",editType:"calc"},bargap:{valType:"number",dflt:.1,min:0,max:1,editType:"calc"}}}}),NT=f({"src/traces/barpolar/defaults.js"(t,e){var r=le(),n=wT().handleRThetaDefaults,i=Za(),a=BT();e.exports=function(t,e,o,s){function l(n,i){return r.coerce(t,e,a,n,i)}n(t,e,s,l)?(l("thetaunit"),l("base"),l("offset"),l("width"),l("text"),l("hovertext"),l("hovertemplate"),i(t,e,l,o,s),r.coerceSelectionMarkerOpacity(e,l)):e.visible=!1}}}),UT=f({"src/traces/barpolar/layout_defaults.js"(t,e){var r=le(),n=jT();e.exports=function(t,e,i){var a,o={};function s(i,o){return r.coerce(t[a]||{},e[a],n,i,o)}for(var l=0;l0?(c=s,u=l):(c=l,u=s);var h=[o.findEnclosingVertexAngles(c,t.vangles)[0],(c+u)/2,o.findEnclosingVertexAngles(u,t.vangles)[1]];return o.pathPolygonAnnulus(n,a,c,u,h,e,r)}:function(t,n,a,o){return i.pathAnnulus(t,n,a,o,e,r)}}(e),d=e.layers.frontplot.select("g.barlayer");i.makeTraceGroups(d,s,"trace bars").each((function(){var o=r.select(this),s=i.ensureSingle(o,"g","points").selectAll("g.point").data(i.identity);s.enter().append("g").style("vector-effect",l?"none":"non-scaling-stroke").style("stroke-miterlimit",2).classed("point",!0),s.exit().remove(),s.each((function(t){var e,a=r.select(this),o=t.rp0=h.c2p(t.s0),s=t.rp1=h.c2p(t.s1),l=t.thetag0=p.c2g(t.p0),d=t.thetag1=p.c2g(t.p1);if(n(o)&&n(s)&&n(l)&&n(d)&&o!==s&&l!==d){var m=h.c2g(t.s1),g=(l+d)/2;t.ct=[c.c2p(m*Math.cos(g)),u.c2p(m*Math.sin(g))],e=f(o,s,l,d)}else e="M0,0Z";i.ensureSingle(a,"path").attr("d",e)})),a.setClipUrl(o,e._hasClipOnAxisFalse?e.clipIds.forTraces:null,t)}))}}}),HT=f({"src/traces/barpolar/hover.js"(t,e){var r=Dr(),n=le(),i=ro().getTraceColor,a=n.fillText,o=MT().makeHoverPointText,s=mT().isPtInsidePolygon;e.exports=function(t,e,l){var c=t.cd,u=c[0].trace,h=t.subplot,p=h.radialAxis,f=h.angularAxis,d=h.vangles,m=d?s:n.isPtInsideSector,g=t.maxHoverDistance,y=f._period||2*Math.PI,v=Math.abs(p.g2p(Math.sqrt(e*e+l*l))),x=Math.atan2(l,e);if(p.range[0]>p.range[1]&&(x+=Math.PI),r.getClosest(c,(function(t){return m(v,x,[t.rp0,t.rp1],[t.thetag0,t.thetag1],d)?g+Math.min(1,Math.abs(t.thetag1-t.thetag0)/y)-1+(t.rp1-v)/(t.rp1-t.rp0)-1:1/0}),t),!1!==t.index){var _=c[t.index];t.x0=t.x1=_.ct[0],t.y0=t.y1=_.ct[1];var b=n.extendFlat({},_,{r:_.s,theta:_.p});return a(_,u,t),o(b,u,h,t),t.hovertemplate=u.hovertemplate,t.color=i(u,_),t.xLabelVal=t.yLabelVal=void 0,_.s<0&&(t.idealAlign="left"),[t]}}}}),GT=f({"src/traces/barpolar/index.js"(t,e){e.exports={moduleType:"trace",name:"barpolar",basePlotModule:_T(),categories:["polar","bar","showLegend"],attributes:BT(),layoutAttributes:jT(),supplyDefaults:NT(),supplyLayoutDefaults:UT(),calc:VT().calc,crossTraceCalc:VT().crossTraceCalc,plot:qT(),colorbar:fi(),formatLabels:TT(),style:to().style,styleOnSelect:to().styleOnSelect,hoverPoints:HT(),selectPoints:io(),meta:{}}}}),WT=f({"lib/barpolar.js"(t,e){e.exports=GT()}}),ZT=f({"src/plots/smith/constants.js"(t,e){e.exports={attr:"subplot",name:"smith",axisNames:["realaxis","imaginaryaxis"],axisName2dataArray:{imaginaryaxis:"imag",realaxis:"real"}}}}),YT=f({"src/plots/smith/layout_attributes.js"(t,e){var r=q(),n=Ie(),i=Aa().attributes,a=le().extendFlat,o=Pt().overrideAll,s=o({color:n.color,showline:a({},n.showline,{dflt:!0}),linecolor:n.linecolor,linewidth:n.linewidth,showgrid:a({},n.showgrid,{dflt:!0}),gridcolor:n.gridcolor,gridwidth:n.gridwidth,griddash:n.griddash},"plot","from-root"),l=o({ticklen:n.ticklen,tickwidth:a({},n.tickwidth,{dflt:2}),tickcolor:n.tickcolor,showticklabels:n.showticklabels,labelalias:n.labelalias,showtickprefix:n.showtickprefix,tickprefix:n.tickprefix,showticksuffix:n.showticksuffix,ticksuffix:n.ticksuffix,tickfont:n.tickfont,tickformat:n.tickformat,hoverformat:n.hoverformat,layer:n.layer},"plot","from-root"),c=a({visible:a({},n.visible,{dflt:!0}),tickvals:{dflt:[.2,.5,1,2,5],valType:"data_array",editType:"plot"},tickangle:a({},n.tickangle,{dflt:90}),ticks:{valType:"enumerated",values:["top","bottom",""],editType:"ticks"},side:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},editType:"calc"},s,l),u=a({visible:a({},n.visible,{dflt:!0}),tickvals:{valType:"data_array",editType:"plot"},ticks:n.ticks,editType:"calc"},s,l);e.exports={domain:i({name:"smith",editType:"plot"}),bgcolor:{valType:"color",editType:"plot",dflt:r.background},realaxis:c,imaginaryaxis:u,editType:"calc"}}}),XT=f({"src/plots/smith/layout_defaults.js"(t,e){var r,n,i,a=le(),o=H(),s=ye(),l=Hs(),c=we().getSubplotData,u=Ue(),h=Ne(),p=wi(),f=er(),d=YT(),m=ZT(),g=m.axisNames,y=(r=function(t){return a.isTypedArray(t)&&(t=Array.from(t)),t.slice().reverse().map((function(t){return-t})).concat([0]).concat(t)},n=String,i={},function(t){var e=n?n(t):t;if(e in i)return i[e];var a=r(t);return i[e]=a,a});function v(t,e,r,n){var i=r("bgcolor");n.bgColor=o.combine(i,n.paper_bgcolor);var l,v=c(n.fullData,m.name,n.id),x=n.layoutOut;function _(t,e){return r(l+"."+t,e)}for(var b=0;b")}}e.exports={hoverPoints:function(t,e,i,a){var o=r(t,e,i,a);if(o&&!1!==o[0].index){var s=o[0];if(void 0===s.index)return o;var l=t.subplot,c=s.cd[s.index],u=s.trace;if(l.isPtInside(c))return s.xLabelVal=void 0,s.yLabelVal=void 0,n(c,u,l,s),s.hovertemplate=u.hovertemplate,o}},makeHoverPointText:n}}}),nA=f({"src/traces/scattersmith/index.js"(t,e){e.exports={moduleType:"trace",name:"scattersmith",basePlotModule:$T(),categories:["smith","symbols","showLegend","scatter-like"],attributes:KT(),supplyDefaults:JT(),colorbar:fi(),formatLabels:QT(),calc:tA(),plot:eA(),style:mi().style,styleOnSelect:mi().styleOnSelect,hoverPoints:rA().hoverPoints,selectPoints:vi(),meta:{}}}}),iA=f({"lib/scattersmith.js"(t,e){e.exports=nA()}}),aA=f({"node_modules/world-calendars/dist/main.js"(t,e){var r=oy();function n(){this.regionalOptions=[],this.regionalOptions[""]={invalidCalendar:"Calendar {0} not found",invalidDate:"Invalid {0} date",invalidMonth:"Invalid {0} month",invalidYear:"Invalid {0} year",differentCalendars:"Cannot mix {0} and {1} dates"},this.local=this.regionalOptions[""],this.calendars={},this._localCals={}}function i(t,e,r,n){if(this._calendar=t,this._year=e,this._month=r,this._day=n,0===this._calendar._validateLevel&&!this._calendar.isValid(this._year,this._month,this._day))throw(l.local.invalidDate||l.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function a(t,e){return"000000".substring(0,e-(t=""+t).length)+t}function o(){this.shortYearCutoff="+10"}function s(t){this.local=this.regionalOptions[t]||this.regionalOptions[""]}r(n.prototype,{instance:function(t,e){t=(t||"gregorian").toLowerCase(),e=e||"";var r=this._localCals[t+"-"+e];if(!r&&this.calendars[t]&&(r=new this.calendars[t](e),this._localCals[t+"-"+e]=r),!r)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,t);return r},newDate:function(t,e,r,n,i){return(n=(null!=t&&t.year?t.calendar():"string"==typeof n?this.instance(n,i):n)||this.instance()).newDate(t,e,r)},substituteDigits:function(t){return function(e){return(e+"").replace(/[0-9]/g,(function(e){return t[e]}))}},substituteChineseDigits:function(t,e){return function(r){for(var n="",i=0;r>0;){var a=r%10;n=(0===a?"":t[a]+e[i])+n,i++,r=Math.floor(r/10)}return 0===n.indexOf(t[1]+e[1])&&(n=n.substr(1)),n||t[0]}}}),r(i.prototype,{newDate:function(t,e,r){return this._calendar.newDate(t??this,e,r)},year:function(t){return 0===arguments.length?this._year:this.set(t,"y")},month:function(t){return 0===arguments.length?this._month:this.set(t,"m")},day:function(t){return 0===arguments.length?this._day:this.set(t,"d")},date:function(t,e,r){if(!this._calendar.isValid(t,e,r))throw(l.local.invalidDate||l.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=t,this._month=e,this._day=r,this},leapYear:function(){return this._calendar.leapYear(this)},epoch:function(){return this._calendar.epoch(this)},formatYear:function(){return this._calendar.formatYear(this)},monthOfYear:function(){return this._calendar.monthOfYear(this)},weekOfYear:function(){return this._calendar.weekOfYear(this)},daysInYear:function(){return this._calendar.daysInYear(this)},dayOfYear:function(){return this._calendar.dayOfYear(this)},daysInMonth:function(){return this._calendar.daysInMonth(this)},dayOfWeek:function(){return this._calendar.dayOfWeek(this)},weekDay:function(){return this._calendar.weekDay(this)},extraInfo:function(){return this._calendar.extraInfo(this)},add:function(t,e){return this._calendar.add(this,t,e)},set:function(t,e){return this._calendar.set(this,t,e)},compareTo:function(t){if(this._calendar.name!==t._calendar.name)throw(l.local.differentCalendars||l.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,t._calendar.local.name);var e=this._year!==t._year?this._year-t._year:this._month!==t._month?this.monthOfYear()-t.monthOfYear():this._day-t._day;return 0===e?0:e<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(t){return this._calendar.fromJD(t)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(t){return this._calendar.fromJSDate(t)},toString:function(){return(this.year()<0?"-":"")+a(Math.abs(this.year()),4)+"-"+a(this.month(),2)+"-"+a(this.day(),2)}}),r(o.prototype,{_validateLevel:0,newDate:function(t,e,r){return null==t?this.today():(t.year&&(this._validate(t,e,r,l.local.invalidDate||l.regionalOptions[""].invalidDate),r=t.day(),e=t.month(),t=t.year()),new i(this,t,e,r))},today:function(){return this.fromJSDate(new Date)},epoch:function(t){return this._validate(t,this.minMonth,this.minDay,l.local.invalidYear||l.regionalOptions[""].invalidYear).year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,l.local.invalidYear||l.regionalOptions[""].invalidYear);return(e.year()<0?"-":"")+a(Math.abs(e.year()),4)},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,l.local.invalidYear||l.regionalOptions[""].invalidYear),12},monthOfYear:function(t,e){var r=this._validate(t,e,this.minDay,l.local.invalidMonth||l.regionalOptions[""].invalidMonth);return(r.month()+this.monthsInYear(r)-this.firstMonth)%this.monthsInYear(r)+this.minMonth},fromMonthOfYear:function(t,e){var r=(e+this.firstMonth-2*this.minMonth)%this.monthsInYear(t)+this.minMonth;return this._validate(t,r,this.minDay,l.local.invalidMonth||l.regionalOptions[""].invalidMonth),r},daysInYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,l.local.invalidYear||l.regionalOptions[""].invalidYear);return this.leapYear(e)?366:365},dayOfYear:function(t,e,r){var n=this._validate(t,e,r,l.local.invalidDate||l.regionalOptions[""].invalidDate);return n.toJD()-this.newDate(n.year(),this.fromMonthOfYear(n.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(t,e,r){var n=this._validate(t,e,r,l.local.invalidDate||l.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(n))+2)%this.daysInWeek()},extraInfo:function(t,e,r){return this._validate(t,e,r,l.local.invalidDate||l.regionalOptions[""].invalidDate),{}},add:function(t,e,r){return this._validate(t,this.minMonth,this.minDay,l.local.invalidDate||l.regionalOptions[""].invalidDate),this._correctAdd(t,this._add(t,e,r),e,r)},_add:function(t,e,r){if(this._validateLevel++,"d"===r||"w"===r){var n=t.toJD()+e*("w"===r?this.daysInWeek():1),i=t.calendar().fromJD(n);return this._validateLevel--,[i.year(),i.month(),i.day()]}try{var a=t.year()+("y"===r?e:0),o=t.monthOfYear()+("m"===r?e:0);i=t.day(),"y"===r?(t.month()!==this.fromMonthOfYear(a,o)&&(o=this.newDate(a,t.month(),this.minDay).monthOfYear()),o=Math.min(o,this.monthsInYear(a)),i=Math.min(i,this.daysInMonth(a,this.fromMonthOfYear(a,o)))):"m"===r&&(function(t){for(;oe-1+t.minMonth;)a++,o-=e,e=t.monthsInYear(a)}(this),i=Math.min(i,this.daysInMonth(a,this.fromMonthOfYear(a,o))));var s=[a,this.fromMonthOfYear(a,o),i];return this._validateLevel--,s}catch(t){throw this._validateLevel--,t}},_correctAdd:function(t,e,r,n){if(!(this.hasYearZero||"y"!==n&&"m"!==n||0!==e[0]&&t.year()>0==e[0]>0)){var i={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[n],a=r<0?-1:1;e=this._add(t,r*i[0]+a*i[1],i[2])}return t.date(e[0],e[1],e[2])},set:function(t,e,r){this._validate(t,this.minMonth,this.minDay,l.local.invalidDate||l.regionalOptions[""].invalidDate);var n="y"===r?e:t.year(),i="m"===r?e:t.month(),a="d"===r?e:t.day();return("y"===r||"m"===r)&&(a=Math.min(a,this.daysInMonth(n,i))),t.date(n,i,a)},isValid:function(t,e,r){this._validateLevel++;var n=this.hasYearZero||0!==t;if(n){var i=this.newDate(t,e,this.minDay);n=e>=this.minMonth&&e-this.minMonth=this.minDay&&r-this.minDay13.5?13:1),c=i-(l>2.5?4716:4715);return c<=0&&c--,this.newDate(c,l,s)},toJSDate:function(t,e,r){var n=this._validate(t,e,r,l.local.invalidDate||l.regionalOptions[""].invalidDate),i=new Date(n.year(),n.month()-1,n.day());return i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setMilliseconds(0),i.setHours(i.getHours()>12?i.getHours()+2:0),i},fromJSDate:function(t){return this.newDate(t.getFullYear(),t.getMonth()+1,t.getDate())}});var l=e.exports=new n;l.cdate=i,l.baseCalendar=o,l.calendars.gregorian=s}}),oA=f({"node_modules/world-calendars/dist/plus.js"(){var t=oy(),e=aA();t(e.regionalOptions[""],{invalidArguments:"Invalid arguments",invalidFormat:"Cannot format a date from another calendar",missingNumberAt:"Missing number at position {0}",unknownNameAt:"Unknown name at position {0}",unexpectedLiteralAt:"Unexpected literal at position {0}",unexpectedText:"Additional text found at end"}),e.local=e.regionalOptions[""],t(e.cdate.prototype,{formatDate:function(t,e){return"string"!=typeof t&&(e=t,t=""),this._calendar.formatDate(t||"",this,e)}}),t(e.baseCalendar.prototype,{UNIX_EPOCH:e.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:86400,TICKS_EPOCH:e.instance().jdEpoch,TICKS_PER_DAY:864e9,ATOM:"yyyy-mm-dd",COOKIE:"D, dd M yyyy",FULL:"DD, MM d, yyyy",ISO_8601:"yyyy-mm-dd",JULIAN:"J",RFC_822:"D, d M yy",RFC_850:"DD, dd-M-yy",RFC_1036:"D, d M yy",RFC_1123:"D, d M yyyy",RFC_2822:"D, d M yyyy",RSS:"D, d M yy",TICKS:"!",TIMESTAMP:"@",W3C:"yyyy-mm-dd",formatDate:function(t,r,n){if("string"!=typeof t&&(n=r,r=t,t=""),!r)return"";if(r.calendar()!==this)throw e.local.invalidFormat||e.regionalOptions[""].invalidFormat;t=t||this.local.dateFormat;for(var i=(n=n||{}).dayNamesShort||this.local.dayNamesShort,a=n.dayNames||this.local.dayNames,o=n.monthNumbers||this.local.monthNumbers,s=n.monthNamesShort||this.local.monthNamesShort,l=n.monthNames||this.local.monthNames,c=(n.calculateWeek||this.local.calculateWeek,function(e,r){for(var n=1;v+n1}),u=function(t,e,r,n){var i=""+e;if(c(t,n))for(;i.length1},x=function(t,n){var i=v(t,n),a=[2,3,i?4:2,i?4:2,10,11,20]["oyYJ@!".indexOf(t)+1],o=new RegExp("^-?\\d{1,"+a+"}"),s=r.substring(k).match(o);if(!s)throw(e.local.missingNumberAt||e.regionalOptions[""].missingNumberAt).replace(/\{0\}/,k);return k+=s[0].length,parseInt(s[0],10)},_=this,b=function(){if("function"==typeof l){v("m");var t=l.call(_,r.substring(k));return k+=t.length,t}return x("m")},w=function(t,n,i,a){for(var o=v(t,a)?i:n,s=0;s-1){f=1,d=m;for(var E=this.daysInMonth(p,f);d>E;E=this.daysInMonth(p,f))f++,d-=E}return h>-1?this.fromJD(h):this.newDate(p,f,d)},determineDate:function(t,e,r,n,i){r&&"object"!=typeof r&&(i=n,n=r,r=null),"string"!=typeof n&&(i=n,n="");var a=this;return e=e?e.newDate():null,null==t?e:"string"==typeof t?function(t){try{return a.parseDate(n,t,i)}catch{}for(var e=((t=t.toLowerCase()).match(/^c/)&&r?r.newDate():null)||a.today(),o=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,s=o.exec(t);s;)e.add(parseInt(s[1],10),s[2]||"d"),s=o.exec(t);return e}(t):"number"==typeof t?isNaN(t)||t===1/0||t===-1/0?e:a.today().add(t,"d"):a.newDate(t)}})}}),sA=f({"node_modules/world-calendars/dist/calendars/chinese.js"(){var t=aA(),e=oy(),r=t.instance();function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}n.prototype=new t.baseCalendar,e(n.prototype,{name:"Chinese",jdEpoch:1721425.5,hasYearZero:!1,minMonth:0,firstMonth:0,minDay:1,regionalOptions:{"":{name:"Chinese",epochs:["BEC","EC"],monthNumbers:function(t,e){if("string"==typeof t){var r=t.match(a);return r?r[0]:""}var n=this._validateYear(t),i=t.month(),o=""+this.toChineseMonth(n,i);return e&&o.length<2&&(o="0"+o),this.isIntercalaryMonth(n,i)&&(o+="i"),o},monthNames:function(t){if("string"==typeof t){var e=t.match(o);return e?e[0]:""}var r=this._validateYear(t),n=t.month(),i=["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(i="闰"+i),i},monthNamesShort:function(t){if("string"==typeof t){var e=t.match(s);return e?e[0]:""}var r=this._validateYear(t),n=t.month(),i=["一","二","三","四","五","六","七","八","九","十","十一","十二"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(i="闰"+i),i},parseMonth:function(t,e){t=this._validateYear(t);var r,n=parseInt(e);if(isNaN(n))"闰"===e[0]&&(r=!0,e=e.substring(1)),"月"===e[e.length-1]&&(e=e.substring(0,e.length-1)),n=1+["一","二","三","四","五","六","七","八","九","十","十一","十二"].indexOf(e);else{var i=e[e.length-1];r="i"===i||"I"===i}return this.toMonthIndex(t,n,r)},dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},_validateYear:function(t,e){if(t.year&&(t=t.year()),"number"!=typeof t||t<1888||t>2111)throw e.replace(/\{0\}/,this.local.name);return t},toMonthIndex:function(e,r,n){var i=this.intercalaryMonth(e);if(n&&r!==i||r<1||r>12)throw t.local.invalidMonth.replace(/\{0\}/,this.local.name);return i?!n&&r<=i?r-1:r:r-1},toChineseMonth:function(e,r){e.year&&(r=(e=e.year()).month());var n=this.intercalaryMonth(e);if(r<0||r>(n?12:11))throw t.local.invalidMonth.replace(/\{0\}/,this.local.name);return n?r>13},isIntercalaryMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t);return!!r&&r===e},leapYear:function(t){return 0!==this.intercalaryMonth(t)},weekOfYear:function(e,n,i){var a,o=this._validateYear(e,t.local.invalidyear),s=c[o-c[0]],l=s>>9&4095,u=s>>5&15,h=31&s;(a=r.newDate(l,u,h)).add(4-(a.dayOfWeek()||7),"d");var p=this.toJD(e,n,i)-a.toJD();return 1+Math.floor(p/7)},monthsInYear:function(t){return this.leapYear(t)?13:12},daysInMonth:function(e,r){e.year&&(r=e.month(),e=e.year()),e=this._validateYear(e);var n=l[e-l[0]];if(r>(n>>13?12:11))throw t.local.invalidMonth.replace(/\{0\}/,this.local.name);return n&1<<12-r?30:29},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(e,n,i){var a=this._validate(e,s,i,t.local.invalidDate);e=this._validateYear(a.year()),n=a.month(),i=a.day();var o=this.isIntercalaryMonth(e,n),s=this.toChineseMonth(e,n),u=function(t,e,r,n){var i,a,o;if("object"==typeof t)a=t,i=e||{};else{var s;if(!("number"==typeof t&&t>=1888&&t<=2111))throw new Error("Lunar year outside range 1888-2111");if(!("number"==typeof e&&e>=1&&e<=12))throw new Error("Lunar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=30))throw new Error("Lunar day outside range 1 - 30");"object"==typeof n?(s=!1,i=n):(s=!!n,i={}),a={year:t,month:e,day:r,isIntercalary:s}}o=a.day-1;var u,h=l[a.year-l[0]],p=h>>13;u=p&&(a.month>p||a.isIntercalary)?a.month:a.month-1;for(var f=0;f>9&4095,(d>>5&15)-1,(31&d)+o);return i.year=m.getFullYear(),i.month=1+m.getMonth(),i.day=m.getDate(),i}(e,s,i,o);return r.toJD(u.year,u.month,u.day)},fromJD:function(t){var e=r.fromJD(t),n=function(t,e,r){var n,i;if("object"==typeof t)n=t,i=e||{};else{if(!("number"==typeof t&&t>=1888&&t<=2111))throw new Error("Solar year outside range 1888-2111");if(!("number"==typeof e&&e>=1&&e<=12))throw new Error("Solar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=31))throw new Error("Solar day outside range 1 - 31");n={year:t,month:e,day:r},i={}}var a=c[n.year-c[0]],o=n.year<<9|n.month<<5|n.day;i.year=o>=a?n.year:n.year-1,a=c[i.year-c[0]];var s,u=new Date(a>>9&4095,(a>>5&15)-1,31&a),h=new Date(n.year,n.month-1,n.day);s=Math.round((h-u)/864e5);var p,f=l[i.year-l[0]];for(p=0;p<13;p++){var d=f&1<<12-p?30:29;if(s>13;return!m||p=2&&n<=6},extraInfo:function(e,r,i){var a=this._validate(e,r,i,t.local.invalidDate);return{century:n[Math.floor((a.year()-1)/100)+1]||""}},toJD:function(e,r,n){var i=this._validate(e,r,n,t.local.invalidDate);return e=i.year()+(i.year()<0?1:0),r=i.month(),(n=i.day())+(r>1?16:0)+(r>2?32*(r-2):0)+400*(e-1)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t+.5)-Math.floor(this.jdEpoch)-1;var e=Math.floor(t/400)+1;t-=400*(e-1),t+=t>15?16:0;var r=Math.floor(t/32)+1,n=t-32*(r-1)+1;return this.newDate(e<=0?e-1:e,r,n)}});var n={20:"Fruitbat",21:"Anchovy"};t.calendars.discworld=r}}),uA=f({"node_modules/world-calendars/dist/calendars/ethiopian.js"(){var t=aA(),e=oy();function r(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}r.prototype=new t.baseCalendar,e(r.prototype,{name:"Ethiopian",jdEpoch:1724220.5,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Ethiopian",epochs:["BEE","EE"],monthNames:["Meskerem","Tikemet","Hidar","Tahesas","Tir","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehase","Pagume"],monthNamesShort:["Mes","Tik","Hid","Tah","Tir","Yek","Meg","Mia","Gen","Sen","Ham","Neh","Pag"],dayNames:["Ehud","Segno","Maksegno","Irob","Hamus","Arb","Kidame"],dayNamesShort:["Ehu","Seg","Mak","Iro","Ham","Arb","Kid"],dayNamesMin:["Eh","Se","Ma","Ir","Ha","Ar","Ki"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var r=this._validate(e,this.minMonth,this.minDay,t.local.invalidYear);return(e=r.year()+(r.year()<0?1:0))%4==3||e%4==-1},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,t.local.invalidYear||t.regionalOptions[""].invalidYear),13},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,r){var n=this._validate(e,r,this.minDay,t.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(13===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(e,r,n){var i=this._validate(e,r,n,t.local.invalidDate);return(e=i.year())<0&&e++,i.day()+30*(i.month()-1)+365*(e-1)+Math.floor(e/4)+this.jdEpoch-1},fromJD:function(t){var e=Math.floor(t)+.5-this.jdEpoch,r=Math.floor((e-Math.floor((e+366)/1461))/365)+1;r<=0&&r--,e=Math.floor(t)+.5-this.newDate(r,1,1).toJD();var n=Math.floor(e/30)+1,i=e-30*(n-1)+1;return this.newDate(r,n,i)}}),t.calendars.ethiopian=r}}),hA=f({"node_modules/world-calendars/dist/calendars/hebrew.js"(){var t=aA(),e=oy();function r(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function n(t,e){return t-e*Math.floor(t/e)}r.prototype=new t.baseCalendar,e(r.prototype,{name:"Hebrew",jdEpoch:347995.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29,29],hasYearZero:!1,minMonth:1,firstMonth:7,minDay:1,regionalOptions:{"":{name:"Hebrew",epochs:["BAM","AM"],monthNames:["Nisan","Iyar","Sivan","Tammuz","Av","Elul","Tishrei","Cheshvan","Kislev","Tevet","Shevat","Adar","Adar II"],monthNamesShort:["Nis","Iya","Siv","Tam","Av","Elu","Tis","Che","Kis","Tev","She","Ada","Ad2"],dayNames:["Yom Rishon","Yom Sheni","Yom Shlishi","Yom Revi'i","Yom Chamishi","Yom Shishi","Yom Shabbat"],dayNamesShort:["Ris","She","Shl","Rev","Cha","Shi","Sha"],dayNamesMin:["Ri","She","Shl","Re","Ch","Shi","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var r=this._validate(e,this.minMonth,this.minDay,t.local.invalidYear);return this._leapYear(r.year())},_leapYear:function(t){return n(7*(t=t<0?t+1:t)+1,19)<7},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,t.local.invalidYear),this._leapYear(e.year?e.year():e)?13:12},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){return e=this._validate(e,this.minMonth,this.minDay,t.local.invalidYear).year(),this.toJD(-1===e?1:e+1,7,1)-this.toJD(e,7,1)},daysInMonth:function(e,r){return e.year&&(r=e.month(),e=e.year()),this._validate(e,r,this.minDay,t.local.invalidMonth),12===r&&this.leapYear(e)||8===r&&5===n(this.daysInYear(e),10)?30:9===r&&3===n(this.daysInYear(e),10)?29:this.daysPerMonth[r-1]},weekDay:function(t,e,r){return 6!==this.dayOfWeek(t,e,r)},extraInfo:function(e,r,n){var i=this._validate(e,r,n,t.local.invalidDate);return{yearType:(this.leapYear(i)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(i)%10-3]}},toJD:function(e,r,n){var i=this._validate(e,r,n,t.local.invalidDate);e=i.year(),r=i.month(),n=i.day();var a=e<=0?e+1:e,o=this.jdEpoch+this._delay1(a)+this._delay2(a)+n+1;if(r<7){for(var s=7;s<=this.monthsInYear(e);s++)o+=this.daysInMonth(e,s);for(s=1;s=this.toJD(-1===e?1:e+1,7,1);)e++;for(var r=tthis.toJD(e,r,this.daysInMonth(e,r));)r++;var n=t-this.toJD(e,r,1)+1;return this.newDate(e,r,n)}}),t.calendars.hebrew=r}}),pA=f({"node_modules/world-calendars/dist/calendars/islamic.js"(){var t=aA(),e=oy();function r(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}r.prototype=new t.baseCalendar,e(r.prototype,{name:"Islamic",jdEpoch:1948439.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Islamic",epochs:["BH","AH"],monthNames:["Muharram","Safar","Rabi' al-awwal","Rabi' al-thani","Jumada al-awwal","Jumada al-thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-ahad","Yawm al-ithnayn","Yawm ath-thulaathaa'","Yawm al-arbi'aa'","Yawm al-khamīs","Yawm al-jum'a","Yawm as-sabt"],dayNamesShort:["Aha","Ith","Thu","Arb","Kha","Jum","Sab"],dayNamesMin:["Ah","It","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(e){return(11*this._validate(e,this.minMonth,this.minDay,t.local.invalidYear).year()+14)%30<11},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){return this.leapYear(t)?355:354},daysInMonth:function(e,r){var n=this._validate(e,r,this.minDay,t.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(12===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(e,r,n){var i=this._validate(e,r,n,t.local.invalidDate);return e=i.year(),r=i.month(),e=e<=0?e+1:e,(n=i.day())+Math.ceil(29.5*(r-1))+354*(e-1)+Math.floor((3+11*e)/30)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t)+.5;var e=Math.floor((30*(t-this.jdEpoch)+10646)/10631);e=e<=0?e-1:e;var r=Math.min(12,Math.ceil((t-29-this.toJD(e,1,1))/29.5)+1),n=t-this.toJD(e,r,1)+1;return this.newDate(e,r,n)}}),t.calendars.islamic=r}}),fA=f({"node_modules/world-calendars/dist/calendars/julian.js"(){var t=aA(),e=oy();function r(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}r.prototype=new t.baseCalendar,e(r.prototype,{name:"Julian",jdEpoch:1721423.5,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Julian",epochs:["BC","AD"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var r=this._validate(e,this.minMonth,this.minDay,t.local.invalidYear);return(e=r.year()<0?r.year()+1:r.year())%4==0},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(4-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,r){var n=this._validate(e,r,this.minDay,t.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(2===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(e,r,n){var i=this._validate(e,r,n,t.local.invalidDate);return e=i.year(),r=i.month(),n=i.day(),e<0&&e++,r<=2&&(e--,r+=12),Math.floor(365.25*(e+4716))+Math.floor(30.6001*(r+1))+n-1524.5},fromJD:function(t){var e=Math.floor(t+.5)+1524,r=Math.floor((e-122.1)/365.25),n=Math.floor(365.25*r),i=Math.floor((e-n)/30.6001),a=i-Math.floor(i<14?1:13),o=r-Math.floor(a>2?4716:4715),s=e-n-Math.floor(30.6001*i);return o<=0&&o--,this.newDate(o,a,s)}}),t.calendars.julian=r}}),dA=f({"node_modules/world-calendars/dist/calendars/mayan.js"(){var t=aA(),e=oy();function r(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function n(t,e){return t-e*Math.floor(t/e)}function i(t,e){return n(t-1,e)+1}r.prototype=new t.baseCalendar,e(r.prototype,{name:"Mayan",jdEpoch:584282.5,hasYearZero:!0,minMonth:0,firstMonth:0,minDay:0,regionalOptions:{"":{name:"Mayan",epochs:["",""],monthNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],monthNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],dayNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesMin:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],digits:null,dateFormat:"YYYY.m.d",firstDay:0,isRTL:!1,haabMonths:["Pop","Uo","Zip","Zotz","Tzec","Xul","Yaxkin","Mol","Chen","Yax","Zac","Ceh","Mac","Kankin","Muan","Pax","Kayab","Cumku","Uayeb"],tzolkinMonths:["Imix","Ik","Akbal","Kan","Chicchan","Cimi","Manik","Lamat","Muluc","Oc","Chuen","Eb","Ben","Ix","Men","Cib","Caban","Etznab","Cauac","Ahau"]}},leapYear:function(e){return this._validate(e,this.minMonth,this.minDay,t.local.invalidYear),!1},formatYear:function(e){e=this._validate(e,this.minMonth,this.minDay,t.local.invalidYear).year();var r=Math.floor(e/400);return e%=400,e+=e<0?400:0,r+"."+Math.floor(e/20)+"."+e%20},forYear:function(t){if((t=t.split(".")).length<3)throw"Invalid Mayan year";for(var e=0,r=0;r19||r>0&&n<0)throw"Invalid Mayan year";e=20*e+n}return e},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,t.local.invalidYear),18},weekOfYear:function(e,r,n){return this._validate(e,r,n,t.local.invalidDate),0},daysInYear:function(e){return this._validate(e,this.minMonth,this.minDay,t.local.invalidYear),360},daysInMonth:function(e,r){return this._validate(e,r,this.minDay,t.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(e,r,n){return this._validate(e,r,n,t.local.invalidDate).day()},weekDay:function(e,r,n){return this._validate(e,r,n,t.local.invalidDate),!0},extraInfo:function(e,r,n){var i=this._validate(e,r,n,t.local.invalidDate).toJD(),a=this._toHaab(i),o=this._toTzolkin(i);return{haabMonthName:this.local.haabMonths[a[0]-1],haabMonth:a[0],haabDay:a[1],tzolkinDayName:this.local.tzolkinMonths[o[0]-1],tzolkinDay:o[0],tzolkinTrecena:o[1]}},_toHaab:function(t){var e=n(8+(t-=this.jdEpoch)+340,365);return[Math.floor(e/20)+1,n(e,20)]},_toTzolkin:function(t){return[i(20+(t-=this.jdEpoch),20),i(t+4,13)]},toJD:function(e,r,n){var i=this._validate(e,r,n,t.local.invalidDate);return i.day()+20*i.month()+360*i.year()+this.jdEpoch},fromJD:function(t){t=Math.floor(t)+.5-this.jdEpoch;var e=Math.floor(t/360);t%=360,t+=t<0?360:0;var r=Math.floor(t/20),n=t%20;return this.newDate(e,r,n)}}),t.calendars.mayan=r}}),mA=f({"node_modules/world-calendars/dist/calendars/nanakshahi.js"(){var t=aA(),e=oy();function r(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}r.prototype=new t.baseCalendar;var n=t.instance("gregorian");e(r.prototype,{name:"Nanakshahi",jdEpoch:2257673.5,daysPerMonth:[31,31,31,31,31,30,30,30,30,30,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Nanakshahi",epochs:["BN","AN"],monthNames:["Chet","Vaisakh","Jeth","Harh","Sawan","Bhadon","Assu","Katak","Maghar","Poh","Magh","Phagun"],monthNamesShort:["Che","Vai","Jet","Har","Saw","Bha","Ass","Kat","Mgr","Poh","Mgh","Pha"],dayNames:["Somvaar","Mangalvar","Budhvaar","Veervaar","Shukarvaar","Sanicharvaar","Etvaar"],dayNamesShort:["Som","Mangal","Budh","Veer","Shukar","Sanichar","Et"],dayNamesMin:["So","Ma","Bu","Ve","Sh","Sa","Et"],digits:null,dateFormat:"dd-mm-yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var r=this._validate(e,this.minMonth,this.minDay,t.local.invalidYear||t.regionalOptions[""].invalidYear);return n.leapYear(r.year()+(r.year()<1?1:0)+1469)},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(1-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,r){var n=this._validate(e,r,this.minDay,t.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(12===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(e,r,i){var a=this._validate(e,r,i,t.local.invalidMonth);(e=a.year())<0&&e++;for(var o=a.day(),s=1;s=this.toJD(e+1,1,1);)e++;for(var r=t-Math.floor(this.toJD(e,1,1)+.5)+1,n=1;r>this.daysInMonth(e,n);)r-=this.daysInMonth(e,n),n++;return this.newDate(e,n,r)}}),t.calendars.nanakshahi=r}}),gA=f({"node_modules/world-calendars/dist/calendars/nepali.js"(){var t=aA(),e=oy();function r(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}r.prototype=new t.baseCalendar,e(r.prototype,{name:"Nepali",jdEpoch:1700709.5,daysPerMonth:[31,31,32,32,31,30,30,29,30,29,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,daysPerYear:365,regionalOptions:{"":{name:"Nepali",epochs:["BBS","ABS"],monthNames:["Baisakh","Jestha","Ashadh","Shrawan","Bhadra","Ashwin","Kartik","Mangsir","Paush","Mangh","Falgun","Chaitra"],monthNamesShort:["Bai","Je","As","Shra","Bha","Ash","Kar","Mang","Pau","Ma","Fal","Chai"],dayNames:["Aaitabaar","Sombaar","Manglbaar","Budhabaar","Bihibaar","Shukrabaar","Shanibaar"],dayNamesShort:["Aaita","Som","Mangl","Budha","Bihi","Shukra","Shani"],dayNamesMin:["Aai","So","Man","Bu","Bi","Shu","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:1,isRTL:!1}},leapYear:function(t){return this.daysInYear(t)!==this.daysPerYear},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){if(e=this._validate(e,this.minMonth,this.minDay,t.local.invalidYear).year(),typeof this.NEPALI_CALENDAR_DATA[e]>"u")return this.daysPerYear;for(var r=0,n=this.minMonth;n<=12;n++)r+=this.NEPALI_CALENDAR_DATA[e][n];return r},daysInMonth:function(e,r){return e.year&&(r=e.month(),e=e.year()),this._validate(e,r,this.minDay,t.local.invalidMonth),typeof this.NEPALI_CALENDAR_DATA[e]>"u"?this.daysPerMonth[r-1]:this.NEPALI_CALENDAR_DATA[e][r]},weekDay:function(t,e,r){return 6!==this.dayOfWeek(t,e,r)},toJD:function(e,r,n){var i=this._validate(e,r,n,t.local.invalidDate);e=i.year(),r=i.month(),n=i.day();var a=t.instance(),o=0,s=r,l=e;this._createMissingCalendarData(e);var c=e-(s>9||9===s&&n>=this.NEPALI_CALENDAR_DATA[l][0]?56:57);for(9!==r&&(o=n,s--);9!==s;)s<=0&&(s=12,l--),o+=this.NEPALI_CALENDAR_DATA[l][s],s--;return 9===r?(o+=n-this.NEPALI_CALENDAR_DATA[l][0])<0&&(o+=a.daysInYear(c)):o+=this.NEPALI_CALENDAR_DATA[l][9]-this.NEPALI_CALENDAR_DATA[l][0],a.newDate(c,1,1).add(o,"d").toJD()},fromJD:function(e){var r=t.instance().fromJD(e),n=r.year(),i=r.dayOfYear(),a=n+56;this._createMissingCalendarData(a);for(var o=9,s=this.NEPALI_CALENDAR_DATA[a][0],l=this.NEPALI_CALENDAR_DATA[a][o]-s+1;i>l;)++o>12&&(o=1,a++),l+=this.NEPALI_CALENDAR_DATA[a][o];var c=this.NEPALI_CALENDAR_DATA[a][o]-(l-i);return this.newDate(a,o,c)},_createMissingCalendarData:function(t){var e=this.daysPerMonth.slice(0);e.unshift(17);for(var r=t-1;r"u"&&(this.NEPALI_CALENDAR_DATA[r]=e)},NEPALI_CALENDAR_DATA:{1970:[18,31,31,32,31,31,31,30,29,30,29,30,30],1971:[18,31,31,32,31,32,30,30,29,30,29,30,30],1972:[17,31,32,31,32,31,30,30,30,29,29,30,30],1973:[19,30,32,31,32,31,30,30,30,29,30,29,31],1974:[19,31,31,32,30,31,31,30,29,30,29,30,30],1975:[18,31,31,32,32,30,31,30,29,30,29,30,30],1976:[17,31,32,31,32,31,30,30,30,29,29,30,31],1977:[18,31,32,31,32,31,31,29,30,29,30,29,31],1978:[18,31,31,32,31,31,31,30,29,30,29,30,30],1979:[18,31,31,32,32,31,30,30,29,30,29,30,30],1980:[17,31,32,31,32,31,30,30,30,29,29,30,31],1981:[18,31,31,31,32,31,31,29,30,30,29,30,30],1982:[18,31,31,32,31,31,31,30,29,30,29,30,30],1983:[18,31,31,32,32,31,30,30,29,30,29,30,30],1984:[17,31,32,31,32,31,30,30,30,29,29,30,31],1985:[18,31,31,31,32,31,31,29,30,30,29,30,30],1986:[18,31,31,32,31,31,31,30,29,30,29,30,30],1987:[18,31,32,31,32,31,30,30,29,30,29,30,30],1988:[17,31,32,31,32,31,30,30,30,29,29,30,31],1989:[18,31,31,31,32,31,31,30,29,30,29,30,30],1990:[18,31,31,32,31,31,31,30,29,30,29,30,30],1991:[18,31,32,31,32,31,30,30,29,30,29,30,30],1992:[17,31,32,31,32,31,30,30,30,29,30,29,31],1993:[18,31,31,31,32,31,31,30,29,30,29,30,30],1994:[18,31,31,32,31,31,31,30,29,30,29,30,30],1995:[17,31,32,31,32,31,30,30,30,29,29,30,30],1996:[17,31,32,31,32,31,30,30,30,29,30,29,31],1997:[18,31,31,32,31,31,31,30,29,30,29,30,30],1998:[18,31,31,32,31,31,31,30,29,30,29,30,30],1999:[17,31,32,31,32,31,30,30,30,29,29,30,31],2e3:[17,30,32,31,32,31,30,30,30,29,30,29,31],2001:[18,31,31,32,31,31,31,30,29,30,29,30,30],2002:[18,31,31,32,32,31,30,30,29,30,29,30,30],2003:[17,31,32,31,32,31,30,30,30,29,29,30,31],2004:[17,30,32,31,32,31,30,30,30,29,30,29,31],2005:[18,31,31,32,31,31,31,30,29,30,29,30,30],2006:[18,31,31,32,32,31,30,30,29,30,29,30,30],2007:[17,31,32,31,32,31,30,30,30,29,29,30,31],2008:[17,31,31,31,32,31,31,29,30,30,29,29,31],2009:[18,31,31,32,31,31,31,30,29,30,29,30,30],2010:[18,31,31,32,32,31,30,30,29,30,29,30,30],2011:[17,31,32,31,32,31,30,30,30,29,29,30,31],2012:[17,31,31,31,32,31,31,29,30,30,29,30,30],2013:[18,31,31,32,31,31,31,30,29,30,29,30,30],2014:[18,31,31,32,32,31,30,30,29,30,29,30,30],2015:[17,31,32,31,32,31,30,30,30,29,29,30,31],2016:[17,31,31,31,32,31,31,29,30,30,29,30,30],2017:[18,31,31,32,31,31,31,30,29,30,29,30,30],2018:[18,31,32,31,32,31,30,30,29,30,29,30,30],2019:[17,31,32,31,32,31,30,30,30,29,30,29,31],2020:[17,31,31,31,32,31,31,30,29,30,29,30,30],2021:[18,31,31,32,31,31,31,30,29,30,29,30,30],2022:[17,31,32,31,32,31,30,30,30,29,29,30,30],2023:[17,31,32,31,32,31,30,30,30,29,30,29,31],2024:[17,31,31,31,32,31,31,30,29,30,29,30,30],2025:[18,31,31,32,31,31,31,30,29,30,29,30,30],2026:[17,31,32,31,32,31,30,30,30,29,29,30,31],2027:[17,30,32,31,32,31,30,30,30,29,30,29,31],2028:[17,31,31,32,31,31,31,30,29,30,29,30,30],2029:[18,31,31,32,31,32,30,30,29,30,29,30,30],2030:[17,31,32,31,32,31,30,30,30,30,30,30,31],2031:[17,31,32,31,32,31,31,31,31,31,31,31,31],2032:[17,32,32,32,32,32,32,32,32,32,32,32,32],2033:[18,31,31,32,32,31,30,30,29,30,29,30,30],2034:[17,31,32,31,32,31,30,30,30,29,29,30,31],2035:[17,30,32,31,32,31,31,29,30,30,29,29,31],2036:[17,31,31,32,31,31,31,30,29,30,29,30,30],2037:[18,31,31,32,32,31,30,30,29,30,29,30,30],2038:[17,31,32,31,32,31,30,30,30,29,29,30,31],2039:[17,31,31,31,32,31,31,29,30,30,29,30,30],2040:[17,31,31,32,31,31,31,30,29,30,29,30,30],2041:[18,31,31,32,32,31,30,30,29,30,29,30,30],2042:[17,31,32,31,32,31,30,30,30,29,29,30,31],2043:[17,31,31,31,32,31,31,29,30,30,29,30,30],2044:[17,31,31,32,31,31,31,30,29,30,29,30,30],2045:[18,31,32,31,32,31,30,30,29,30,29,30,30],2046:[17,31,32,31,32,31,30,30,30,29,29,30,31],2047:[17,31,31,31,32,31,31,30,29,30,29,30,30],2048:[17,31,31,32,31,31,31,30,29,30,29,30,30],2049:[17,31,32,31,32,31,30,30,30,29,29,30,30],2050:[17,31,32,31,32,31,30,30,30,29,30,29,31],2051:[17,31,31,31,32,31,31,30,29,30,29,30,30],2052:[17,31,31,32,31,31,31,30,29,30,29,30,30],2053:[17,31,32,31,32,31,30,30,30,29,29,30,30],2054:[17,31,32,31,32,31,30,30,30,29,30,29,31],2055:[17,31,31,32,31,31,31,30,29,30,30,29,30],2056:[17,31,31,32,31,32,30,30,29,30,29,30,30],2057:[17,31,32,31,32,31,30,30,30,29,29,30,31],2058:[17,30,32,31,32,31,30,30,30,29,30,29,31],2059:[17,31,31,32,31,31,31,30,29,30,29,30,30],2060:[17,31,31,32,32,31,30,30,29,30,29,30,30],2061:[17,31,32,31,32,31,30,30,30,29,29,30,31],2062:[17,30,32,31,32,31,31,29,30,29,30,29,31],2063:[17,31,31,32,31,31,31,30,29,30,29,30,30],2064:[17,31,31,32,32,31,30,30,29,30,29,30,30],2065:[17,31,32,31,32,31,30,30,30,29,29,30,31],2066:[17,31,31,31,32,31,31,29,30,30,29,29,31],2067:[17,31,31,32,31,31,31,30,29,30,29,30,30],2068:[17,31,31,32,32,31,30,30,29,30,29,30,30],2069:[17,31,32,31,32,31,30,30,30,29,29,30,31],2070:[17,31,31,31,32,31,31,29,30,30,29,30,30],2071:[17,31,31,32,31,31,31,30,29,30,29,30,30],2072:[17,31,32,31,32,31,30,30,29,30,29,30,30],2073:[17,31,32,31,32,31,30,30,30,29,29,30,31],2074:[17,31,31,31,32,31,31,30,29,30,29,30,30],2075:[17,31,31,32,31,31,31,30,29,30,29,30,30],2076:[16,31,32,31,32,31,30,30,30,29,29,30,30],2077:[17,31,32,31,32,31,30,30,30,29,30,29,31],2078:[17,31,31,31,32,31,31,30,29,30,29,30,30],2079:[17,31,31,32,31,31,31,30,29,30,29,30,30],2080:[16,31,32,31,32,31,30,30,30,29,29,30,30],2081:[17,31,31,32,32,31,30,30,30,29,30,30,30],2082:[17,31,32,31,32,31,30,30,30,29,30,30,30],2083:[17,31,31,32,31,31,30,30,30,29,30,30,30],2084:[17,31,31,32,31,31,30,30,30,29,30,30,30],2085:[17,31,32,31,32,31,31,30,30,29,30,30,30],2086:[17,31,32,31,32,31,30,30,30,29,30,30,30],2087:[16,31,31,32,31,31,31,30,30,29,30,30,30],2088:[16,30,31,32,32,30,31,30,30,29,30,30,30],2089:[17,31,32,31,32,31,30,30,30,29,30,30,30],2090:[17,31,32,31,32,31,30,30,30,29,30,30,30],2091:[16,31,31,32,31,31,31,30,30,29,30,30,30],2092:[16,31,31,32,32,31,30,30,30,29,30,30,30],2093:[17,31,32,31,32,31,30,30,30,29,30,30,30],2094:[17,31,31,32,31,31,30,30,30,29,30,30,30],2095:[17,31,31,32,31,31,31,30,29,30,30,30,30],2096:[17,30,31,32,32,31,30,30,29,30,29,30,30],2097:[17,31,32,31,32,31,30,30,30,29,30,30,30],2098:[17,31,31,32,31,31,31,29,30,29,30,30,31],2099:[17,31,31,32,31,31,31,30,29,29,30,30,30],2100:[17,31,32,31,32,30,31,30,29,30,29,30,30]}}),t.calendars.nepali=r}}),yA=f({"node_modules/world-calendars/dist/calendars/persian.js"(){var t=aA(),e=oy();function r(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function n(t,e){return t-e*Math.floor(t/e)}r.prototype=new t.baseCalendar,e(r.prototype,{name:"Persian",jdEpoch:1948320.5,daysPerMonth:[31,31,31,31,31,31,30,30,30,30,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Persian",epochs:["BP","AP"],monthNames:["Farvardin","Ordibehesht","Khordad","Tir","Mordad","Shahrivar","Mehr","Aban","Azar","Day","Bahman","Esfand"],monthNamesShort:["Far","Ord","Kho","Tir","Mor","Sha","Meh","Aba","Aza","Day","Bah","Esf"],dayNames:["Yekshambe","Doshambe","Seshambe","Chæharshambe","Panjshambe","Jom'e","Shambe"],dayNamesShort:["Yek","Do","Se","Chæ","Panj","Jom","Sha"],dayNamesMin:["Ye","Do","Se","Ch","Pa","Jo","Sh"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(e){var r=this._validate(e,this.minMonth,this.minDay,t.local.invalidYear);return 682*((r.year()-(r.year()>0?474:473))%2820+474+38)%2816<682},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-(n.dayOfWeek()+1)%7,"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,r){var n=this._validate(e,r,this.minDay,t.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(12===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(e,r,i){var a=this._validate(e,r,i,t.local.invalidDate);e=a.year(),r=a.month(),i=a.day();var o=e-(e>=0?474:473),s=474+n(o,2820);return i+(r<=7?31*(r-1):30*(r-1)+6)+Math.floor((682*s-110)/2816)+365*(s-1)+1029983*Math.floor(o/2820)+this.jdEpoch-1},fromJD:function(t){var e=(t=Math.floor(t)+.5)-this.toJD(475,1,1),r=Math.floor(e/1029983),i=n(e,1029983),a=2820;if(1029982!==i){var o=Math.floor(i/366),s=n(i,366);a=Math.floor((2134*o+2816*s+2815)/1028522)+o+1}var l=a+2820*r+474;l=l<=0?l-1:l;var c=t-this.toJD(l,1,1)+1,u=c<=186?Math.ceil(c/31):Math.ceil((c-6)/30),h=t-this.toJD(l,u,1)+1;return this.newDate(l,u,h)}}),t.calendars.persian=r,t.calendars.jalali=r}}),vA=f({"node_modules/world-calendars/dist/calendars/taiwan.js"(){var t=aA(),e=oy(),r=t.instance();function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}n.prototype=new t.baseCalendar,e(n.prototype,{name:"Taiwan",jdEpoch:2419402.5,yearsOffset:1911,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Taiwan",epochs:["BROC","ROC"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},leapYear:function(e){var n=this._validate(e,this.minMonth,this.minDay,t.local.invalidYear);return e=this._t2gYear(n.year()),r.leapYear(e)},weekOfYear:function(e,n,i){var a=this._validate(e,this.minMonth,this.minDay,t.local.invalidYear);return e=this._t2gYear(a.year()),r.weekOfYear(e,a.month(),a.day())},daysInMonth:function(e,r){var n=this._validate(e,r,this.minDay,t.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(2===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(e,n,i){var a=this._validate(e,n,i,t.local.invalidDate);return e=this._t2gYear(a.year()),r.toJD(e,a.month(),a.day())},fromJD:function(t){var e=r.fromJD(t),n=this._g2tYear(e.year());return this.newDate(n,e.month(),e.day())},_t2gYear:function(t){return t+this.yearsOffset+(t>=-this.yearsOffset&&t<=-1?1:0)},_g2tYear:function(t){return t-this.yearsOffset-(t>=1&&t<=this.yearsOffset?1:0)}}),t.calendars.taiwan=n}}),xA=f({"node_modules/world-calendars/dist/calendars/thai.js"(){var t=aA(),e=oy(),r=t.instance();function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}n.prototype=new t.baseCalendar,e(n.prototype,{name:"Thai",jdEpoch:1523098.5,yearsOffset:543,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Thai",epochs:["BBE","BE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var n=this._validate(e,this.minMonth,this.minDay,t.local.invalidYear);return e=this._t2gYear(n.year()),r.leapYear(e)},weekOfYear:function(e,n,i){var a=this._validate(e,this.minMonth,this.minDay,t.local.invalidYear);return e=this._t2gYear(a.year()),r.weekOfYear(e,a.month(),a.day())},daysInMonth:function(e,r){var n=this._validate(e,r,this.minDay,t.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(2===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(e,n,i){var a=this._validate(e,n,i,t.local.invalidDate);return e=this._t2gYear(a.year()),r.toJD(e,a.month(),a.day())},fromJD:function(t){var e=r.fromJD(t),n=this._g2tYear(e.year());return this.newDate(n,e.month(),e.day())},_t2gYear:function(t){return t-this.yearsOffset-(t>=1&&t<=this.yearsOffset?1:0)},_g2tYear:function(t){return t+this.yearsOffset+(t>=-this.yearsOffset&&t<=-1?1:0)}}),t.calendars.thai=n}}),_A=f({"node_modules/world-calendars/dist/calendars/ummalqura.js"(){var t=aA(),e=oy();function r(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}r.prototype=new t.baseCalendar,e(r.prototype,{name:"UmmAlQura",hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Umm al-Qura",epochs:["BH","AH"],monthNames:["Al-Muharram","Safar","Rabi' al-awwal","Rabi' Al-Thani","Jumada Al-Awwal","Jumada Al-Thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-Ahad","Yawm al-Ithnain","Yawm al-Thalāthā’","Yawm al-Arba‘ā’","Yawm al-Khamīs","Yawm al-Jum‘a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(e){var r=this._validate(e,this.minMonth,this.minDay,t.local.invalidYear);return 355===this.daysInYear(r.year())},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){for(var e=0,r=1;r<=12;r++)e+=this.daysInMonth(t,r);return e},daysInMonth:function(e,r){for(var i=this._validate(e,r,this.minDay,t.local.invalidMonth).toJD()-24e5+.5,a=0,o=0;oi)return n[a]-n[a-1];a++}return 30},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(e,r,i){var a=this._validate(e,r,i,t.local.invalidDate),o=12*(a.year()-1)+a.month()-15292;return a.day()+n[o-1]-1+24e5-.5},fromJD:function(t){for(var e=t-24e5+.5,r=0,i=0;ie);i++)r++;var a=r+15292,o=Math.floor((a-1)/12),s=o+1,l=a-12*o,c=e-n[r-1]+1;return this.newDate(s,l,c)},isValid:function(e,r,n){var i=t.baseCalendar.prototype.isValid.apply(this,arguments);return i&&(i=(e=null!=e.year?e.year:e)>=1276&&e<=1500),i},_validate:function(e,r,n,i){var a=t.baseCalendar.prototype._validate.apply(this,arguments);if(a.year<1276||a.year>1500)throw i.replace(/\{0\}/,this.local.name);return a}}),t.calendars.ummalqura=r;var n=[20,50,79,109,138,168,197,227,256,286,315,345,374,404,433,463,492,522,551,581,611,641,670,700,729,759,788,818,847,877,906,936,965,995,1024,1054,1083,1113,1142,1172,1201,1231,1260,1290,1320,1350,1379,1409,1438,1468,1497,1527,1556,1586,1615,1645,1674,1704,1733,1763,1792,1822,1851,1881,1910,1940,1969,1999,2028,2058,2087,2117,2146,2176,2205,2235,2264,2294,2323,2353,2383,2413,2442,2472,2501,2531,2560,2590,2619,2649,2678,2708,2737,2767,2796,2826,2855,2885,2914,2944,2973,3003,3032,3062,3091,3121,3150,3180,3209,3239,3268,3298,3327,3357,3386,3416,3446,3476,3505,3535,3564,3594,3623,3653,3682,3712,3741,3771,3800,3830,3859,3889,3918,3948,3977,4007,4036,4066,4095,4125,4155,4185,4214,4244,4273,4303,4332,4362,4391,4421,4450,4480,4509,4539,4568,4598,4627,4657,4686,4716,4745,4775,4804,4834,4863,4893,4922,4952,4981,5011,5040,5070,5099,5129,5158,5188,5218,5248,5277,5307,5336,5366,5395,5425,5454,5484,5513,5543,5572,5602,5631,5661,5690,5720,5749,5779,5808,5838,5867,5897,5926,5956,5985,6015,6044,6074,6103,6133,6162,6192,6221,6251,6281,6311,6340,6370,6399,6429,6458,6488,6517,6547,6576,6606,6635,6665,6694,6724,6753,6783,6812,6842,6871,6901,6930,6960,6989,7019,7048,7078,7107,7137,7166,7196,7225,7255,7284,7314,7344,7374,7403,7433,7462,7492,7521,7551,7580,7610,7639,7669,7698,7728,7757,7787,7816,7846,7875,7905,7934,7964,7993,8023,8053,8083,8112,8142,8171,8201,8230,8260,8289,8319,8348,8378,8407,8437,8466,8496,8525,8555,8584,8614,8643,8673,8702,8732,8761,8791,8821,8850,8880,8909,8938,8968,8997,9027,9056,9086,9115,9145,9175,9205,9234,9264,9293,9322,9352,9381,9410,9440,9470,9499,9529,9559,9589,9618,9648,9677,9706,9736,9765,9794,9824,9853,9883,9913,9943,9972,10002,10032,10061,10090,10120,10149,10178,10208,10237,10267,10297,10326,10356,10386,10415,10445,10474,10504,10533,10562,10592,10621,10651,10680,10710,10740,10770,10799,10829,10858,10888,10917,10947,10976,11005,11035,11064,11094,11124,11153,11183,11213,11242,11272,11301,11331,11360,11389,11419,11448,11478,11507,11537,11567,11596,11626,11655,11685,11715,11744,11774,11803,11832,11862,11891,11921,11950,11980,12010,12039,12069,12099,12128,12158,12187,12216,12246,12275,12304,12334,12364,12393,12423,12453,12483,12512,12542,12571,12600,12630,12659,12688,12718,12747,12777,12807,12837,12866,12896,12926,12955,12984,13014,13043,13072,13102,13131,13161,13191,13220,13250,13280,13310,13339,13368,13398,13427,13456,13486,13515,13545,13574,13604,13634,13664,13693,13723,13752,13782,13811,13840,13870,13899,13929,13958,13988,14018,14047,14077,14107,14136,14166,14195,14224,14254,14283,14313,14342,14372,14401,14431,14461,14490,14520,14550,14579,14609,14638,14667,14697,14726,14756,14785,14815,14844,14874,14904,14933,14963,14993,15021,15051,15081,15110,15140,15169,15199,15228,15258,15287,15317,15347,15377,15406,15436,15465,15494,15524,15553,15582,15612,15641,15671,15701,15731,15760,15790,15820,15849,15878,15908,15937,15966,15996,16025,16055,16085,16114,16144,16174,16204,16233,16262,16292,16321,16350,16380,16409,16439,16468,16498,16528,16558,16587,16617,16646,16676,16705,16734,16764,16793,16823,16852,16882,16912,16941,16971,17001,17030,17060,17089,17118,17148,17177,17207,17236,17266,17295,17325,17355,17384,17414,17444,17473,17502,17532,17561,17591,17620,17650,17679,17709,17738,17768,17798,17827,17857,17886,17916,17945,17975,18004,18034,18063,18093,18122,18152,18181,18211,18241,18270,18300,18330,18359,18388,18418,18447,18476,18506,18535,18565,18595,18625,18654,18684,18714,18743,18772,18802,18831,18860,18890,18919,18949,18979,19008,19038,19068,19098,19127,19156,19186,19215,19244,19274,19303,19333,19362,19392,19422,19452,19481,19511,19540,19570,19599,19628,19658,19687,19717,19746,19776,19806,19836,19865,19895,19924,19954,19983,20012,20042,20071,20101,20130,20160,20190,20219,20249,20279,20308,20338,20367,20396,20426,20455,20485,20514,20544,20573,20603,20633,20662,20692,20721,20751,20780,20810,20839,20869,20898,20928,20957,20987,21016,21046,21076,21105,21135,21164,21194,21223,21253,21282,21312,21341,21371,21400,21430,21459,21489,21519,21548,21578,21607,21637,21666,21696,21725,21754,21784,21813,21843,21873,21902,21932,21962,21991,22021,22050,22080,22109,22138,22168,22197,22227,22256,22286,22316,22346,22375,22405,22434,22464,22493,22522,22552,22581,22611,22640,22670,22700,22730,22759,22789,22818,22848,22877,22906,22936,22965,22994,23024,23054,23083,23113,23143,23173,23202,23232,23261,23290,23320,23349,23379,23408,23438,23467,23497,23527,23556,23586,23616,23645,23674,23704,23733,23763,23792,23822,23851,23881,23910,23940,23970,23999,24029,24058,24088,24117,24147,24176,24206,24235,24265,24294,24324,24353,24383,24413,24442,24472,24501,24531,24560,24590,24619,24648,24678,24707,24737,24767,24796,24826,24856,24885,24915,24944,24974,25003,25032,25062,25091,25121,25150,25180,25210,25240,25269,25299,25328,25358,25387,25416,25446,25475,25505,25534,25564,25594,25624,25653,25683,25712,25742,25771,25800,25830,25859,25888,25918,25948,25977,26007,26037,26067,26096,26126,26155,26184,26214,26243,26272,26302,26332,26361,26391,26421,26451,26480,26510,26539,26568,26598,26627,26656,26686,26715,26745,26775,26805,26834,26864,26893,26923,26952,26982,27011,27041,27070,27099,27129,27159,27188,27218,27248,27277,27307,27336,27366,27395,27425,27454,27484,27513,27542,27572,27602,27631,27661,27691,27720,27750,27779,27809,27838,27868,27897,27926,27956,27985,28015,28045,28074,28104,28134,28163,28193,28222,28252,28281,28310,28340,28369,28399,28428,28458,28488,28517,28547,28577,28607,28636,28665,28695,28724,28754,28783,28813,28843,28872,28901,28931,28960,28990,29019,29049,29078,29108,29137,29167,29196,29226,29255,29285,29315,29345,29375,29404,29434,29463,29492,29522,29551,29580,29610,29640,29669,29699,29729,29759,29788,29818,29847,29876,29906,29935,29964,29994,30023,30053,30082,30112,30141,30171,30200,30230,30259,30289,30318,30348,30378,30408,30437,30467,30496,30526,30555,30585,30614,30644,30673,30703,30732,30762,30791,30821,30850,30880,30909,30939,30968,30998,31027,31057,31086,31116,31145,31175,31204,31234,31263,31293,31322,31352,31381,31411,31441,31471,31500,31530,31559,31589,31618,31648,31676,31706,31736,31766,31795,31825,31854,31884,31913,31943,31972,32002,32031,32061,32090,32120,32150,32180,32209,32239,32268,32298,32327,32357,32386,32416,32445,32475,32504,32534,32563,32593,32622,32652,32681,32711,32740,32770,32799,32829,32858,32888,32917,32947,32976,33006,33035,33065,33094,33124,33153,33183,33213,33243,33272,33302,33331,33361,33390,33420,33450,33479,33509,33539,33568,33598,33627,33657,33686,33716,33745,33775,33804,33834,33863,33893,33922,33952,33981,34011,34040,34069,34099,34128,34158,34187,34217,34247,34277,34306,34336,34365,34395,34424,34454,34483,34512,34542,34571,34601,34631,34660,34690,34719,34749,34778,34808,34837,34867,34896,34926,34955,34985,35015,35044,35074,35103,35133,35162,35192,35222,35251,35280,35310,35340,35370,35399,35429,35458,35488,35517,35547,35576,35605,35635,35665,35694,35723,35753,35782,35811,35841,35871,35901,35930,35960,35989,36019,36048,36078,36107,36136,36166,36195,36225,36254,36284,36314,36343,36373,36403,36433,36462,36492,36521,36551,36580,36610,36639,36669,36698,36728,36757,36786,36816,36845,36875,36904,36934,36963,36993,37022,37052,37081,37111,37141,37170,37200,37229,37259,37288,37318,37347,37377,37406,37436,37465,37495,37524,37554,37584,37613,37643,37672,37701,37731,37760,37790,37819,37849,37878,37908,37938,37967,37997,38027,38056,38085,38115,38144,38174,38203,38233,38262,38292,38322,38351,38381,38410,38440,38469,38499,38528,38558,38587,38617,38646,38676,38705,38735,38764,38794,38823,38853,38882,38912,38941,38971,39001,39030,39059,39089,39118,39148,39178,39208,39237,39267,39297,39326,39355,39385,39414,39444,39473,39503,39532,39562,39592,39621,39650,39680,39709,39739,39768,39798,39827,39857,39886,39916,39946,39975,40005,40035,40064,40094,40123,40153,40182,40212,40241,40271,40300,40330,40359,40389,40418,40448,40477,40507,40536,40566,40595,40625,40655,40685,40714,40744,40773,40803,40832,40862,40892,40921,40951,40980,41009,41039,41068,41098,41127,41157,41186,41216,41245,41275,41304,41334,41364,41393,41422,41452,41481,41511,41540,41570,41599,41629,41658,41688,41718,41748,41777,41807,41836,41865,41894,41924,41953,41983,42012,42042,42072,42102,42131,42161,42190,42220,42249,42279,42308,42337,42367,42397,42426,42456,42485,42515,42545,42574,42604,42633,42662,42692,42721,42751,42780,42810,42839,42869,42899,42929,42958,42988,43017,43046,43076,43105,43135,43164,43194,43223,43253,43283,43312,43342,43371,43401,43430,43460,43489,43519,43548,43578,43607,43637,43666,43696,43726,43755,43785,43814,43844,43873,43903,43932,43962,43991,44021,44050,44080,44109,44139,44169,44198,44228,44258,44287,44317,44346,44375,44405,44434,44464,44493,44523,44553,44582,44612,44641,44671,44700,44730,44759,44788,44818,44847,44877,44906,44936,44966,44996,45025,45055,45084,45114,45143,45172,45202,45231,45261,45290,45320,45350,45380,45409,45439,45468,45498,45527,45556,45586,45615,45644,45674,45704,45733,45763,45793,45823,45852,45882,45911,45940,45970,45999,46028,46058,46088,46117,46147,46177,46206,46236,46265,46295,46324,46354,46383,46413,46442,46472,46501,46531,46560,46590,46620,46649,46679,46708,46738,46767,46797,46826,46856,46885,46915,46944,46974,47003,47033,47063,47092,47122,47151,47181,47210,47240,47269,47298,47328,47357,47387,47417,47446,47476,47506,47535,47565,47594,47624,47653,47682,47712,47741,47771,47800,47830,47860,47890,47919,47949,47978,48008,48037,48066,48096,48125,48155,48184,48214,48244,48273,48303,48333,48362,48392,48421,48450,48480,48509,48538,48568,48598,48627,48657,48687,48717,48746,48776,48805,48834,48864,48893,48922,48952,48982,49011,49041,49071,49100,49130,49160,49189,49218,49248,49277,49306,49336,49365,49395,49425,49455,49484,49514,49543,49573,49602,49632,49661,49690,49720,49749,49779,49809,49838,49868,49898,49927,49957,49986,50016,50045,50075,50104,50133,50163,50192,50222,50252,50281,50311,50340,50370,50400,50429,50459,50488,50518,50547,50576,50606,50635,50665,50694,50724,50754,50784,50813,50843,50872,50902,50931,50960,50990,51019,51049,51078,51108,51138,51167,51197,51227,51256,51286,51315,51345,51374,51403,51433,51462,51492,51522,51552,51582,51611,51641,51670,51699,51729,51758,51787,51816,51846,51876,51906,51936,51965,51995,52025,52054,52083,52113,52142,52171,52200,52230,52260,52290,52319,52349,52379,52408,52438,52467,52497,52526,52555,52585,52614,52644,52673,52703,52733,52762,52792,52822,52851,52881,52910,52939,52969,52998,53028,53057,53087,53116,53146,53176,53205,53235,53264,53294,53324,53353,53383,53412,53441,53471,53500,53530,53559,53589,53619,53648,53678,53708,53737,53767,53796,53825,53855,53884,53913,53943,53973,54003,54032,54062,54092,54121,54151,54180,54209,54239,54268,54297,54327,54357,54387,54416,54446,54476,54505,54535,54564,54593,54623,54652,54681,54711,54741,54770,54800,54830,54859,54889,54919,54948,54977,55007,55036,55066,55095,55125,55154,55184,55213,55243,55273,55302,55332,55361,55391,55420,55450,55479,55508,55538,55567,55597,55627,55657,55686,55716,55745,55775,55804,55834,55863,55892,55922,55951,55981,56011,56040,56070,56100,56129,56159,56188,56218,56247,56276,56306,56335,56365,56394,56424,56454,56483,56513,56543,56572,56601,56631,56660,56690,56719,56749,56778,56808,56837,56867,56897,56926,56956,56985,57015,57044,57074,57103,57133,57162,57192,57221,57251,57280,57310,57340,57369,57399,57429,57458,57487,57517,57546,57576,57605,57634,57664,57694,57723,57753,57783,57813,57842,57871,57901,57930,57959,57989,58018,58048,58077,58107,58137,58167,58196,58226,58255,58285,58314,58343,58373,58402,58432,58461,58491,58521,58551,58580,58610,58639,58669,58698,58727,58757,58786,58816,58845,58875,58905,58934,58964,58994,59023,59053,59082,59111,59141,59170,59200,59229,59259,59288,59318,59348,59377,59407,59436,59466,59495,59525,59554,59584,59613,59643,59672,59702,59731,59761,59791,59820,59850,59879,59909,59939,59968,59997,60027,60056,60086,60115,60145,60174,60204,60234,60264,60293,60323,60352,60381,60411,60440,60469,60499,60528,60558,60588,60618,60648,60677,60707,60736,60765,60795,60824,60853,60883,60912,60942,60972,61002,61031,61061,61090,61120,61149,61179,61208,61237,61267,61296,61326,61356,61385,61415,61445,61474,61504,61533,61563,61592,61621,61651,61680,61710,61739,61769,61799,61828,61858,61888,61917,61947,61976,62006,62035,62064,62094,62123,62153,62182,62212,62242,62271,62301,62331,62360,62390,62419,62448,62478,62507,62537,62566,62596,62625,62655,62685,62715,62744,62774,62803,62832,62862,62891,62921,62950,62980,63009,63039,63069,63099,63128,63157,63187,63216,63246,63275,63305,63334,63363,63393,63423,63453,63482,63512,63541,63571,63600,63630,63659,63689,63718,63747,63777,63807,63836,63866,63895,63925,63955,63984,64014,64043,64073,64102,64131,64161,64190,64220,64249,64279,64309,64339,64368,64398,64427,64457,64486,64515,64545,64574,64603,64633,64663,64692,64722,64752,64782,64811,64841,64870,64899,64929,64958,64987,65017,65047,65076,65106,65136,65166,65195,65225,65254,65283,65313,65342,65371,65401,65431,65460,65490,65520,65549,65579,65608,65638,65667,65697,65726,65755,65785,65815,65844,65874,65903,65933,65963,65992,66022,66051,66081,66110,66140,66169,66199,66228,66258,66287,66317,66346,66376,66405,66435,66465,66494,66524,66553,66583,66612,66641,66671,66700,66730,66760,66789,66819,66849,66878,66908,66937,66967,66996,67025,67055,67084,67114,67143,67173,67203,67233,67262,67292,67321,67351,67380,67409,67439,67468,67497,67527,67557,67587,67617,67646,67676,67705,67735,67764,67793,67823,67852,67882,67911,67941,67971,68e3,68030,68060,68089,68119,68148,68177,68207,68236,68266,68295,68325,68354,68384,68414,68443,68473,68502,68532,68561,68591,68620,68650,68679,68708,68738,68768,68797,68827,68857,68886,68916,68946,68975,69004,69034,69063,69092,69122,69152,69181,69211,69240,69270,69300,69330,69359,69388,69418,69447,69476,69506,69535,69565,69595,69624,69654,69684,69713,69743,69772,69802,69831,69861,69890,69919,69949,69978,70008,70038,70067,70097,70126,70156,70186,70215,70245,70274,70303,70333,70362,70392,70421,70451,70481,70510,70540,70570,70599,70629,70658,70687,70717,70746,70776,70805,70835,70864,70894,70924,70954,70983,71013,71042,71071,71101,71130,71159,71189,71218,71248,71278,71308,71337,71367,71397,71426,71455,71485,71514,71543,71573,71602,71632,71662,71691,71721,71751,71781,71810,71839,71869,71898,71927,71957,71986,72016,72046,72075,72105,72135,72164,72194,72223,72253,72282,72311,72341,72370,72400,72429,72459,72489,72518,72548,72577,72607,72637,72666,72695,72725,72754,72784,72813,72843,72872,72902,72931,72961,72991,73020,73050,73080,73109,73139,73168,73197,73227,73256,73286,73315,73345,73375,73404,73434,73464,73493,73523,73552,73581,73611,73640,73669,73699,73729,73758,73788,73818,73848,73877,73907,73936,73965,73995,74024,74053,74083,74113,74142,74172,74202,74231,74261,74291,74320,74349,74379,74408,74437,74467,74497,74526,74556,74586,74615,74645,74675,74704,74733,74763,74792,74822,74851,74881,74910,74940,74969,74999,75029,75058,75088,75117,75147,75176,75206,75235,75264,75294,75323,75353,75383,75412,75442,75472,75501,75531,75560,75590,75619,75648,75678,75707,75737,75766,75796,75826,75856,75885,75915,75944,75974,76003,76032,76062,76091,76121,76150,76180,76210,76239,76269,76299,76328,76358,76387,76416,76446,76475,76505,76534,76564,76593,76623,76653,76682,76712,76741,76771,76801,76830,76859,76889,76918,76948,76977,77007,77036,77066,77096,77125,77155,77185,77214,77243,77273,77302,77332,77361,77390,77420,77450,77479,77509,77539,77569,77598,77627,77657,77686,77715,77745,77774,77804,77833,77863,77893,77923,77952,77982,78011,78041,78070,78099,78129,78158,78188,78217,78247,78277,78307,78336,78366,78395,78425,78454,78483,78513,78542,78572,78601,78631,78661,78690,78720,78750,78779,78808,78838,78867,78897,78926,78956,78985,79015,79044,79074,79104,79133,79163,79192,79222,79251,79281,79310,79340,79369,79399,79428,79458,79487,79517,79546,79576,79606,79635,79665,79695,79724,79753,79783,79812,79841,79871,79900,79930,79960,79990]}}),bA=f({"src/components/calendars/calendars.js"(t,e){e.exports=aA(),oA(),sA(),lA(),cA(),uA(),hA(),pA(),fA(),dA(),mA(),gA(),yA(),vA(),xA(),_A()}}),wA=f({"src/components/calendars/index.js"(t,e){var r=bA(),n=le(),i=k(),a=i.EPOCHJD,o=i.ONEDAY,s={valType:"enumerated",values:n.sortObjectKeys(r.calendars),editType:"calc",dflt:"gregorian"},l=function(t,e,r,i){var a={};return a[r]=s,n.coerce(t,e,a,r,i)},c="##",u={d:{0:"dd","-":"d"},e:{0:"d","-":"d"},a:{0:"D","-":"D"},A:{0:"DD","-":"DD"},j:{0:"oo","-":"o"},W:{0:"ww","-":"w"},m:{0:"mm","-":"m"},b:{0:"M","-":"M"},B:{0:"MM","-":"MM"},y:{0:"yy","-":"yy"},Y:{0:"yyyy","-":"yyyy"},U:c,w:c,c:{0:"D M d %X yyyy","-":"D M d %X yyyy"},x:{0:"mm/dd/yyyy","-":"mm/dd/yyyy"}},h={};function p(t){var e=h[t];return e||(h[t]=r.instance(t))}function f(t){return n.extendFlat({},s,{description:t})}function d(t){return"Sets the calendar system to use with `"+t+"` date data."}var m={xcalendar:f(d("x"))},g=n.extendFlat({},m,{ycalendar:f(d("y"))}),y=n.extendFlat({},g,{zcalendar:f(d("z"))}),v=f(["Sets the calendar system to use for `range` and `tick0`","if this is a date axis. This does not set the calendar for","interpreting data on this axis, that's specified in the trace","or via the global `layout.calendar`"].join(" "));e.exports={moduleType:"component",name:"calendars",schema:{traces:{scatter:g,bar:g,box:g,heatmap:g,contour:g,histogram:g,histogram2d:g,histogram2dcontour:g,scatter3d:y,surface:y,mesh3d:y,scattergl:g,ohlc:m,candlestick:m},layout:{calendar:f(["Sets the default calendar system to use for interpreting and","displaying dates throughout the plot."].join(" "))},subplots:{xaxis:{calendar:v},yaxis:{calendar:v},scene:{xaxis:{calendar:v},yaxis:{calendar:v},zaxis:{calendar:v}},polar:{radialaxis:{calendar:v}}}},layoutAttributes:s,handleDefaults:l,handleTraceDefaults:function(t,e,r,n){for(var i=0;i{n.preventDefault(),n.stopPropagation(),n.clipboardData.setData("text",t),e.removeEventListener("copy",r,!0)};e.addEventListener("copy",r,!0),document.execCommand("copy")},(l=i||(i={})).boxSizing=function(t){let e=window.getComputedStyle(t),r=parseFloat(e.borderTopWidth)||0,n=parseFloat(e.borderLeftWidth)||0,i=parseFloat(e.borderRightWidth)||0,a=parseFloat(e.borderBottomWidth)||0,o=parseFloat(e.paddingTop)||0,s=parseFloat(e.paddingLeft)||0,l=parseFloat(e.paddingRight)||0,c=parseFloat(e.paddingBottom)||0;return{borderTop:r,borderLeft:n,borderRight:i,borderBottom:a,paddingTop:o,paddingLeft:s,paddingRight:l,paddingBottom:c,horizontalSum:n+s+l+i,verticalSum:r+o+c+a}},l.sizeLimits=function(t){let e=window.getComputedStyle(t),r=parseFloat(e.minWidth)||0,n=parseFloat(e.minHeight)||0,i=parseFloat(e.maxWidth)||1/0,a=parseFloat(e.maxHeight)||1/0;return i=Math.max(r,i),a=Math.max(n,a),{minWidth:r,minHeight:n,maxWidth:i,maxHeight:a}},l.hitTest=function(t,e,r){let n=t.getBoundingClientRect();return e>=n.left&&e=n.top&&r=r.bottom)){if(n.topr.bottom&&n.height>=r.height)return void(t.scrollTop-=r.top-n.top);if(n.topr.height)return void(t.scrollTop-=r.bottom-n.bottom);if(n.bottom>r.bottom&&n.height{let t=Element.prototype;return t.matches||t.matchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector||function(t){let e=this,r=e.ownerDocument?e.ownerDocument.querySelectorAll(t):[];return-1!==Array.prototype.indexOf.call(r,e)}})(),t.calculateSingle=function(t){let c=0,u=0,h=0;function p(e){let r=t.match(e);return null!==r&&(t=t.slice(r[0].length),!0)}for(t=(t=t.split(",",1)[0]).replace(l," $1 ");t.length>0;)if(p(e))c++;else if(p(r))u++;else if(p(n))u++;else if(p(a))h++;else if(p(o))u++;else if(p(i))h++;else if(!p(s))return 0;return c=Math.min(c,255),u=Math.min(u,255),h=Math.min(h,255),c<<16|u<<8|h};let e=/^#[^\s\+>~#\.\[:]+/,r=/^\.[^\s\+>~#\.\[:]+/,n=/^\[[^\]]+\]/,i=/^[^\s\+>~#\.\[:]+/,a=/^(::[^\s\+>~#\.\[:]+|:first-line|:first-letter|:before|:after)/,o=/^:[^\s\+>~#\.\[:]+/,s=/^[\s\+>~\*]+/,l=/:not\(([^\)]+)\)/g}(s||(s={}));var T,A=y(v()),k=class{constructor(){this._first=null,this._last=null,this._size=0}get isEmpty(){return 0===this._size}get size(){return this._size}get length(){return this._size}get first(){return this._first?this._first.value:void 0}get last(){return this._last?this._last.value:void 0}get firstNode(){return this._first}get lastNode(){return this._last}*[Symbol.iterator](){let t=this._first;for(;t;)yield t.value,t=t.next}*retro(){let t=this._last;for(;t;)yield t.value,t=t.prev}*nodes(){let t=this._first;for(;t;)yield t,t=t.next}*retroNodes(){let t=this._last;for(;t;)yield t,t=t.prev}assign(t){this.clear();for(let e of t)this.addLast(e)}push(t){this.addLast(t)}pop(){return this.removeLast()}shift(t){this.addFirst(t)}unshift(){return this.removeFirst()}addFirst(t){let e=new T.LinkedListNode(this,t);return this._first?(e.next=this._first,this._first.prev=e,this._first=e):(this._first=e,this._last=e),this._size++,e}addLast(t){let e=new T.LinkedListNode(this,t);return this._last?(e.prev=this._last,this._last.next=e,this._last=e):(this._first=e,this._last=e),this._size++,e}insertBefore(t,e){if(!e||e===this._first)return this.addFirst(t);if(!(e instanceof T.LinkedListNode)||e.list!==this)throw new Error("Reference node is not owned by the list.");let r=new T.LinkedListNode(this,t),n=e,i=n.prev;return r.next=n,r.prev=i,n.prev=r,i.next=r,this._size++,r}insertAfter(t,e){if(!e||e===this._last)return this.addLast(t);if(!(e instanceof T.LinkedListNode)||e.list!==this)throw new Error("Reference node is not owned by the list.");let r=new T.LinkedListNode(this,t),n=e,i=n.next;return r.next=i,r.prev=n,n.next=r,i.prev=r,this._size++,r}removeFirst(){let t=this._first;if(t)return t===this._last?(this._first=null,this._last=null):(this._first=t.next,this._first.prev=null),t.list=null,t.next=null,t.prev=null,this._size--,t.value}removeLast(){let t=this._last;if(t)return t===this._first?(this._first=null,this._last=null):(this._last=t.prev,this._last.next=null),t.list=null,t.next=null,t.prev=null,this._size--,t.value}removeNode(t){if(!(t instanceof T.LinkedListNode)||t.list!==this)throw new Error("Node is not owned by the list.");let e=t;e===this._first&&e===this._last?(this._first=null,this._last=null):e===this._first?(this._first=e.next,this._first.prev=null):e===this._last?(this._last=e.prev,this._last.next=null):(e.next.prev=e.prev,e.prev.next=e.next),e.list=null,e.next=null,e.prev=null,this._size--}clear(){let t=this._first;for(;t;){let e=t.next;t.list=null,t.prev=null,t.next=null,t=e}this._first=null,this._last=null,this._size=0}};!function(t){t.from=function(e){let r=new t;return r.assign(e),r}}(k||(k={})),function(t){t.LinkedListNode=class{constructor(t,e){this.list=null,this.next=null,this.prev=null,this.list=t,this.value=e}}}(T||(T={}));var M,S=class{constructor(t){this.type=t}get isConflatable(){return!1}conflate(t){return!1}},E=class extends S{get isConflatable(){return!0}conflate(t){return!0}};!function(t){let e=null,r=(n=Promise.resolve(),t=>{let e=!1;return n.then((()=>!e&&t())),()=>{e=!0}});var n;function i(t,e){let r=o.get(t);r&&0!==r.length?(0,A.every)((0,A.retro)(r),(r=>!r||function(t,e,r){let n=!0;try{n="function"==typeof t?t(e,r):t.messageHook(e,r)}catch(t){l(t)}return n}(r,t,e)))&&u(t,e):u(t,e)}t.sendMessage=i,t.postMessage=function(t,n){n.isConflatable&&(0,A.some)(a,(e=>!(e.handler!==t||!e.msg||e.msg.type!==n.type||!e.msg.isConflatable)&&e.msg.conflate(n)))||function(t,n){a.addLast({handler:t,msg:n}),null===e&&(e=r(h))}(t,n)},t.installMessageHook=function(t,e){let r=o.get(t);r&&-1!==r.indexOf(e)||(r?r.push(e):o.set(t,[e]))},t.removeMessageHook=function(t,e){let r=o.get(t);if(!r)return;let n=r.indexOf(e);-1!==n&&(r[n]=null,p(r))},t.clearData=function(t){let e=o.get(t);e&&e.length>0&&(A.ArrayExt.fill(e,null),p(e));for(let e of a)e.handler===t&&(e.handler=null,e.msg=null)},t.flush=function(){c||null===e||(e(),e=null,c=!0,h(),c=!1)},t.getExceptionHandler=function(){return l},t.setExceptionHandler=function(t){let e=l;return l=t,e};let a=new k,o=new WeakMap,s=new Set,l=t=>{console.error(t)},c=!1;function u(t,e){try{t.processMessage(e)}catch(t){l(t)}}function h(){if(e=null,a.isEmpty)return;let t={handler:null,msg:null};for(a.addLast(t);;){let e=a.removeFirst();if(e===t)return;e.handler&&e.msg&&i(e.handler,e.msg)}}function p(t){0===s.size&&r(f),s.add(t)}function f(){s.forEach(d),s.clear()}function d(t){A.ArrayExt.removeAllWhere(t,m)}function m(t){return null===t}}(M||(M={}));var C,I=class{constructor(t){this._pid=C.nextPID(),this.name=t.name,this._create=t.create,this._coerce=t.coerce||null,this._compare=t.compare||null,this._changed=t.changed||null}get(t){let e,r=C.ensureMap(t);return e=this._pid in r?r[this._pid]:r[this._pid]=this._createValue(t),e}set(t,e){let r,n=C.ensureMap(t);r=this._pid in n?n[this._pid]:n[this._pid]=this._createValue(t);let i=this._coerceValue(t,e);this._maybeNotify(t,r,n[this._pid]=i)}coerce(t){let e,r=C.ensureMap(t);e=this._pid in r?r[this._pid]:r[this._pid]=this._createValue(t);let n=this._coerceValue(t,e);this._maybeNotify(t,e,r[this._pid]=n)}_createValue(t){return(0,this._create)(t)}_coerceValue(t,e){let r=this._coerce;return r?r(t,e):e}_compareValue(t,e){let r=this._compare;return r?r(t,e):t===e}_maybeNotify(t,e,r){let n=this._changed;n&&!this._compareValue(e,r)&&n(t,e,r)}};!function(t){t.clearData=function(t){C.ownerData.delete(t)}}(I||(I={})),function(t){t.ownerData=new WeakMap,t.nextPID=(()=>{let t=0;return()=>`pid-${`${Math.random()}`.slice(2)}-${t++}`})(),t.ensureMap=function(e){let r=t.ownerData.get(e);return r||(r=Object.create(null),t.ownerData.set(e,r),r)}}(C||(C={}));var L,P=y(v()),z=(y(x()),class{constructor(t){this.sender=t}connect(t,e){return L.connect(this,t,e)}disconnect(t,e){return L.disconnect(this,t,e)}emit(t){L.emit(this,t)}});!function(t){t.disconnectBetween=function(t,e){L.disconnectBetween(t,e)},t.disconnectSender=function(t){L.disconnectSender(t)},t.disconnectReceiver=function(t){L.disconnectReceiver(t)},t.disconnectAll=function(t){L.disconnectAll(t)},t.clearData=function(t){L.disconnectAll(t)},t.getExceptionHandler=function(){return L.exceptionHandler},t.setExceptionHandler=function(t){let e=L.exceptionHandler;return L.exceptionHandler=t,e}}(z||(z={})),function(t){function e(t){let e=n.get(t);if(e&&0!==e.length){for(let t of e){if(!t.signal)continue;let e=t.thisArg||t.slot;t.signal=null,c(i.get(e))}c(e)}}function r(t){let e=i.get(t);if(e&&0!==e.length){for(let t of e){if(!t.signal)continue;let e=t.signal.sender;t.signal=null,c(n.get(e))}c(e)}}t.exceptionHandler=t=>{console.error(t)},t.connect=function(t,e,r){r=r||void 0;let a=n.get(t.sender);if(a||(a=[],n.set(t.sender,a)),s(a,t,e,r))return!1;let o=r||e,l=i.get(o);l||(l=[],i.set(o,l));let c={signal:t,slot:e,thisArg:r};return a.push(c),l.push(c),!0},t.disconnect=function(t,e,r){r=r||void 0;let a=n.get(t.sender);if(!a||0===a.length)return!1;let o=s(a,t,e,r);if(!o)return!1;let l=r||e,u=i.get(l);return o.signal=null,c(a),c(u),!0},t.disconnectBetween=function(t,e){let r=n.get(t);if(!r||0===r.length)return;let a=i.get(e);if(a&&0!==a.length){for(let e of a)e.signal&&e.signal.sender===t&&(e.signal=null);c(r),c(a)}},t.disconnectSender=e,t.disconnectReceiver=r,t.disconnectAll=function(t){e(t),r(t)},t.emit=function(t,e){let r=n.get(t.sender);if(r&&0!==r.length)for(let n=0,i=r.length;nt.signal===e&&t.slot===r&&t.thisArg===n))}function l(e,r){let{signal:n,slot:i,thisArg:a}=e;try{i.call(a,n.sender,r)}catch(e){t.exceptionHandler(e)}}function c(t){0===a.size&&o(u),a.add(t)}function u(){a.forEach(h),a.clear()}function h(t){P.ArrayExt.removeAllWhere(t,p)}function p(t){return null===t.signal}}(L||(L={}));var D=class{constructor(t){this._fn=t}get isDisposed(){return!this._fn}dispose(){if(!this._fn)return;let t=this._fn;this._fn=null,t()}},O=class{constructor(){this._isDisposed=!1,this._items=new Set}get isDisposed(){return this._isDisposed}dispose(){this._isDisposed||(this._isDisposed=!0,this._items.forEach((t=>{t.dispose()})),this._items.clear())}contains(t){return this._items.has(t)}add(t){this._items.add(t)}remove(t){this._items.delete(t)}clear(){this._items.clear()}};!function(t){t.from=function(e){let r=new t;for(let t of e)r.add(t);return r}}(O||(O={}));var R=class extends O{constructor(){super(...arguments),this._disposed=new z(this)}get disposed(){return this._disposed}dispose(){this.isDisposed||(super.dispose(),this._disposed.emit(void 0),z.clearData(this))}};!function(t){t.from=function(e){let r=new t;for(let t of e)r.add(t);return r}}(R||(R={}));var F,B=class t{constructor(t){this._onScrollFrame=()=>{if(!this._scrollTarget)return;let{element:t,edge:e,distance:r}=this._scrollTarget,n=F.SCROLL_EDGE_SIZE-r,i=Math.pow(n/F.SCROLL_EDGE_SIZE,2),a=Math.max(1,Math.round(i*F.SCROLL_EDGE_SIZE));switch(e){case"top":t.scrollTop-=a;break;case"left":t.scrollLeft-=a;break;case"right":t.scrollLeft+=a;break;case"bottom":t.scrollTop+=a}requestAnimationFrame(this._onScrollFrame)},this._disposed=!1,this._dropAction="none",this._override=null,this._currentTarget=null,this._currentElement=null,this._promise=null,this._scrollTarget=null,this._resolve=null,this.document=t.document||document,this.mimeData=t.mimeData,this.dragImage=t.dragImage||null,this.proposedAction=t.proposedAction||"copy",this.supportedActions=t.supportedActions||"all",this.source=t.source||null}dispose(){if(!this._disposed){if(this._disposed=!0,this._currentTarget){let t=new PointerEvent("pointerup",{bubbles:!0,cancelable:!0,clientX:-1,clientY:-1});F.dispatchDragLeave(this,this._currentTarget,null,t)}this._finalize("none")}}get isDisposed(){return this._disposed}start(t,e){if(this._disposed)return Promise.resolve("none");if(this._promise)return this._promise;this._addListeners(),this._attachDragImage(t,e),this._promise=new Promise((t=>{this._resolve=t}));let r=new PointerEvent("pointermove",{bubbles:!0,cancelable:!0,clientX:t,clientY:e});return document.dispatchEvent(r),this._promise}handleEvent(t){switch(t.type){case"pointermove":this._evtPointerMove(t);break;case"pointerup":this._evtPointerUp(t);break;case"keydown":this._evtKeyDown(t);break;default:t.preventDefault(),t.stopPropagation()}}moveDragImage(t,e){this.dragImage&&(this.dragImage.style.transform=`translate(${t}px, ${e}px)`)}_evtPointerMove(t){t.preventDefault(),t.stopPropagation(),this._updateCurrentTarget(t),this._updateDragScroll(t),this.moveDragImage(t.clientX,t.clientY)}_evtPointerUp(t){if(t.preventDefault(),t.stopPropagation(),0!==t.button)return;if(this._updateCurrentTarget(t),!this._currentTarget)return void this._finalize("none");if("none"===this._dropAction)return F.dispatchDragLeave(this,this._currentTarget,null,t),void this._finalize("none");let e=F.dispatchDrop(this,this._currentTarget,t);this._finalize(e)}_evtKeyDown(t){t.preventDefault(),t.stopPropagation(),27===t.keyCode&&this.dispose()}_addListeners(){document.addEventListener("pointerdown",this,!0),document.addEventListener("pointermove",this,!0),document.addEventListener("pointerup",this,!0),document.addEventListener("pointerenter",this,!0),document.addEventListener("pointerleave",this,!0),document.addEventListener("pointerover",this,!0),document.addEventListener("pointerout",this,!0),document.addEventListener("keydown",this,!0),document.addEventListener("keyup",this,!0),document.addEventListener("keypress",this,!0),document.addEventListener("contextmenu",this,!0)}_removeListeners(){document.removeEventListener("pointerdown",this,!0),document.removeEventListener("pointermove",this,!0),document.removeEventListener("pointerup",this,!0),document.removeEventListener("pointerenter",this,!0),document.removeEventListener("pointerleave",this,!0),document.removeEventListener("pointerover",this,!0),document.removeEventListener("pointerout",this,!0),document.removeEventListener("keydown",this,!0),document.removeEventListener("keyup",this,!0),document.removeEventListener("keypress",this,!0),document.removeEventListener("contextmenu",this,!0)}_updateDragScroll(t){let e=F.findScrollTarget(t);!this._scrollTarget&&!e||(this._scrollTarget||setTimeout(this._onScrollFrame,500),this._scrollTarget=e)}_updateCurrentTarget(t){let e=this._currentTarget,r=this._currentTarget,n=this._currentElement,i=F.findElementBehindBackdrop(t,this.document);this._currentElement=i,i!==n&&i!==r&&F.dispatchDragExit(this,r,i,t),i!==n&&i!==r&&(r=F.dispatchDragEnter(this,i,r,t)),r!==e&&(this._currentTarget=r,F.dispatchDragLeave(this,e,r,t));let a=F.dispatchDragOver(this,r,t);this._setDropAction(a)}_attachDragImage(t,e){if(!this.dragImage)return;this.dragImage.classList.add("lm-mod-drag-image");let r=this.dragImage.style;r.pointerEvents="none",r.position="fixed",r.transform=`translate(${t}px, ${e}px)`,(this.document instanceof Document?this.document.body:this.document.firstElementChild).appendChild(this.dragImage)}_detachDragImage(){if(!this.dragImage)return;let t=this.dragImage.parentNode;t&&t.removeChild(this.dragImage)}_setDropAction(e){if(e=F.validateAction(e,this.supportedActions),!this._override||this._dropAction!==e)switch(e){case"none":this._dropAction=e,this._override=t.overrideCursor("no-drop",this.document);break;case"copy":this._dropAction=e,this._override=t.overrideCursor("copy",this.document);break;case"link":this._dropAction=e,this._override=t.overrideCursor("alias",this.document);break;case"move":this._dropAction=e,this._override=t.overrideCursor("move",this.document)}}_finalize(t){let e=this._resolve;this._removeListeners(),this._detachDragImage(),this._override&&(this._override.dispose(),this._override=null),this.mimeData.clear(),this._disposed=!0,this._dropAction="none",this._currentTarget=null,this._currentElement=null,this._scrollTarget=null,this._promise=null,this._resolve=null,e&&e(t)}};!function(t){class e extends DragEvent{constructor(t,e){super(e.type,{bubbles:!0,cancelable:!0,altKey:t.altKey,button:t.button,clientX:t.clientX,clientY:t.clientY,ctrlKey:t.ctrlKey,detail:0,metaKey:t.metaKey,relatedTarget:e.related,screenX:t.screenX,screenY:t.screenY,shiftKey:t.shiftKey,view:window});let{drag:r}=e;this.dropAction="none",this.mimeData=r.mimeData,this.proposedAction=r.proposedAction,this.supportedActions=r.supportedActions,this.source=r.source}}t.Event=e,t.overrideCursor=function(t,e=document){return F.overrideCursor(t,e)}}(B||(B={})),function(t){function e(e,i=document){if(e){if(r&&e==r.event)return r.element;t.cursorBackdrop.style.zIndex="-1000";let n=i.elementFromPoint(e.clientX,e.clientY);return t.cursorBackdrop.style.zIndex="",r={event:e,element:n},n}{let e=t.cursorBackdrop.style.transform;if(n&&e===n.transform)return n.element;let r=t.cursorBackdrop.getBoundingClientRect();t.cursorBackdrop.style.zIndex="-1000";let a=i.elementFromPoint(r.left+r.width/2,r.top+r.height/2);return t.cursorBackdrop.style.zIndex="",n={transform:e,element:a},a}}t.SCROLL_EDGE_SIZE=20,t.validateAction=function(t,e){return i[t]&a[e]?t:"none"},t.findElementBehindBackdrop=e;let r=null,n=null;t.findScrollTarget=function(r){let n=r.clientX,i=r.clientY,a=e(r);for(;a;a=a.parentElement){if(!a.hasAttribute("data-lm-dragscroll"))continue;let e=0,r=0;a===document.body&&(e=window.pageXOffset,r=window.pageYOffset);let o=a.getBoundingClientRect(),s=o.top+r,l=o.left+e,c=l+o.width,u=s+o.height;if(n=c||i=u)continue;let h,p=n-l+1,f=i-s+1,d=c-n,m=u-i,g=Math.min(p,f,d,m);if(g>t.SCROLL_EDGE_SIZE)continue;switch(g){case m:h="bottom";break;case f:h="top";break;case d:h="right";break;case p:h="left";break;default:throw"unreachable"}let y,v=a.scrollWidth-a.clientWidth,x=a.scrollHeight-a.clientHeight;switch(h){case"top":y=x>0&&a.scrollTop>0;break;case"left":y=v>0&&a.scrollLeft>0;break;case"right":y=v>0&&a.scrollLeft0&&a.scrollTop{n===u&&t.cursorBackdrop.isConnected&&(document.removeEventListener("pointermove",o,!0),t.cursorBackdrop.removeEventListener("scroll",s,!0),i.removeChild(t.cursorBackdrop))}))};let c=500,u=0;t.cursorBackdrop=function(){let t=document.createElement("div");return t.classList.add("lm-cursor-backdrop"),t}()}(F||(F={}));var j=y(v()),N=y(x());function U(){return q.keyboardLayout}var V=class t{constructor(e,r,n=[]){this.name=e,this._codes=r,this._keys=t.extractKeys(r),this._modifierKeys=t.convertToKeySet(n)}keys(){return Object.keys(this._keys)}isValidKey(t){return t in this._keys}isModifierKey(t){return t in this._modifierKeys}keyForKeydownEvent(t){return this._codes[t.keyCode]||""}};!function(t){t.extractKeys=function(t){let e=Object.create(null);for(let r in t)e[t[r]]=!0;return e},t.convertToKeySet=function(t){let e=Object(null);for(let r=0,n=t.length;r{this._commands.delete(t),this._commandChanged.emit({id:t,type:"removed"})}))}notifyCommandChanged(t){if(void 0!==t&&!this._commands.has(t))throw new Error(`Command '${t}' is not registered.`);this._commandChanged.emit({id:t,type:t?"changed":"many-changed"})}describedBy(t,e=N.JSONExt.emptyObject){var r;let n=this._commands.get(t);return Promise.resolve(null!==(r=n?.describedBy.call(void 0,e))&&void 0!==r?r:{args:null})}label(t,e=N.JSONExt.emptyObject){var r;let n=this._commands.get(t);return null!==(r=n?.label.call(void 0,e))&&void 0!==r?r:""}mnemonic(t,e=N.JSONExt.emptyObject){let r=this._commands.get(t);return r?r.mnemonic.call(void 0,e):-1}icon(t,e=N.JSONExt.emptyObject){var r;return null===(r=this._commands.get(t))||void 0===r?void 0:r.icon.call(void 0,e)}iconClass(t,e=N.JSONExt.emptyObject){let r=this._commands.get(t);return r?r.iconClass.call(void 0,e):""}iconLabel(t,e=N.JSONExt.emptyObject){let r=this._commands.get(t);return r?r.iconLabel.call(void 0,e):""}caption(t,e=N.JSONExt.emptyObject){let r=this._commands.get(t);return r?r.caption.call(void 0,e):""}usage(t,e=N.JSONExt.emptyObject){let r=this._commands.get(t);return r?r.usage.call(void 0,e):""}className(t,e=N.JSONExt.emptyObject){let r=this._commands.get(t);return r?r.className.call(void 0,e):""}dataset(t,e=N.JSONExt.emptyObject){let r=this._commands.get(t);return r?r.dataset.call(void 0,e):{}}isEnabled(t,e=N.JSONExt.emptyObject){let r=this._commands.get(t);return!!r&&r.isEnabled.call(void 0,e)}isToggled(t,e=N.JSONExt.emptyObject){let r=this._commands.get(t);return!!r&&r.isToggled.call(void 0,e)}isToggleable(t,e=N.JSONExt.emptyObject){let r=this._commands.get(t);return!!r&&r.isToggleable}isVisible(t,e=N.JSONExt.emptyObject){let r=this._commands.get(t);return!!r&&r.isVisible.call(void 0,e)}execute(t,e=N.JSONExt.emptyObject){let r,n=this._commands.get(t);if(!n)return Promise.reject(new Error(`Command '${t}' not registered.`));try{r=n.execute.call(void 0,e)}catch(t){r=Promise.reject(t)}let i=Promise.resolve(r);return this._commandExecuted.emit({id:t,args:e,result:i}),i}addKeyBinding(t){let e=G.createKeyBinding(t);return this._keyBindings.push(e),this._keyBindingChanged.emit({binding:e,type:"added"}),new D((()=>{j.ArrayExt.removeFirstOf(this._keyBindings,e),this._keyBindingChanged.emit({binding:e,type:"removed"})}))}processKeydownEvent(e){if(e.defaultPrevented||this._replaying)return;let r=t.keystrokeForKeydownEvent(e);if(!r)return this._replayKeydownEvents(),void this._clearPendingState();if(t.isModifierKeyPressed(e)){let{exact:t}=G.matchKeyBinding(this._keyBindings,[r],e);return void(t?(e.preventDefault(),e.stopPropagation(),this._startModifierTimer(t)):this._clearModifierTimer())}this._keystrokes.push(r);let{exact:n,partial:i}=G.matchKeyBinding(this._keyBindings,this._keystrokes,e),a=0!==i.length;return n||a?((n?.preventDefault||i.some((t=>t.preventDefault)))&&(e.preventDefault(),e.stopPropagation()),this._keydownEvents.push(e),n&&!a?(this._executeKeyBinding(n),void this._clearPendingState()):(n&&(this._exactKeyMatch=n),void this._startTimer())):(this._replayKeydownEvents(),void this._clearPendingState())}holdKeyBindingExecution(t,e){this._holdKeyBindingPromises.set(t,e)}processKeyupEvent(t){this._clearModifierTimer()}_startModifierTimer(t){this._clearModifierTimer(),this._timerModifierID=window.setTimeout((()=>{this._executeKeyBinding(t)}),G.modifierkeyTimeOut)}_clearModifierTimer(){0!==this._timerModifierID&&(clearTimeout(this._timerModifierID),this._timerModifierID=0)}_startTimer(){this._clearTimer(),this._timerID=window.setTimeout((()=>{this._onPendingTimeout()}),G.CHORD_TIMEOUT)}_clearTimer(){0!==this._timerID&&(clearTimeout(this._timerID),this._timerID=0)}_replayKeydownEvents(){0!==this._keydownEvents.length&&(this._replaying=!0,this._keydownEvents.forEach(G.replayKeyEvent),this._replaying=!1)}async _executeKeyBinding(t){if(0!==this._holdKeyBindingPromises.size){let t=[...this._keydownEvents],e=(await Promise.race([Promise.all(t.map((async t=>{var e;return null!==(e=this._holdKeyBindingPromises.get(t))&&void 0!==e?e:Promise.resolve(!0)}))),new Promise((t=>{setTimeout((()=>t([!1])),G.KEYBINDING_HOLD_TIMEOUT)}))])).every(Boolean);if(this._holdKeyBindingPromises.clear(),!e)return}let{command:e,args:r}=t,n={_luminoEvent:{type:"keybinding",keys:t.keys},...r};if(this.hasCommand(e)&&this.isEnabled(e,n))await this.execute(e,n);else{let r=this.hasCommand(e)?"enabled":"registered",n=`Cannot execute key binding '${t.keys.join(", ")}':`,i=`command '${e}' is not ${r}.`;console.warn(`${n} ${i}`)}}_clearPendingState(){this._clearTimer(),this._clearModifierTimer(),this._exactKeyMatch=null,this._keystrokes.length=0,this._keydownEvents.length=0}_onPendingTimeout(){this._timerID=0,this._exactKeyMatch?this._executeKeyBinding(this._exactKeyMatch):this._replayKeydownEvents(),this._clearPendingState()}};!function(t){function e(t){let e="",r=!1,n=!1,i=!1,o=!1;for(let s of t.split(/\s+/))"Accel"===s?a.IS_MAC?n=!0:i=!0:"Alt"===s?r=!0:"Cmd"===s?n=!0:"Ctrl"===s?i=!0:"Shift"===s?o=!0:s.length>0&&(e=s);return{cmd:n,ctrl:i,alt:r,shift:o,key:e}}function r(t){let r="",n=e(t);return n.ctrl&&(r+="Ctrl "),n.alt&&(r+="Alt "),n.shift&&(r+="Shift "),n.cmd&&a.IS_MAC&&(r+="Cmd "),n.key?r+n.key:r.trim()}t.parseKeystroke=e,t.normalizeKeystroke=r,t.normalizeKeys=function(t){let e;return e=a.IS_WIN?t.winKeys||t.keys:a.IS_MAC?t.macKeys||t.keys:t.linuxKeys||t.keys,e.map(r)},t.formatKeystroke=function(t){return"string"==typeof t?r(t):t.map(r).join(", ");function r(t){let r=[],n=a.IS_MAC?" ":"+",i=e(t);return i.ctrl&&r.push("Ctrl"),i.alt&&r.push("Alt"),i.shift&&r.push("Shift"),a.IS_MAC&&i.cmd&&r.push("Cmd"),r.push(i.key),r.map(G.formatKey).join(n)}},t.isModifierKeyPressed=function(t){let e=U(),r=e.keyForKeydownEvent(t);return e.isModifierKey(r)},t.keystrokeForKeydownEvent=function(t){let e=U(),r=e.keyForKeydownEvent(t),n=[];return t.ctrlKey&&n.push("Ctrl"),t.altKey&&n.push("Alt"),t.shiftKey&&n.push("Shift"),t.metaKey&&a.IS_MAC&&n.push("Cmd"),e.isModifierKey(r)||n.push(r),n.join(" ")}}(W||(W={})),function(t){t.CHORD_TIMEOUT=1e3,t.KEYBINDING_HOLD_TIMEOUT=1e3,t.modifierkeyTimeOut=500,t.createCommand=function(t){return{execute:t.execute,describedBy:h("function"==typeof t.describedBy?t.describedBy:{args:null,...t.describedBy},(()=>({args:null}))),label:h(t.label,n),mnemonic:h(t.mnemonic,i),icon:h(t.icon,u),iconClass:h(t.iconClass,n),iconLabel:h(t.iconLabel,n),caption:h(t.caption,n),usage:h(t.usage,n),className:h(t.className,n),dataset:h(t.dataset,c),isEnabled:t.isEnabled||s,isToggled:t.isToggled||l,isToggleable:t.isToggleable||!!t.isToggled,isVisible:t.isVisible||s}},t.createKeyBinding=function(t){var e;return{keys:W.normalizeKeys(t),selector:p(t),command:t.command,args:t.args||N.JSONExt.emptyObject,preventDefault:null===(e=t.preventDefault)||void 0===e||e}},t.matchKeyBinding=function(t,e,r){let n=null,i=[],a=1/0,s=0;for(let l=0,c=t.length;la)continue;let p=o.calculateSpecificity(c.selector);(!n||h=s)&&(n=c,a=h,s=p)}return{exact:n,partial:i}},t.replayKeyEvent=function(t){t.target.dispatchEvent(function(t){let e=document.createEvent("Event"),r=t.bubbles||!0,n=t.cancelable||!0;return e.initEvent(t.type||"keydown",r,n),e.key=t.key||"",e.keyCode=t.keyCode||0,e.which=t.keyCode||0,e.ctrlKey=t.ctrlKey||!1,e.altKey=t.altKey||!1,e.shiftKey=t.shiftKey||!1,e.metaKey=t.metaKey||!1,e.view=t.view||window,e}(t))},t.formatKey=function(t){return a.IS_MAC?e.hasOwnProperty(t)?e[t]:t:r.hasOwnProperty(t)?r[t]:t};let e={Backspace:"⌫",Tab:"⇥",Enter:"⏎",Shift:"⇧",Ctrl:"⌃",Alt:"⌥",Escape:"⎋",PageUp:"⇞",PageDown:"⇟",End:"↘",Home:"↖",ArrowLeft:"←",ArrowUp:"↑",ArrowRight:"→",ArrowDown:"↓",Delete:"⌦",Cmd:"⌘"},r={Escape:"Esc",PageUp:"Page Up",PageDown:"Page Down",ArrowLeft:"Left",ArrowUp:"Up",ArrowRight:"Right",ArrowDown:"Down",Delete:"Del"},n=()=>"",i=()=>-1,s=()=>!0,l=()=>!1,c=()=>({}),u=()=>{};function h(t,e){return void 0===t?e:"function"==typeof t?t:()=>t}function p(t){if(-1!==t.selector.indexOf(","))throw new Error(`Selector cannot contain commas: ${t.selector}`);if(!o.isValid(t.selector))throw new Error(`Invalid selector: ${t.selector}`);return t.selector}function f(t,e){if(t.lengthe.length?2:1}function d(t,e){let r=e.target,n=e.currentTarget;for(let e=0;null!==r;r=r.parentElement,++e){if(r.hasAttribute("data-lm-suppress-shortcuts"))return-1;if(o.matches(r,t))return e;if(r===n)return-1}return-1}}(G||(G={}));var Z,Y,X=y(v()),$=class{constructor(t){this.type="text",this.content=t}},K=class{constructor(t,e,r,n){this.type="element",this.tag=t,this.attrs=e,this.children=r,this.renderer=n}};function J(t){let e,r={},n=[];for(let t=1,a=arguments.length;t=n;--a){let n=e[a],o=i?t.lastChild:t.childNodes[a];"text"===n.type||(n.renderer&&n.renderer.unrender?n.renderer.unrender(o,{attrs:n.attrs,children:n.children}):r(o,n.children,0,!1)),i&&t.removeChild(o)}}t.hostMap=new WeakMap,t.asContentArray=function(t){return t?t instanceof Array?t:[t]:[]},t.createDOMNode=e,t.updateContent=function t(n,a,o){if(a===o)return;let s=function(t,e){let r=t.firstChild,n=Object.create(null);for(let t of e)"element"===t.type&&t.attrs.key&&(n[t.attrs.key]={vNode:t,element:r}),r=r.nextSibling;return n}(n,a),l=a.slice(),c=n.firstChild,u=o.length;for(let r=0;r=l.length){e(o[r],n);continue}let a=l[r],u=o[r];if(a===u){c=c.nextSibling;continue}if("text"===a.type&&"text"===u.type){c.textContent!==u.content&&(c.textContent=u.content),c=c.nextSibling;continue}if("text"===a.type||"text"===u.type){X.ArrayExt.insert(l,r,u),e(u,n,c);continue}if(!a.renderer!=!u.renderer){X.ArrayExt.insert(l,r,u),e(u,n,c);continue}let h=u.attrs.key;if(h&&h in s){let t=s[h];t.vNode!==a&&(X.ArrayExt.move(l,l.indexOf(t.vNode,r+1),r),n.insertBefore(t.element,c),a=t.vNode,c=t.element)}if(a===u){c=c.nextSibling;continue}let p=a.attrs.key;p&&p!==h?(X.ArrayExt.insert(l,r,u),e(u,n,c)):a.tag===u.tag?(i(c,a.attrs,u.attrs),u.renderer?u.renderer.render(c,{attrs:u.attrs,children:u.children}):t(c,a.children,u.children),c=c.nextSibling):(X.ArrayExt.insert(l,r,u),e(u,n,c))}r(n,l,u,!0)};let n={key:!0,className:!0,htmlFor:!0,dataset:!0,style:!0};function i(t,e,r){if(e===r)return;let i;for(i in e)i in n||i in r||("on"===i.substr(0,2)?t[i]=null:t.removeAttribute(i));for(i in r)i in n||e[i]===r[i]||("on"===i.substr(0,2)?t[i]=r[i]:t.setAttribute(i,r[i]));e.className!==r.className&&(void 0!==r.className?t.setAttribute("class",r.className):t.removeAttribute("class")),e.htmlFor!==r.htmlFor&&(void 0!==r.htmlFor?t.setAttribute("for",r.htmlFor):t.removeAttribute("for")),e.dataset!==r.dataset&&function(t,e,r){for(let n in e)n in r||t.removeAttribute(`data-${n}`);for(let n in r)e[n]!==r[n]&&t.setAttribute(`data-${n}`,r[n])}(t,e.dataset||{},r.dataset||{}),e.style!==r.style&&function(t,e,r){let n,i=t.style;for(n in e)n in r||(i[n]="");for(n in r)e[n]!==r[n]&&(i[n]=r[n])}(t,e.style||{},r.style||{})}}(Y||(Y={}));var Q,tt=class{constructor(){this.sizeHint=0,this.minSize=0,this.maxSize=1/0,this.stretch=1,this.size=0,this.done=!1}};!function(t){t.calc=function(t,e){let r=t.length;if(0===r)return e;let n=0,i=0,a=0,o=0,s=0;for(let e=0;e0&&(o+=r.stretch,s++)}if(e===a)return 0;if(e<=n){for(let e=0;e=i){for(let e=0;e0&&n>l;){let e=n,i=o;for(let a=0;a0&&n>l;){let e=n/c;for(let i=0;i0&&n>l;){let e=n,i=o;for(let a=0;a=r.maxSize?(n-=r.maxSize-r.size,o-=r.stretch,r.size=r.maxSize,r.done=!0,c--,s--):(n-=l,r.size+=l)}}for(;c>0&&n>l;){let e=n/c;for(let i=0;i=r.maxSize?(n-=r.maxSize-r.size,r.size=r.maxSize,r.done=!0,c--):(n-=e,r.size+=e))}}}return 0},t.adjust=function(t,e,r){0===t.length||0===r||(r>0?function(t,e,r){let n=0;for(let r=0;r<=e;++r){let e=t[r];n+=e.maxSize-e.size}let i=0;for(let r=e+1,n=t.length;r=0&&a>0;--r){let e=t[r],n=e.maxSize-e.size;n>=a?(e.sizeHint=e.size+a,a=0):(e.sizeHint=e.size+n,a-=n)}let o=r;for(let r=e+1,n=t.length;r0;++r){let e=t[r],n=e.size-e.minSize;n>=o?(e.sizeHint=e.size-o,o=0):(e.sizeHint=e.size-n,o-=n)}}(t,e,r):function(t,e,r){let n=0;for(let r=e+1,i=t.length;r0;++r){let e=t[r],n=e.maxSize-e.size;n>=a?(e.sizeHint=e.size+a,a=0):(e.sizeHint=e.size+n,a-=n)}let o=r;for(let r=e;r>=0&&o>0;--r){let e=t[r],n=e.size-e.minSize;n>=o?(e.sizeHint=e.size-o,o=0):(e.sizeHint=e.size-n,o-=n)}}(t,e,-r))}}(Q||(Q={}));var et,rt=class{constructor(t){this._label="",this._caption="",this._mnemonic=-1,this._icon=void 0,this._iconClass="",this._iconLabel="",this._className="",this._closable=!1,this._changed=new z(this),this._isDisposed=!1,this.owner=t.owner,void 0!==t.label&&(this._label=t.label),void 0!==t.mnemonic&&(this._mnemonic=t.mnemonic),void 0!==t.icon&&(this._icon=t.icon),void 0!==t.iconClass&&(this._iconClass=t.iconClass),void 0!==t.iconLabel&&(this._iconLabel=t.iconLabel),void 0!==t.caption&&(this._caption=t.caption),void 0!==t.className&&(this._className=t.className),void 0!==t.closable&&(this._closable=t.closable),this._dataset=t.dataset||{}}get changed(){return this._changed}get label(){return this._label}set label(t){this._label!==t&&(this._label=t,this._changed.emit(void 0))}get mnemonic(){return this._mnemonic}set mnemonic(t){this._mnemonic!==t&&(this._mnemonic=t,this._changed.emit(void 0))}get icon(){return this._icon}set icon(t){this._icon!==t&&(this._icon=t,this._changed.emit(void 0))}get iconClass(){return this._iconClass}set iconClass(t){this._iconClass!==t&&(this._iconClass=t,this._changed.emit(void 0))}get iconLabel(){return this._iconLabel}set iconLabel(t){this._iconLabel!==t&&(this._iconLabel=t,this._changed.emit(void 0))}get caption(){return this._caption}set caption(t){this._caption!==t&&(this._caption=t,this._changed.emit(void 0))}get className(){return this._className}set className(t){this._className!==t&&(this._className=t,this._changed.emit(void 0))}get closable(){return this._closable}set closable(t){this._closable!==t&&(this._closable=t,this._changed.emit(void 0))}get dataset(){return this._dataset}set dataset(t){this._dataset!==t&&(this._dataset=t,this._changed.emit(void 0))}get isDisposed(){return this._isDisposed}dispose(){this.isDisposed||(this._isDisposed=!0,z.clearData(this))}},nt=class t{constructor(e={}){this._flags=0,this._layout=null,this._parent=null,this._disposed=new z(this),this._hiddenMode=t.HiddenMode.Display,this.node=et.createNode(e),this.addClass("lm-Widget")}dispose(){this.isDisposed||(this.setFlag(t.Flag.IsDisposed),this._disposed.emit(void 0),this.parent?this.parent=null:this.isAttached&&t.detach(this),this._layout&&(this._layout.dispose(),this._layout=null),this.title.dispose(),z.clearData(this),M.clearData(this),I.clearData(this))}get disposed(){return this._disposed}get isDisposed(){return this.testFlag(t.Flag.IsDisposed)}get isAttached(){return this.testFlag(t.Flag.IsAttached)}get isHidden(){return this.testFlag(t.Flag.IsHidden)}get isVisible(){return this.testFlag(t.Flag.IsVisible)}get title(){return et.titleProperty.get(this)}get id(){return this.node.id}set id(t){this.node.id=t}get dataset(){return this.node.dataset}get hiddenMode(){return this._hiddenMode}set hiddenMode(e){this._hiddenMode!==e&&(this.isHidden&&this._toggleHidden(!1),e==t.HiddenMode.Scale?this.node.style.willChange="transform":this.node.style.willChange="auto",this._hiddenMode=e,this.isHidden&&this._toggleHidden(!0))}get parent(){return this._parent}set parent(e){if(this._parent!==e){if(e&&this.contains(e))throw new Error("Invalid parent widget.");if(this._parent&&!this._parent.isDisposed){let e=new t.ChildMessage("child-removed",this);M.sendMessage(this._parent,e)}if(this._parent=e,this._parent&&!this._parent.isDisposed){let e=new t.ChildMessage("child-added",this);M.sendMessage(this._parent,e)}this.isDisposed||M.sendMessage(this,t.Msg.ParentChanged)}}get layout(){return this._layout}set layout(e){if(this._layout!==e){if(this.testFlag(t.Flag.DisallowLayout))throw new Error("Cannot set widget layout.");if(this._layout)throw new Error("Cannot change widget layout.");if(e.parent)throw new Error("Cannot change layout parent.");this._layout=e,e.parent=this}}*children(){this._layout&&(yield*this._layout)}contains(t){for(let e=t;e;e=e._parent)if(e===this)return!0;return!1}hasClass(t){return this.node.classList.contains(t)}addClass(t){this.node.classList.add(t)}removeClass(t){this.node.classList.remove(t)}toggleClass(t,e){return!0===e?(this.node.classList.add(t),!0):!1===e?(this.node.classList.remove(t),!1):this.node.classList.toggle(t)}update(){M.postMessage(this,t.Msg.UpdateRequest)}fit(){M.postMessage(this,t.Msg.FitRequest)}activate(){M.postMessage(this,t.Msg.ActivateRequest)}close(){M.sendMessage(this,t.Msg.CloseRequest)}show(){if(this.testFlag(t.Flag.IsHidden)&&(this.isAttached&&(!this.parent||this.parent.isVisible)&&M.sendMessage(this,t.Msg.BeforeShow),this.clearFlag(t.Flag.IsHidden),this._toggleHidden(!1),this.isAttached&&(!this.parent||this.parent.isVisible)&&M.sendMessage(this,t.Msg.AfterShow),this.parent)){let e=new t.ChildMessage("child-shown",this);M.sendMessage(this.parent,e)}}hide(){if(!this.testFlag(t.Flag.IsHidden)&&(this.isAttached&&(!this.parent||this.parent.isVisible)&&M.sendMessage(this,t.Msg.BeforeHide),this.setFlag(t.Flag.IsHidden),this._toggleHidden(!0),this.isAttached&&(!this.parent||this.parent.isVisible)&&M.sendMessage(this,t.Msg.AfterHide),this.parent)){let e=new t.ChildMessage("child-hidden",this);M.sendMessage(this.parent,e)}}setHidden(t){t?this.hide():this.show()}testFlag(t){return!!(this._flags&t)}setFlag(t){this._flags|=t}clearFlag(t){this._flags&=~t}processMessage(e){switch(e.type){case"resize":this.notifyLayout(e),this.onResize(e);break;case"update-request":this.notifyLayout(e),this.onUpdateRequest(e);break;case"fit-request":this.notifyLayout(e),this.onFitRequest(e);break;case"before-show":this.notifyLayout(e),this.onBeforeShow(e);break;case"after-show":this.setFlag(t.Flag.IsVisible),this.notifyLayout(e),this.onAfterShow(e);break;case"before-hide":this.notifyLayout(e),this.onBeforeHide(e);break;case"after-hide":this.clearFlag(t.Flag.IsVisible),this.notifyLayout(e),this.onAfterHide(e);break;case"before-attach":this.notifyLayout(e),this.onBeforeAttach(e);break;case"after-attach":!this.isHidden&&(!this.parent||this.parent.isVisible)&&this.setFlag(t.Flag.IsVisible),this.setFlag(t.Flag.IsAttached),this.notifyLayout(e),this.onAfterAttach(e);break;case"before-detach":this.notifyLayout(e),this.onBeforeDetach(e);break;case"after-detach":this.clearFlag(t.Flag.IsVisible),this.clearFlag(t.Flag.IsAttached),this.notifyLayout(e),this.onAfterDetach(e);break;case"activate-request":this.notifyLayout(e),this.onActivateRequest(e);break;case"close-request":this.notifyLayout(e),this.onCloseRequest(e);break;case"child-added":this.notifyLayout(e),this.onChildAdded(e);break;case"child-removed":this.notifyLayout(e),this.onChildRemoved(e);break;default:this.notifyLayout(e)}}notifyLayout(t){this._layout&&this._layout.processParentMessage(t)}onCloseRequest(e){this.parent?this.parent=null:this.isAttached&&t.detach(this)}onResize(t){}onUpdateRequest(t){}onFitRequest(t){}onActivateRequest(t){}onBeforeShow(t){}onAfterShow(t){}onBeforeHide(t){}onAfterHide(t){}onBeforeAttach(t){}onAfterAttach(t){}onBeforeDetach(t){}onAfterDetach(t){}onChildAdded(t){}onChildRemoved(t){}_toggleHidden(e){if(e)switch(this._hiddenMode){case t.HiddenMode.Display:this.addClass("lm-mod-hidden");break;case t.HiddenMode.Scale:this.node.style.transform="scale(0)",this.node.setAttribute("aria-hidden","true");break;case t.HiddenMode.ContentVisibility:this.node.style.contentVisibility="hidden",this.node.style.zIndex="-1"}else switch(this._hiddenMode){case t.HiddenMode.Display:this.removeClass("lm-mod-hidden");break;case t.HiddenMode.Scale:this.node.style.transform="",this.node.removeAttribute("aria-hidden");break;case t.HiddenMode.ContentVisibility:this.node.style.contentVisibility="",this.node.style.zIndex=""}}};!function(t){var e;(e=t.HiddenMode||(t.HiddenMode={}))[e.Display=0]="Display",e[e.Scale=1]="Scale",e[e.ContentVisibility=2]="ContentVisibility",function(t){t[t.IsDisposed=1]="IsDisposed",t[t.IsAttached=2]="IsAttached",t[t.IsHidden=4]="IsHidden",t[t.IsVisible=8]="IsVisible",t[t.DisallowLayout=16]="DisallowLayout"}(t.Flag||(t.Flag={})),function(t){t.BeforeShow=new S("before-show"),t.AfterShow=new S("after-show"),t.BeforeHide=new S("before-hide"),t.AfterHide=new S("after-hide"),t.BeforeAttach=new S("before-attach"),t.AfterAttach=new S("after-attach"),t.BeforeDetach=new S("before-detach"),t.AfterDetach=new S("after-detach"),t.ParentChanged=new S("parent-changed"),t.UpdateRequest=new E("update-request"),t.FitRequest=new E("fit-request"),t.ActivateRequest=new E("activate-request"),t.CloseRequest=new E("close-request")}(t.Msg||(t.Msg={})),t.ChildMessage=class extends S{constructor(t,e){super(t),this.child=e}};class r extends S{constructor(t,e){super("resize"),this.width=t,this.height=e}}t.ResizeMessage=r,function(t){t.UnknownSize=new t(-1,-1)}(r=t.ResizeMessage||(t.ResizeMessage={})),t.attach=function(e,r,n=null){if(e.parent)throw new Error("Cannot attach a child widget.");if(e.isAttached||e.node.isConnected)throw new Error("Widget is already attached.");if(!r.isConnected)throw new Error("Host is not attached.");M.sendMessage(e,t.Msg.BeforeAttach),r.insertBefore(e.node,n),M.sendMessage(e,t.Msg.AfterAttach)},t.detach=function(e){if(e.parent)throw new Error("Cannot detach a child widget.");if(!e.isAttached||!e.node.isConnected)throw new Error("Widget is not attached.");M.sendMessage(e,t.Msg.BeforeDetach),e.node.parentNode.removeChild(e.node),M.sendMessage(e,t.Msg.AfterDetach)}}(nt||(nt={})),function(t){t.titleProperty=new I({name:"title",create:t=>new rt({owner:t})}),t.createNode=function(t){return t.node||document.createElement(t.tag||"div")}}(et||(et={}));var it=class{constructor(t={}){this._disposed=!1,this._parent=null,this._fitPolicy=t.fitPolicy||"set-min-size"}dispose(){this._parent=null,this._disposed=!0,z.clearData(this),I.clearData(this)}get isDisposed(){return this._disposed}get parent(){return this._parent}set parent(t){if(this._parent!==t){if(this._parent)throw new Error("Cannot change parent widget.");if(t.layout!==this)throw new Error("Invalid parent widget.");this._parent=t,this.init()}}get fitPolicy(){return this._fitPolicy}set fitPolicy(t){if(this._fitPolicy!==t&&(this._fitPolicy=t,this._parent)){let t=this._parent.node.style;t.minWidth="",t.minHeight="",t.maxWidth="",t.maxHeight="",this._parent.fit()}}processParentMessage(t){switch(t.type){case"resize":this.onResize(t);break;case"update-request":this.onUpdateRequest(t);break;case"fit-request":this.onFitRequest(t);break;case"before-show":this.onBeforeShow(t);break;case"after-show":this.onAfterShow(t);break;case"before-hide":this.onBeforeHide(t);break;case"after-hide":this.onAfterHide(t);break;case"before-attach":this.onBeforeAttach(t);break;case"after-attach":this.onAfterAttach(t);break;case"before-detach":this.onBeforeDetach(t);break;case"after-detach":this.onAfterDetach(t);break;case"child-removed":this.onChildRemoved(t);break;case"child-shown":this.onChildShown(t);break;case"child-hidden":this.onChildHidden(t)}}init(){for(let t of this)t.parent=this.parent}onResize(t){for(let t of this)M.sendMessage(t,nt.ResizeMessage.UnknownSize)}onUpdateRequest(t){for(let t of this)M.sendMessage(t,nt.ResizeMessage.UnknownSize)}onBeforeAttach(t){for(let e of this)M.sendMessage(e,t)}onAfterAttach(t){for(let e of this)M.sendMessage(e,t)}onBeforeDetach(t){for(let e of this)M.sendMessage(e,t)}onAfterDetach(t){for(let e of this)M.sendMessage(e,t)}onBeforeShow(t){for(let e of this)e.isHidden||M.sendMessage(e,t)}onAfterShow(t){for(let e of this)e.isHidden||M.sendMessage(e,t)}onBeforeHide(t){for(let e of this)e.isHidden||M.sendMessage(e,t)}onAfterHide(t){for(let e of this)e.isHidden||M.sendMessage(e,t)}onChildRemoved(t){this.removeWidget(t.child)}onFitRequest(t){}onChildShown(t){}onChildHidden(t){}};!function(t){t.getHorizontalAlignment=function(t){return at.horizontalAlignmentProperty.get(t)},t.setHorizontalAlignment=function(t,e){at.horizontalAlignmentProperty.set(t,e)},t.getVerticalAlignment=function(t){return at.verticalAlignmentProperty.get(t)},t.setVerticalAlignment=function(t,e){at.verticalAlignmentProperty.set(t,e)}}(it||(it={}));var at,ot=class{constructor(t){this._top=NaN,this._left=NaN,this._width=NaN,this._height=NaN,this._minWidth=0,this._minHeight=0,this._maxWidth=1/0,this._maxHeight=1/0,this._disposed=!1,this.widget=t,this.widget.node.style.position="absolute",this.widget.node.style.contain="strict"}dispose(){if(this._disposed)return;this._disposed=!0;let t=this.widget.node.style;t.position="",t.top="",t.left="",t.width="",t.height="",t.contain=""}get minWidth(){return this._minWidth}get minHeight(){return this._minHeight}get maxWidth(){return this._maxWidth}get maxHeight(){return this._maxHeight}get isDisposed(){return this._disposed}get isHidden(){return this.widget.isHidden}get isVisible(){return this.widget.isVisible}get isAttached(){return this.widget.isAttached}fit(){let t=i.sizeLimits(this.widget.node);this._minWidth=t.minWidth,this._minHeight=t.minHeight,this._maxWidth=t.maxWidth,this._maxHeight=t.maxHeight}update(t,e,r,n){let i=Math.max(this._minWidth,Math.min(r,this._maxWidth)),a=Math.max(this._minHeight,Math.min(n,this._maxHeight));if(i"center",changed:e}),t.verticalAlignmentProperty=new I({name:"verticalAlignment",create:()=>"top",changed:e})}(at||(at={}));var st,lt=class extends it{constructor(){super(...arguments),this._widgets=[]}dispose(){for(;this._widgets.length>0;)this._widgets.pop().dispose();super.dispose()}get widgets(){return this._widgets}*[Symbol.iterator](){yield*this._widgets}addWidget(t){this.insertWidget(this._widgets.length,t)}insertWidget(t,e){e.parent=this.parent;let r=this._widgets.indexOf(e),n=Math.max(0,Math.min(t,this._widgets.length));if(-1===r)return b.ArrayExt.insert(this._widgets,n,e),void(this.parent&&this.attachWidget(n,e));n===this._widgets.length&&n--,r!==n&&(b.ArrayExt.move(this._widgets,r,n),this.parent&&this.moveWidget(r,n,e))}removeWidget(t){this.removeWidgetAt(this._widgets.indexOf(t))}removeWidgetAt(t){let e=b.ArrayExt.removeAt(this._widgets,t);e&&this.parent&&this.detachWidget(t,e)}init(){super.init();let t=0;for(let e of this)this.attachWidget(t++,e)}attachWidget(t,e){let r=this.parent.node.children[t];this.parent.isAttached&&M.sendMessage(e,nt.Msg.BeforeAttach),this.parent.node.insertBefore(e.node,r),this.parent.isAttached&&M.sendMessage(e,nt.Msg.AfterAttach)}moveWidget(t,e,r){this.parent.isAttached&&M.sendMessage(r,nt.Msg.BeforeDetach),this.parent.node.removeChild(r.node),this.parent.isAttached&&M.sendMessage(r,nt.Msg.AfterDetach);let n=this.parent.node.children[e];this.parent.isAttached&&M.sendMessage(r,nt.Msg.BeforeAttach),this.parent.node.insertBefore(r.node,n),this.parent.isAttached&&M.sendMessage(r,nt.Msg.AfterAttach)}detachWidget(t,e){this.parent.isAttached&&M.sendMessage(e,nt.Msg.BeforeDetach),this.parent.node.removeChild(e.node),this.parent.isAttached&&M.sendMessage(e,nt.Msg.AfterDetach)}};!function(t){t.clampDimension=function(t){return Math.max(0,Math.floor(t))}}(st||(st={}));var ct,ut=st,ht=class t extends lt{constructor(t){super(),this.widgetOffset=0,this._fixed=0,this._spacing=4,this._dirty=!1,this._hasNormedSizes=!1,this._sizers=[],this._items=[],this._handles=[],this._box=null,this._alignment="start",this._orientation="horizontal",this.renderer=t.renderer,void 0!==t.orientation&&(this._orientation=t.orientation),void 0!==t.alignment&&(this._alignment=t.alignment),void 0!==t.spacing&&(this._spacing=st.clampDimension(t.spacing))}dispose(){for(let t of this._items)t.dispose();this._box=null,this._items.length=0,this._sizers.length=0,this._handles.length=0,super.dispose()}get orientation(){return this._orientation}set orientation(t){this._orientation!==t&&(this._orientation=t,this.parent&&(this.parent.dataset.orientation=t,this.parent.fit()))}get alignment(){return this._alignment}set alignment(t){this._alignment!==t&&(this._alignment=t,this.parent&&(this.parent.dataset.alignment=t,this.parent.update()))}get spacing(){return this._spacing}set spacing(t){t=st.clampDimension(t),this._spacing!==t&&(this._spacing=t,this.parent&&this.parent.fit())}get handles(){return this._handles}absoluteSizes(){return this._sizers.map((t=>t.size))}relativeSizes(){return ct.normalize(this._sizers.map((t=>t.size)))}setRelativeSizes(t,e=!0){let r=this._sizers.length,n=t.slice(0,r);for(;n.length0&&(t.sizeHint=t.size);Q.adjust(this._sizers,t,r),this.parent&&this.parent.update()}}init(){this.parent.dataset.orientation=this.orientation,this.parent.dataset.alignment=this.alignment,super.init()}attachWidget(t,e){let r=new ot(e),n=ct.createHandle(this.renderer),i=ct.averageSize(this._sizers),a=ct.createSizer(i);b.ArrayExt.insert(this._items,t,r),b.ArrayExt.insert(this._sizers,t,a),b.ArrayExt.insert(this._handles,t,n),this.parent.isAttached&&M.sendMessage(e,nt.Msg.BeforeAttach),this.parent.node.appendChild(e.node),this.parent.node.appendChild(n),this.parent.isAttached&&M.sendMessage(e,nt.Msg.AfterAttach),this.parent.fit()}moveWidget(t,e,r){b.ArrayExt.move(this._items,t,e),b.ArrayExt.move(this._sizers,t,e),b.ArrayExt.move(this._handles,t,e),this.parent.fit()}detachWidget(t,e){let r=b.ArrayExt.removeAt(this._items,t),n=b.ArrayExt.removeAt(this._handles,t);b.ArrayExt.removeAt(this._sizers,t),this.parent.isAttached&&M.sendMessage(e,nt.Msg.BeforeDetach),this.parent.node.removeChild(e.node),this.parent.node.removeChild(n),this.parent.isAttached&&M.sendMessage(e,nt.Msg.AfterDetach),r.dispose(),this.parent.fit()}onBeforeShow(t){super.onBeforeShow(t),this.parent.update()}onBeforeAttach(t){super.onBeforeAttach(t),this.parent.fit()}onChildShown(t){this.parent.fit()}onChildHidden(t){this.parent.fit()}onResize(t){this.parent.isVisible&&this._update(t.width,t.height)}onUpdateRequest(t){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(t){this.parent.isAttached&&this._fit()}updateItemPosition(t,e,r,n,i,a,o){let s=this._items[t];if(s.isHidden)return;let l=this._handles[t].style;e?(r+=this.widgetOffset,s.update(r,n,o,i),r+=o,l.top=`${n}px`,l.left=`${r}px`,l.width=`${this._spacing}px`,l.height=`${i}px`):(n+=this.widgetOffset,s.update(r,n,a,o),n+=o,l.top=`${n}px`,l.left=`${r}px`,l.width=`${a}px`,l.height=`${this._spacing}px`)}_fit(){let e=0,r=-1;for(let t=0,n=this._items.length;t0&&(i.sizeHint=i.size),r.isHidden?(i.minSize=0,i.maxSize=0):(r.fit(),i.stretch=t.getStretch(r.widget),n?(i.minSize=r.minWidth,i.maxSize=r.maxWidth,a+=r.minWidth,o=Math.max(o,r.minHeight)):(i.minSize=r.minHeight,i.maxSize=r.maxHeight,o+=r.minHeight,a=Math.max(a,r.minWidth)))}let s=this._box=i.boxSizing(this.parent.node);a+=s.horizontalSum,o+=s.verticalSum;let l=this.parent.node.style;l.minWidth=`${a}px`,l.minHeight=`${o}px`,this._dirty=!0,this.parent.parent&&M.sendMessage(this.parent.parent,nt.Msg.FitRequest),this._dirty&&M.sendMessage(this.parent,nt.Msg.UpdateRequest)}_update(t,e){this._dirty=!1;let r=0;for(let t=0,e=this._items.length;t0){let t;if(t=u?Math.max(0,o-this._fixed):Math.max(0,s-this._fixed),this._hasNormedSizes){for(let e of this._sizers)e.sizeHint*=t;this._hasNormedSizes=!1}let e=Q.calc(this._sizers,t);if(e>0)switch(this._alignment){case"start":break;case"center":l=0,c=e/2;break;case"end":l=0,c=e;break;case"justify":l=e/r,c=0;break;default:throw"unreachable"}}for(let t=0,e=this._items.length;t0,coerce:(t,e)=>Math.max(0,Math.floor(e)),changed:function(t){t.parent&&t.parent.layout instanceof ht&&t.parent.fit()}}),t.createSizer=function(t){let e=new tt;return e.sizeHint=Math.floor(t),e},t.createHandle=function(t){let e=t.createHandle();return e.style.position="absolute",e.style.contain="style",e},t.averageSize=function(t){return t.reduce(((t,e)=>t+e.size),0)/t.length||0},t.normalize=function(t){let e=t.length;if(0===e)return[];let r=t.reduce(((t,e)=>t+Math.abs(e)),0);return 0===r?t.map((t=>1/e)):t.map((t=>t/r))}}(ct||(ct={}));var pt,ft=class extends ht{constructor(t){super({...t,orientation:t.orientation||"vertical"}),this._titles=[],this.titleSpace=t.titleSpace||22}get titleSpace(){return this.widgetOffset}set titleSpace(t){t=ut.clampDimension(t),this.widgetOffset!==t&&(this.widgetOffset=t,this.parent&&this.parent.fit())}get titles(){return this._titles}dispose(){this.isDisposed||(this._titles.length=0,super.dispose())}updateTitle(t,e){let r=this._titles[t],n=r.classList.contains("lm-mod-expanded"),i=pt.createTitle(this.renderer,e.title,n);this._titles[t]=i,this.parent.node.replaceChild(i,r)}insertWidget(t,e){e.id||(e.id=`id-${w.UUID.uuid4()}`),super.insertWidget(t,e)}attachWidget(t,e){let r=pt.createTitle(this.renderer,e.title);b.ArrayExt.insert(this._titles,t,r),this.parent.node.appendChild(r),e.node.setAttribute("role","region"),e.node.setAttribute("aria-labelledby",r.id),super.attachWidget(t,e)}moveWidget(t,e,r){b.ArrayExt.move(this._titles,t,e),super.moveWidget(t,e,r)}detachWidget(t,e){let r=b.ArrayExt.removeAt(this._titles,t);this.parent.node.removeChild(r),super.detachWidget(t,e)}updateItemPosition(t,e,r,n,i,a,o){let s=this._titles[t].style;s.top=`${n}px`,s.left=`${r}px`,s.height=`${this.widgetOffset}px`,s.width=e?`${i}px`:`${a}px`,super.updateItemPosition(t,e,r,n,i,a,o)}};!function(t){t.createTitle=function(t,e,r=!0){let n=t.createSectionTitle(e);return n.style.position="absolute",n.style.contain="strict",n.setAttribute("aria-label",`${e.label} Section`),n.setAttribute("aria-expanded",r?"true":"false"),n.setAttribute("aria-controls",e.owner.id),r&&n.classList.add("lm-mod-expanded"),n}}(pt||(pt={}));var dt,mt=class extends nt{constructor(t={}){super(),this.addClass("lm-Panel"),this.layout=dt.createLayout(t)}get widgets(){return this.layout.widgets}addWidget(t){this.layout.addWidget(t)}insertWidget(t,e){this.layout.insertWidget(t,e)}};!function(t){t.createLayout=function(t){return t.layout||new lt}}(dt||(dt={}));var gt,yt=class extends mt{constructor(t={}){super({layout:gt.createLayout(t)}),this._handleMoved=new z(this),this._pressData=null,this.addClass("lm-SplitPanel")}dispose(){this._releaseMouse(),super.dispose()}get orientation(){return this.layout.orientation}set orientation(t){this.layout.orientation=t}get alignment(){return this.layout.alignment}set alignment(t){this.layout.alignment=t}get spacing(){return this.layout.spacing}set spacing(t){this.layout.spacing=t}get renderer(){return this.layout.renderer}get handleMoved(){return this._handleMoved}get handles(){return this.layout.handles}relativeSizes(){return this.layout.relativeSizes()}setRelativeSizes(t,e=!0){this.layout.setRelativeSizes(t,e)}handleEvent(t){switch(t.type){case"pointerdown":this._evtPointerDown(t);break;case"pointermove":this._evtPointerMove(t);break;case"pointerup":this._evtPointerUp(t);break;case"keydown":this._evtKeyDown(t);break;case"contextmenu":t.preventDefault(),t.stopPropagation()}}onBeforeAttach(t){this.node.addEventListener("pointerdown",this)}onAfterDetach(t){this.node.removeEventListener("pointerdown",this),this._releaseMouse()}onChildAdded(t){t.child.addClass("lm-SplitPanel-child"),this._releaseMouse()}onChildRemoved(t){t.child.removeClass("lm-SplitPanel-child"),this._releaseMouse()}_evtKeyDown(t){this._pressData&&(t.preventDefault(),t.stopPropagation()),27===t.keyCode&&this._releaseMouse()}_evtPointerDown(t){if(0!==t.button)return;let e=this.layout,r=b.ArrayExt.findFirstIndex(e.handles,(e=>e.contains(t.target)));if(-1===r)return;t.preventDefault(),t.stopPropagation(),document.addEventListener("pointerup",this,!0),document.addEventListener("pointermove",this,!0),document.addEventListener("keydown",this,!0),document.addEventListener("contextmenu",this,!0);let n,i=e.handles[r],a=i.getBoundingClientRect();n="horizontal"===e.orientation?t.clientX-a.left:t.clientY-a.top;let o=window.getComputedStyle(i),s=B.overrideCursor(o.cursor);this._pressData={index:r,delta:n,override:s}}_evtPointerMove(t){t.preventDefault(),t.stopPropagation();let e,r=this.layout,n=this.node.getBoundingClientRect();e="horizontal"===r.orientation?t.clientX-n.left-this._pressData.delta:t.clientY-n.top-this._pressData.delta,r.moveHandle(this._pressData.index,e)}_evtPointerUp(t){0===t.button&&(t.preventDefault(),t.stopPropagation(),this._releaseMouse())}_releaseMouse(){this._pressData&&(this._pressData.override.dispose(),this._pressData=null,this._handleMoved.emit(),document.removeEventListener("keydown",this,!0),document.removeEventListener("pointerup",this,!0),document.removeEventListener("pointermove",this,!0),document.removeEventListener("contextmenu",this,!0))}};!function(t){class e{createHandle(){let t=document.createElement("div");return t.className="lm-SplitPanel-handle",t}}t.Renderer=e,t.defaultRenderer=new e,t.getStretch=function(t){return ht.getStretch(t)},t.setStretch=function(t,e){ht.setStretch(t,e)}}(yt||(yt={})),function(t){t.createLayout=function(t){return t.layout||new ht({renderer:t.renderer||yt.defaultRenderer,orientation:t.orientation,alignment:t.alignment,spacing:t.spacing})}}(gt||(gt={}));var vt,xt=class extends yt{constructor(t={}){super({...t,layout:vt.createLayout(t)}),this._widgetSizesCache=new WeakMap,this._expansionToggled=new z(this),this.addClass("lm-AccordionPanel")}get renderer(){return this.layout.renderer}get titleSpace(){return this.layout.titleSpace}set titleSpace(t){this.layout.titleSpace=t}get titles(){return this.layout.titles}get expansionToggled(){return this._expansionToggled}addWidget(t){super.addWidget(t),t.title.changed.connect(this._onTitleChanged,this)}collapse(t){let e=this.layout.widgets[t];e&&!e.isHidden&&this._toggleExpansion(t)}expand(t){let e=this.layout.widgets[t];e&&e.isHidden&&this._toggleExpansion(t)}insertWidget(t,e){super.insertWidget(t,e),e.title.changed.connect(this._onTitleChanged,this)}handleEvent(t){switch(super.handleEvent(t),t.type){case"click":this._evtClick(t);break;case"keydown":this._eventKeyDown(t)}}onBeforeAttach(t){this.node.addEventListener("click",this),this.node.addEventListener("keydown",this),super.onBeforeAttach(t)}onAfterDetach(t){super.onAfterDetach(t),this.node.removeEventListener("click",this),this.node.removeEventListener("keydown",this)}_onTitleChanged(t){let e=b.ArrayExt.findFirstIndex(this.widgets,(e=>e.contains(t.owner)));e>=0&&(this.layout.updateTitle(e,t.owner),this.update())}_computeWidgetSize(t){let e=this.layout,r=e.widgets[t];if(!r)return;let n=r.isHidden,i=e.absoluteSizes(),a=(n?-1:1)*this.spacing,o=i.reduce(((t,e)=>t+e)),s=[...i];if(n){let e=this._widgetSizesCache.get(r);if(!e)return;s[t]+=e;let n=s.map((t=>t-e>0)).lastIndexOf(!0);-1===n?s.forEach(((r,n)=>{n!==t&&(s[n]-=i[n]/o*(e-a))})):s[n]-=e-a}else{let e=i[t];this._widgetSizesCache.set(r,e),s[t]=0;let n=s.map((t=>t>0)).lastIndexOf(!0);if(-1===n)return;s[n]=i[n]+e+a}return s.map((t=>t/(o+a)))}_evtClick(t){let e=t.target;if(e){let r=b.ArrayExt.findFirstIndex(this.titles,(t=>t.contains(e)));r>=0&&(t.preventDefault(),t.stopPropagation(),this._toggleExpansion(r))}}_eventKeyDown(t){if(t.defaultPrevented)return;let e=t.target,r=!1;if(e){let n=b.ArrayExt.findFirstIndex(this.titles,(t=>t.contains(e)));if(n>=0){let i=t.keyCode.toString();if(t.key.match(/Space|Enter/)||i.match(/13|32/))e.click(),r=!0;else if("horizontal"===this.orientation?t.key.match(/ArrowLeft|ArrowRight/)||i.match(/37|39/):t.key.match(/ArrowUp|ArrowDown/)||i.match(/38|40/)){let e=t.key.match(/ArrowLeft|ArrowUp/)||i.match(/37|38/)?-1:1,a=this.titles.length,o=(n+a+e)%a;this.titles[o].focus(),r=!0}else"End"===t.key||"35"===i?(this.titles[this.titles.length-1].focus(),r=!0):("Home"===t.key||"36"===i)&&(this.titles[0].focus(),r=!0)}r&&t.preventDefault()}}_toggleExpansion(t){let e=this.titles[t],r=this.layout.widgets[t],n=this._computeWidgetSize(t);n&&this.setRelativeSizes(n,!1),r.isHidden?(e.classList.add("lm-mod-expanded"),e.setAttribute("aria-expanded","true"),r.show()):(e.classList.remove("lm-mod-expanded"),e.setAttribute("aria-expanded","false"),r.hide()),this._expansionToggled.emit(t)}};!function(t){class e extends yt.Renderer{constructor(){super(),this.titleClassName="lm-AccordionPanel-title",this._titleID=0,this._titleKeys=new WeakMap,this._uuid=++e._nInstance}createCollapseIcon(t){return document.createElement("span")}createSectionTitle(t){let e=document.createElement("h3");e.setAttribute("tabindex","0"),e.id=this.createTitleKey(t),e.className=this.titleClassName;for(let r in t.dataset)e.dataset[r]=t.dataset[r];e.appendChild(this.createCollapseIcon(t)).className="lm-AccordionPanel-titleCollapser";let r=e.appendChild(document.createElement("span"));return r.className="lm-AccordionPanel-titleLabel",r.textContent=t.label,r.title=t.caption||t.label,e}createTitleKey(t){let e=this._titleKeys.get(t);return void 0===e&&(e=`title-key-${this._uuid}-${this._titleID++}`,this._titleKeys.set(t,e)),e}}e._nInstance=0,t.Renderer=e,t.defaultRenderer=new e}(xt||(xt={})),function(t){t.createLayout=function(t){return t.layout||new ft({renderer:t.renderer||xt.defaultRenderer,orientation:t.orientation,alignment:t.alignment,spacing:t.spacing,titleSpace:t.titleSpace})}}(vt||(vt={}));var _t,bt=class t extends lt{constructor(t={}){super(),this._fixed=0,this._spacing=4,this._dirty=!1,this._sizers=[],this._items=[],this._box=null,this._alignment="start",this._direction="top-to-bottom",void 0!==t.direction&&(this._direction=t.direction),void 0!==t.alignment&&(this._alignment=t.alignment),void 0!==t.spacing&&(this._spacing=ut.clampDimension(t.spacing))}dispose(){for(let t of this._items)t.dispose();this._box=null,this._items.length=0,this._sizers.length=0,super.dispose()}get direction(){return this._direction}set direction(t){this._direction!==t&&(this._direction=t,this.parent&&(this.parent.dataset.direction=t,this.parent.fit()))}get alignment(){return this._alignment}set alignment(t){this._alignment!==t&&(this._alignment=t,this.parent&&(this.parent.dataset.alignment=t,this.parent.update()))}get spacing(){return this._spacing}set spacing(t){t=ut.clampDimension(t),this._spacing!==t&&(this._spacing=t,this.parent&&this.parent.fit())}init(){this.parent.dataset.direction=this.direction,this.parent.dataset.alignment=this.alignment,super.init()}attachWidget(t,e){b.ArrayExt.insert(this._items,t,new ot(e)),b.ArrayExt.insert(this._sizers,t,new tt),this.parent.isAttached&&M.sendMessage(e,nt.Msg.BeforeAttach),this.parent.node.appendChild(e.node),this.parent.isAttached&&M.sendMessage(e,nt.Msg.AfterAttach),this.parent.fit()}moveWidget(t,e,r){b.ArrayExt.move(this._items,t,e),b.ArrayExt.move(this._sizers,t,e),this.parent.update()}detachWidget(t,e){let r=b.ArrayExt.removeAt(this._items,t);b.ArrayExt.removeAt(this._sizers,t),this.parent.isAttached&&M.sendMessage(e,nt.Msg.BeforeDetach),this.parent.node.removeChild(e.node),this.parent.isAttached&&M.sendMessage(e,nt.Msg.AfterDetach),r.dispose(),this.parent.fit()}onBeforeShow(t){super.onBeforeShow(t),this.parent.update()}onBeforeAttach(t){super.onBeforeAttach(t),this.parent.fit()}onChildShown(t){this.parent.fit()}onChildHidden(t){this.parent.fit()}onResize(t){this.parent.isVisible&&this._update(t.width,t.height)}onUpdateRequest(t){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(t){this.parent.isAttached&&this._fit()}_fit(){let e=0;for(let t=0,r=this._items.length;t0)switch(this._alignment){case"start":break;case"center":c=0,u=n/2;break;case"end":c=0,u=n;break;case"justify":c=n/r,u=0;break;default:throw"unreachable"}for(let t=0,e=this._items.length;t0,coerce:(t,e)=>Math.max(0,Math.floor(e)),changed:e}),t.sizeBasisProperty=new I({name:"sizeBasis",create:()=>0,coerce:(t,e)=>Math.max(0,Math.floor(e)),changed:e}),t.isHorizontal=function(t){return"left-to-right"===t||"right-to-left"===t},t.clampSpacing=function(t){return Math.max(0,Math.floor(t))}}(_t||(_t={}));var wt,Tt=class extends mt{constructor(t={}){super({layout:wt.createLayout(t)}),this.addClass("lm-BoxPanel")}get direction(){return this.layout.direction}set direction(t){this.layout.direction=t}get alignment(){return this.layout.alignment}set alignment(t){this.layout.alignment=t}get spacing(){return this.layout.spacing}set spacing(t){this.layout.spacing=t}onChildAdded(t){t.child.addClass("lm-BoxPanel-child")}onChildRemoved(t){t.child.removeClass("lm-BoxPanel-child")}};!function(t){t.getStretch=function(t){return bt.getStretch(t)},t.setStretch=function(t,e){bt.setStretch(t,e)},t.getSizeBasis=function(t){return bt.getSizeBasis(t)},t.setSizeBasis=function(t,e){bt.setSizeBasis(t,e)}}(Tt||(Tt={})),function(t){t.createLayout=function(t){return t.layout||new bt(t)}}(wt||(wt={}));var At,kt=class t extends nt{constructor(e){super({node:At.createNode()}),this._activeIndex=-1,this._items=[],this._results=null,this.addClass("lm-CommandPalette"),this.setFlag(nt.Flag.DisallowLayout),this.commands=e.commands,this.renderer=e.renderer||t.defaultRenderer,this.commands.commandChanged.connect(this._onGenericChange,this),this.commands.keyBindingChanged.connect(this._onGenericChange,this)}dispose(){this._items.length=0,this._results=null,super.dispose()}get searchNode(){return this.node.getElementsByClassName("lm-CommandPalette-search")[0]}get inputNode(){return this.node.getElementsByClassName("lm-CommandPalette-input")[0]}get contentNode(){return this.node.getElementsByClassName("lm-CommandPalette-content")[0]}get items(){return this._items}addItem(t){let e=At.createItem(this.commands,t);return this._items.push(e),this.refresh(),e}addItems(t){let e=t.map((t=>At.createItem(this.commands,t)));return e.forEach((t=>this._items.push(t))),this.refresh(),e}removeItem(t){this.removeItemAt(this._items.indexOf(t))}removeItemAt(t){b.ArrayExt.removeAt(this._items,t)&&this.refresh()}clearItems(){0!==this._items.length&&(this._items.length=0,this.refresh())}refresh(){this._results=null,""!==this.inputNode.value?this.node.getElementsByClassName("lm-close-icon")[0].style.display="inherit":this.node.getElementsByClassName("lm-close-icon")[0].style.display="none",this.update()}handleEvent(t){switch(t.type){case"click":this._evtClick(t);break;case"keydown":this._evtKeyDown(t);break;case"input":this.refresh();break;case"focus":case"blur":this._toggleFocused()}}onBeforeAttach(t){this.node.addEventListener("click",this),this.node.addEventListener("keydown",this),this.node.addEventListener("input",this),this.node.addEventListener("focus",this,!0),this.node.addEventListener("blur",this,!0)}onAfterDetach(t){this.node.removeEventListener("click",this),this.node.removeEventListener("keydown",this),this.node.removeEventListener("input",this),this.node.removeEventListener("focus",this,!0),this.node.removeEventListener("blur",this,!0)}onAfterShow(t){this.update(),super.onAfterShow(t)}onActivateRequest(t){if(this.isAttached){let t=this.inputNode;t.focus(),t.select()}}onUpdateRequest(t){if(this.isHidden)return;let e=this.inputNode.value,r=this.contentNode,n=this._results;if(n||(n=this._results=At.search(this._items,e),this._activeIndex=e?b.ArrayExt.findFirstIndex(n,At.canActivate):-1),!e&&0===n.length)return void Z.render(null,r);if(e&&0===n.length){let t=this.renderer.renderEmptyMessage({query:e});return void Z.render(t,r)}let a=this.renderer,o=this._activeIndex,s=new Array(n.length);for(let t=0,e=n.length;t=n.length)r.scrollTop=0;else{let t=r.children[o];i.scrollIntoViewIfNeeded(r,t)}}_evtClick(t){if(0!==t.button)return;if(t.target.classList.contains("lm-close-icon"))return this.inputNode.value="",void this.refresh();let e=b.ArrayExt.findFirstIndex(this.contentNode.children,(e=>e.contains(t.target)));-1!==e&&(t.preventDefault(),t.stopPropagation(),this._execute(e))}_evtKeyDown(t){if(!(t.altKey||t.ctrlKey||t.metaKey||t.shiftKey))switch(t.keyCode){case 13:t.preventDefault(),t.stopPropagation(),this._execute(this._activeIndex);break;case 38:t.preventDefault(),t.stopPropagation(),this._activatePreviousItem();break;case 40:t.preventDefault(),t.stopPropagation(),this._activateNextItem()}}_activateNextItem(){if(!this._results||0===this._results.length)return;let t=this._activeIndex,e=this._results.length,r=tt-e)),c=a.slice(0,l),u=a.slice(l);for(let t=0,e=u.length;tr.command===t&&w.JSONExt.deepEqual(r.args,e)))||null}}}(At||(At={}));var Mt,St,Et=class t extends nt{constructor(e){super({node:Mt.createNode()}),this._childIndex=-1,this._activeIndex=-1,this._openTimerID=0,this._closeTimerID=0,this._items=[],this._childMenu=null,this._parentMenu=null,this._aboutToClose=new z(this),this._menuRequested=new z(this),this.addClass("lm-Menu"),this.setFlag(nt.Flag.DisallowLayout),this.commands=e.commands,this.renderer=e.renderer||t.defaultRenderer}dispose(){this.close(),this._items.length=0,super.dispose()}get aboutToClose(){return this._aboutToClose}get menuRequested(){return this._menuRequested}get parentMenu(){return this._parentMenu}get childMenu(){return this._childMenu}get rootMenu(){let t=this;for(;t._parentMenu;)t=t._parentMenu;return t}get leafMenu(){let t=this;for(;t._childMenu;)t=t._childMenu;return t}get contentNode(){return this.node.getElementsByClassName("lm-Menu-content")[0]}get activeItem(){return this._items[this._activeIndex]||null}set activeItem(t){this.activeIndex=t?this._items.indexOf(t):-1}get activeIndex(){return this._activeIndex}set activeIndex(t){(t<0||t>=this._items.length)&&(t=-1),-1!==t&&!Mt.canActivate(this._items[t])&&(t=-1),this._activeIndex!==t&&(this._activeIndex=t,this._activeIndex>=0&&this.contentNode.childNodes[this._activeIndex]&&this.contentNode.childNodes[this._activeIndex].focus(),this.update())}get items(){return this._items}activateNextItem(){let t=this._items.length,e=this._activeIndex,r=e{this.activeIndex=t}})}Z.render(a,this.contentNode)}onCloseRequest(t){this._cancelOpenTimer(),this._cancelCloseTimer(),this.activeIndex=-1;let e=this._childMenu;e&&(this._childIndex=-1,this._childMenu=null,e._parentMenu=null,e.close());let r=this._parentMenu;r&&(this._parentMenu=null,r._childIndex=-1,r._childMenu=null,r.activate()),this.isAttached&&this._aboutToClose.emit(void 0),super.onCloseRequest(t)}_evtKeyDown(t){t.preventDefault(),t.stopPropagation();let e=t.keyCode;if(13===e)return void this.triggerActiveItem();if(27===e)return void this.close();if(37===e)return void(this._parentMenu?this.close():this._menuRequested.emit("previous"));if(38===e)return void this.activatePreviousItem();if(39===e){let t=this.activeItem;return void(t&&"submenu"===t.type?this.triggerActiveItem():this.rootMenu._menuRequested.emit("next"))}if(40===e)return void this.activateNextItem();let r=U().keyForKeydownEvent(t);if(!r)return;let n=this._activeIndex+1,i=Mt.findMnemonic(this._items,r,n);-1===i.index||i.multiple?-1!==i.index?this.activeIndex=i.index:-1!==i.auto&&(this.activeIndex=i.auto):(this.activeIndex=i.index,this.triggerActiveItem())}_evtMouseUp(t){0===t.button&&(t.preventDefault(),t.stopPropagation(),this.triggerActiveItem())}_evtMouseMove(t){let e=b.ArrayExt.findFirstIndex(this.contentNode.children,(e=>i.hitTest(e,t.clientX,t.clientY)));if(e===this._activeIndex)return;if(this.activeIndex=e,e=this.activeIndex,e===this._childIndex)return this._cancelOpenTimer(),void this._cancelCloseTimer();-1!==this._childIndex&&this._startCloseTimer(),this._cancelOpenTimer();let r=this.activeItem;!r||"submenu"!==r.type||!r.submenu||this._startOpenTimer()}_evtMouseEnter(t){for(let t=this._parentMenu;t;t=t._parentMenu)t._cancelOpenTimer(),t._cancelCloseTimer(),t.activeIndex=t._childIndex}_evtMouseLeave(t){if(this._cancelOpenTimer(),!this._childMenu)return void(this.activeIndex=-1);let{clientX:e,clientY:r}=t;i.hitTest(this._childMenu.node,e,r)?this._cancelCloseTimer():(this.activeIndex=-1,this._startCloseTimer())}_evtMouseDown(t){this._parentMenu||(Mt.hitTestMenus(this,t.clientX,t.clientY)?(t.preventDefault(),t.stopPropagation()):this.close())}_openChildMenu(e=!1){let r=this.activeItem;if(!r||"submenu"!==r.type||!r.submenu)return void this._closeChildMenu();let n=r.submenu;if(n===this._childMenu)return;t.saveWindowData(),this._closeChildMenu(),this._childMenu=n,this._childIndex=this._activeIndex,n._parentMenu=this,M.sendMessage(this,nt.Msg.UpdateRequest);let i=this.contentNode.children[this._activeIndex];Mt.openSubmenu(n,i),e&&(n.activeIndex=-1,n.activateNextItem()),n.activate()}_closeChildMenu(){this._childMenu&&this._childMenu.close()}_startOpenTimer(){0===this._openTimerID&&(this._openTimerID=window.setTimeout((()=>{this._openTimerID=0,this._openChildMenu()}),Mt.TIMER_DELAY))}_startCloseTimer(){0===this._closeTimerID&&(this._closeTimerID=window.setTimeout((()=>{this._closeTimerID=0,this._closeChildMenu()}),Mt.TIMER_DELAY))}_cancelOpenTimer(){0!==this._openTimerID&&(clearTimeout(this._openTimerID),this._openTimerID=0)}_cancelCloseTimer(){0!==this._closeTimerID&&(clearTimeout(this._closeTimerID),this._closeTimerID=0)}static saveWindowData(){Mt.saveWindowData()}};!function(t){class e{renderItem(t){let e=this.createItemClass(t),r=this.createItemDataset(t),n=this.createItemARIA(t);return J.li({className:e,dataset:r,tabindex:"0",onfocus:t.onfocus,...n},this.renderIcon(t),this.renderLabel(t),this.renderShortcut(t),this.renderSubmenu(t))}renderIcon(t){let e=this.createIconClass(t);return J.div({className:e},t.item.icon,t.item.iconLabel)}renderLabel(t){let e=this.formatLabel(t);return J.div({className:"lm-Menu-itemLabel"},e)}renderShortcut(t){let e=this.formatShortcut(t);return J.div({className:"lm-Menu-itemShortcut"},e)}renderSubmenu(t){return J.div({className:"lm-Menu-itemSubmenuIcon"})}createItemClass(t){let e="lm-Menu-item";t.item.isEnabled||(e+=" lm-mod-disabled"),t.item.isToggled&&(e+=" lm-mod-toggled"),t.item.isVisible||(e+=" lm-mod-hidden"),t.active&&(e+=" lm-mod-active"),t.collapsed&&(e+=" lm-mod-collapsed");let r=t.item.className;return r&&(e+=` ${r}`),e}createItemDataset(t){let e,{type:r,command:n,dataset:i}=t.item;return e="command"===r?{...i,type:r,command:n}:{...i,type:r},e}createIconClass(t){let e="lm-Menu-itemIcon",r=t.item.iconClass;return r?`${e} ${r}`:e}createItemARIA(t){let e={};switch(t.item.type){case"separator":e.role="presentation";break;case"submenu":e["aria-haspopup"]="true",t.item.isEnabled||(e["aria-disabled"]="true");break;default:t.item.isEnabled||(e["aria-disabled"]="true"),e.role="menuitem"}return e}formatLabel(t){let{label:e,mnemonic:r}=t.item;if(r<0||r>=e.length)return e;let n=e.slice(0,r),i=e.slice(r+1),a=e[r];return[n,J.span({className:"lm-Menu-itemMnemonic"},a),i]}formatShortcut(t){let e=t.item.keyBinding;return e?W.formatKeystroke(e.keys):null}}t.Renderer=e,t.defaultRenderer=new e}(Et||(Et={})),function(t){t.TIMER_DELAY=300,t.SUBMENU_OVERLAP=3;let e=null,r=0;function n(){return r>0?(r--,e):o()}function a(t){return"separator"!==t.type&&t.isEnabled&&t.isVisible}function o(){return{pageXOffset:window.pageXOffset,pageYOffset:window.pageYOffset,clientWidth:document.documentElement.clientWidth,clientHeight:document.documentElement.clientHeight}}t.saveWindowData=function(){e=o(),r++},t.createNode=function(){let t=document.createElement("div"),e=document.createElement("ul");return e.className="lm-Menu-content",t.appendChild(e),e.setAttribute("role","menu"),t.tabIndex=0,t},t.canActivate=a,t.createItem=function(t,e){return new s(t.commands,e)},t.hitTestMenus=function(t,e,r){for(let n=t;n;n=n.childMenu)if(i.hitTest(n.node,e,r))return!0;return!1},t.computeCollapsed=function(t){let e=new Array(t.length);b.ArrayExt.fill(e,!1);let r=0,n=t.length;for(;r=0;--i){let r=t[i];if(r.isVisible){if("separator"!==r.type)break;e[i]=!0}}let a=!1;for(;++rc+h&&(e=c+h-g),!a&&r+y>u+p&&(r>u+p?r=u+p-y:r-=y),m.transform=`translate(${Math.max(0,e)}px, ${Math.max(0,r)}px`,m.opacity="1"},t.openSubmenu=function(e,r){let a=n(),o=a.pageXOffset,s=a.pageYOffset,l=a.clientWidth,c=a.clientHeight;M.sendMessage(e,nt.Msg.UpdateRequest);let u=c,h=e.node,p=h.style;p.opacity="0",p.maxHeight=`${u}px`,nt.attach(e,document.body);let{width:f,height:d}=h.getBoundingClientRect(),m=i.boxSizing(e.node),g=r.getBoundingClientRect(),y=g.right-t.SUBMENU_OVERLAP;y+f>o+l&&(y=g.left+t.SUBMENU_OVERLAP-f);let v=g.top-m.borderTop-m.paddingTop;v+d>s+c&&(v=g.bottom+m.borderBottom+m.paddingBottom-d),p.transform=`translate(${Math.max(0,y)}px, ${Math.max(0,v)}px`,p.opacity="1"},t.findMnemonic=function(t,e,r){let n=-1,i=-1,o=!1,s=e.toUpperCase();for(let e=0,l=t.length;e=0&&pr.command===t&&w.JSONExt.deepEqual(r.args,e)))||null}return null}}}(Mt||(Mt={})),function(t){function e(t,e){let r=t.rank,n=e.rank;return r!==n?r=this._titles.length)&&(t=-1),this._currentIndex===t)return;let e=this._currentIndex,r=this._titles[e]||null,n=t,i=this._titles[n]||null;this._currentIndex=n,this._previousTitle=r,this.update(),this._currentChanged.emit({previousIndex:e,previousTitle:r,currentIndex:n,currentTitle:i})}get name(){return this._name}set name(t){this._name=t,t?this.contentNode.setAttribute("aria-label",t):this.contentNode.removeAttribute("aria-label")}get orientation(){return this._orientation}set orientation(t){this._orientation!==t&&(this._releaseMouse(),this._orientation=t,this.dataset.orientation=t,this.contentNode.setAttribute("aria-orientation",t))}get addButtonEnabled(){return this._addButtonEnabled}set addButtonEnabled(t){this._addButtonEnabled!==t&&(this._addButtonEnabled=t,t?this.addButtonNode.classList.remove("lm-mod-hidden"):this.addButtonNode.classList.add("lm-mod-hidden"))}get titles(){return this._titles}get contentNode(){return this.node.getElementsByClassName("lm-TabBar-content")[0]}get addButtonNode(){return this.node.getElementsByClassName("lm-TabBar-addButton")[0]}addTab(t){return this.insertTab(this._titles.length,t)}insertTab(t,e){this._releaseMouse();let r=Ct.asTitle(e),n=this._titles.indexOf(r),i=Math.max(0,Math.min(t,this._titles.length));return-1===n?(b.ArrayExt.insert(this._titles,i,r),r.changed.connect(this._onTitleChanged,this),this.update(),this._adjustCurrentForInsert(i,r),r):(i===this._titles.length&&i--,n===i||(b.ArrayExt.move(this._titles,n,i),this.update(),this._adjustCurrentForMove(n,i)),r)}removeTab(t){this.removeTabAt(this._titles.indexOf(t))}removeTabAt(t){this._releaseMouse();let e=b.ArrayExt.removeAt(this._titles,t);e&&(e.changed.disconnect(this._onTitleChanged,this),e===this._previousTitle&&(this._previousTitle=null),this.update(),this._adjustCurrentForRemove(t,e))}clearTabs(){if(0===this._titles.length)return;this._releaseMouse();for(let t of this._titles)t.changed.disconnect(this._onTitleChanged,this);let t=this.currentIndex,e=this.currentTitle;this._currentIndex=-1,this._previousTitle=null,this._titles.length=0,this.update(),-1!==t&&this._currentChanged.emit({previousIndex:t,previousTitle:e,currentIndex:-1,currentTitle:null})}releaseMouse(){this._releaseMouse()}handleEvent(t){switch(t.type){case"pointerdown":this._evtPointerDown(t);break;case"pointermove":this._evtPointerMove(t);break;case"pointerup":this._evtPointerUp(t);break;case"dblclick":this._evtDblClick(t);break;case"keydown":t.eventPhase===Event.CAPTURING_PHASE?this._evtKeyDownCapturing(t):this._evtKeyDown(t);break;case"contextmenu":t.preventDefault(),t.stopPropagation()}}onBeforeAttach(t){this.node.addEventListener("pointerdown",this),this.node.addEventListener("dblclick",this),this.node.addEventListener("keydown",this)}onAfterDetach(t){this.node.removeEventListener("pointerdown",this),this.node.removeEventListener("dblclick",this),this.node.removeEventListener("keydown",this),this._releaseMouse()}onUpdateRequest(t){var e;let r=this._titles,n=this.renderer,i=this.currentTitle,a=new Array(r.length),o=null!==(e=this._getCurrentTabindex())&&void 0!==e?e:this._currentIndex>-1?this._currentIndex:0;for(let t=0,e=r.length;ti.hitTest(e,t.clientX,t.clientY)));if(-1===r)return;let n=this.titles[r],a=e[r].querySelector(".lm-TabBar-tabLabel");if(a&&a.contains(t.target)){let t=n.label||"",e=a.innerHTML;a.innerHTML="";let r=document.createElement("input");r.classList.add("lm-TabBar-tabInput"),r.value=t,a.appendChild(r);let i=()=>{r.removeEventListener("blur",i),a.innerHTML=e,this.node.addEventListener("keydown",this)};r.addEventListener("dblclick",(t=>t.stopPropagation())),r.addEventListener("blur",i),r.addEventListener("keydown",(t=>{"Enter"===t.key?(""!==r.value&&(n.label=n.caption=r.value),i()):"Escape"===t.key&&i()})),this.node.removeEventListener("keydown",this),r.select(),r.focus(),a.children.length>0&&a.children[0].focus()}}_evtKeyDownCapturing(t){t.eventPhase===Event.CAPTURING_PHASE&&(t.preventDefault(),t.stopPropagation(),"Escape"===t.key&&this._releaseMouse())}_evtKeyDown(t){var e,r,n;if("Tab"!==t.key&&t.eventPhase!==Event.CAPTURING_PHASE)if("Enter"===t.key||"Spacebar"===t.key||" "===t.key){let e=document.activeElement;if(this.addButtonEnabled&&this.addButtonNode.contains(e))t.preventDefault(),t.stopPropagation(),this._addRequested.emit();else{let r=b.ArrayExt.findFirstIndex(this.contentNode.children,(t=>t.contains(e)));r>=0&&(t.preventDefault(),t.stopPropagation(),this.currentIndex=r)}}else if(It.includes(t.key)){let i=[...this.contentNode.children];if(this.addButtonEnabled&&i.push(this.addButtonNode),i.length<=1)return;t.preventDefault(),t.stopPropagation();let a,o=i.indexOf(document.activeElement);-1===o&&(o=this._currentIndex),"ArrowRight"===t.key&&"horizontal"===this._orientation||"ArrowDown"===t.key&&"vertical"===this._orientation?a=null!==(e=i[o+1])&&void 0!==e?e:i[0]:"ArrowLeft"===t.key&&"horizontal"===this._orientation||"ArrowUp"===t.key&&"vertical"===this._orientation?a=null!==(r=i[o-1])&&void 0!==r?r:i[i.length-1]:"Home"===t.key?a=i[0]:"End"===t.key&&(a=i[i.length-1]),a&&(null===(n=i[o])||void 0===n||n.setAttribute("tabindex","-1"),a?.setAttribute("tabindex","0"),a.focus())}}_evtPointerDown(t){if(0!==t.button&&1!==t.button||this._dragData||t.target.classList.contains("lm-TabBar-tabInput"))return;let e=this.addButtonEnabled&&this.addButtonNode.contains(t.target),r=this.contentNode.children,n=b.ArrayExt.findFirstIndex(r,(e=>i.hitTest(e,t.clientX,t.clientY)));if(-1===n&&!e||(t.preventDefault(),t.stopPropagation(),this._dragData={tab:r[n],index:n,pressX:t.clientX,pressY:t.clientY,tabPos:-1,tabSize:-1,tabPressPos:-1,targetIndex:-1,tabLayout:null,contentRect:null,override:null,dragActive:!1,dragAborted:!1,detachRequested:!1},this.document.addEventListener("pointerup",this,!0),1===t.button||e))return;let a=r[n].querySelector(this.renderer.closeIconSelector);a&&a.contains(t.target)||(this.tabsMovable&&(this.document.addEventListener("pointermove",this,!0),this.document.addEventListener("keydown",this,!0),this.document.addEventListener("contextmenu",this,!0)),this.allowDeselect&&this.currentIndex===n?this.currentIndex=-1:this.currentIndex=n,-1!==this.currentIndex&&this._tabActivateRequested.emit({index:this.currentIndex,title:this.currentTitle}))}_evtPointerMove(t){let e=this._dragData;if(!e)return;t.preventDefault(),t.stopPropagation();let r=this.contentNode.children;if(e.dragActive||Ct.dragExceeded(e,t)){if(!e.dragActive){let t=e.tab.getBoundingClientRect();"horizontal"===this._orientation?(e.tabPos=e.tab.offsetLeft,e.tabSize=t.width,e.tabPressPos=e.pressX-t.left):(e.tabPos=e.tab.offsetTop,e.tabSize=t.height,e.tabPressPos=e.pressY-t.top),e.tabPressOffset={x:e.pressX-t.left,y:e.pressY-t.top},e.tabLayout=Ct.snapTabLayout(r,this._orientation),e.contentRect=this.contentNode.getBoundingClientRect(),e.override=B.overrideCursor("default"),e.tab.classList.add("lm-mod-dragging"),this.addClass("lm-mod-dragging"),e.dragActive=!0}if(!e.detachRequested&&Ct.detachExceeded(e,t)){e.detachRequested=!0;let n=e.index,i=t.clientX,a=t.clientY,o=r[n],s=this._titles[n];if(this._tabDetachRequested.emit({index:n,title:s,tab:o,clientX:i,clientY:a,offset:e.tabPressOffset}),e.dragAborted)return}Ct.layoutTabs(r,e,t,this._orientation)}}_evtPointerUp(t){if(0!==t.button&&1!==t.button)return;let e=this._dragData;if(!e)return;if(t.preventDefault(),t.stopPropagation(),this.document.removeEventListener("pointermove",this,!0),this.document.removeEventListener("pointerup",this,!0),this.document.removeEventListener("keydown",this,!0),this.document.removeEventListener("contextmenu",this,!0),!e.dragActive){if(this._dragData=null,this.addButtonEnabled&&this.addButtonNode.contains(t.target))return void this._addRequested.emit(void 0);let r=this.contentNode.children,n=b.ArrayExt.findFirstIndex(r,(e=>i.hitTest(e,t.clientX,t.clientY)));if(n!==e.index)return;let a=this._titles[n];if(!a.closable)return;if(1===t.button)return void this._tabCloseRequested.emit({index:n,title:a});let o=r[n].querySelector(this.renderer.closeIconSelector);return o&&o.contains(t.target)?void this._tabCloseRequested.emit({index:n,title:a}):void 0}if(0!==t.button)return;Ct.finalizeTabPosition(e,this._orientation),e.tab.classList.remove("lm-mod-dragging");let r=Ct.parseTransitionDuration(e.tab);setTimeout((()=>{if(e.dragAborted)return;this._dragData=null,Ct.resetTabPositions(this.contentNode.children,this._orientation),e.override.dispose(),this.removeClass("lm-mod-dragging");let t=e.index,r=e.targetIndex;-1===r||t===r||(b.ArrayExt.move(this._titles,t,r),this._adjustCurrentForMove(t,r),this._tabMoved.emit({fromIndex:t,toIndex:r,title:this._titles[r]}),M.sendMessage(this,nt.Msg.UpdateRequest))}),r)}_releaseMouse(){let t=this._dragData;t&&(this._dragData=null,this.document.removeEventListener("pointermove",this,!0),this.document.removeEventListener("pointerup",this,!0),this.document.removeEventListener("keydown",this,!0),this.document.removeEventListener("contextmenu",this,!0),t.dragAborted=!0,t.dragActive&&(Ct.resetTabPositions(this.contentNode.children,this._orientation),t.override.dispose(),t.tab.classList.remove("lm-mod-dragging"),this.removeClass("lm-mod-dragging")))}_adjustCurrentForInsert(t,e){let r=this.currentTitle,n=this._currentIndex,i=this.insertBehavior;if("select-tab"===i||"select-tab-if-needed"===i&&-1===n)return this._currentIndex=t,this._previousTitle=r,void this._currentChanged.emit({previousIndex:n,previousTitle:r,currentIndex:t,currentTitle:e});n>=t&&this._currentIndex++}_adjustCurrentForMove(t,e){this._currentIndex===t?this._currentIndex=e:this._currentIndex=e?this._currentIndex++:this._currentIndex>t&&this._currentIndex<=e&&this._currentIndex--}_adjustCurrentForRemove(t,e){let r=this._currentIndex,n=this.removeBehavior;if(r===t)return 0===this._titles.length?(this._currentIndex=-1,void this._currentChanged.emit({previousIndex:t,previousTitle:e,currentIndex:-1,currentTitle:null})):"select-tab-after"===n?(this._currentIndex=Math.min(t,this._titles.length-1),void this._currentChanged.emit({previousIndex:t,previousTitle:e,currentIndex:this._currentIndex,currentTitle:this.currentTitle})):"select-tab-before"===n?(this._currentIndex=Math.max(0,t-1),void this._currentChanged.emit({previousIndex:t,previousTitle:e,currentIndex:this._currentIndex,currentTitle:this.currentTitle})):"select-previous-tab"===n?(this._previousTitle?(this._currentIndex=this._titles.indexOf(this._previousTitle),this._previousTitle=null):this._currentIndex=Math.min(t,this._titles.length-1),void this._currentChanged.emit({previousIndex:t,previousTitle:e,currentIndex:this._currentIndex,currentTitle:this.currentTitle})):(this._currentIndex=-1,void this._currentChanged.emit({previousIndex:t,previousTitle:e,currentIndex:-1,currentTitle:null}));r>t&&this._currentIndex--}_onTitleChanged(t){this.update()}};!function(t){class e{constructor(){this.closeIconSelector=".lm-TabBar-tabCloseIcon",this._tabID=0,this._tabKeys=new WeakMap,this._uuid=++e._nInstance}renderTab(t){let e=t.title.caption,r=this.createTabKey(t),n=r,i=this.createTabStyle(t),a=this.createTabClass(t),o=this.createTabDataset(t),s=this.createTabARIA(t);return t.title.closable?J.li({id:n,key:r,className:a,title:e,style:i,dataset:o,...s},this.renderIcon(t),this.renderLabel(t),this.renderCloseIcon(t)):J.li({id:n,key:r,className:a,title:e,style:i,dataset:o,...s},this.renderIcon(t),this.renderLabel(t))}renderIcon(t){let{title:e}=t,r=this.createIconClass(t);return J.div({className:r},e.icon,e.iconLabel)}renderLabel(t){return J.div({className:"lm-TabBar-tabLabel"},t.title.label)}renderCloseIcon(t){return J.div({className:"lm-TabBar-tabCloseIcon"})}createTabKey(t){let e=this._tabKeys.get(t.title);return void 0===e&&(e=`tab-key-${this._uuid}-${this._tabID++}`,this._tabKeys.set(t.title,e)),e}createTabStyle(t){return{zIndex:`${t.zIndex}`}}createTabClass(t){let e="lm-TabBar-tab";return t.title.className&&(e+=` ${t.title.className}`),t.title.closable&&(e+=" lm-mod-closable"),t.current&&(e+=" lm-mod-current"),e}createTabDataset(t){return t.title.dataset}createTabARIA(t){var e;return{role:"tab","aria-selected":t.current.toString(),tabindex:`${null!==(e=t.tabIndex)&&void 0!==e?e:"-1"}`}}createIconClass(t){let e="lm-TabBar-tabIcon",r=t.title.iconClass;return r?`${e} ${r}`:e}}e._nInstance=0,t.Renderer=e,t.defaultRenderer=new e,t.addButtonSelector=".lm-TabBar-addButton"}(Lt||(Lt={})),function(t){t.DRAG_THRESHOLD=5,t.DETACH_THRESHOLD=20,t.createNode=function(){let t=document.createElement("div"),e=document.createElement("ul");e.setAttribute("role","tablist"),e.className="lm-TabBar-content",t.appendChild(e);let r=document.createElement("div");return r.className="lm-TabBar-addButton lm-mod-hidden",r.setAttribute("tabindex","-1"),r.setAttribute("role","button"),t.appendChild(r),t},t.asTitle=function(t){return t instanceof rt?t:new rt(t)},t.parseTransitionDuration=function(t){let e=window.getComputedStyle(t);return 1e3*(parseFloat(e.transitionDuration)||0)},t.snapTabLayout=function(t,e){let r=new Array(t.length);for(let n=0,i=t.length;n=t.DRAG_THRESHOLD||i>=t.DRAG_THRESHOLD},t.detachExceeded=function(e,r){let n=e.contentRect;return r.clientX=n.right+t.DETACH_THRESHOLD||r.clientY=n.bottom+t.DETACH_THRESHOLD},t.layoutTabs=function(t,e,r,n){let i,a,o,s;"horizontal"===n?(i=e.pressX,a=r.clientX-e.contentRect.left,o=r.clientX,s=e.contentRect.width):(i=e.pressY,a=r.clientY-e.contentRect.top,o=r.clientY,s=e.contentRect.height);let l=e.index,c=a-e.tabPressPos,u=c+e.tabSize;for(let r=0,a=t.length;r>1);if(re.index&&u>p)a=-e.tabSize-h.margin+"px",l=Math.max(l,r);else if(r===e.index){let t=o-i,r=s-(e.tabPos+e.tabSize);a=`${Math.max(-e.tabPos,Math.min(t,r))}px`}else a="";"horizontal"===n?t[r].style.left=a:t[r].style.top=a}e.targetIndex=l},t.finalizeTabPosition=function(t,e){let r,n;if(r="horizontal"===e?t.contentRect.width:t.contentRect.height,t.targetIndex===t.index)n=0;else if(t.targetIndex>t.index){let e=t.tabLayout[t.targetIndex];n=e.pos+e.size-t.tabSize-t.tabPos}else n=t.tabLayout[t.targetIndex].pos-t.tabPos;let i=r-(t.tabPos+t.tabSize),a=Math.max(-t.tabPos,Math.min(n,i));"horizontal"===e?t.tab.style.left=`${a}px`:t.tab.style.top=`${a}px`},t.resetTabPositions=function(t,e){for(let r of t)"horizontal"===e?r.style.left="":r.style.top=""}}(Ct||(Ct={}));var Pt,zt=class extends it{constructor(t){super(),this._spacing=4,this._dirty=!1,this._root=null,this._box=null,this._items=new Map,this.renderer=t.renderer,void 0!==t.spacing&&(this._spacing=ut.clampDimension(t.spacing)),this._document=t.document||document,this._hiddenMode=void 0!==t.hiddenMode?t.hiddenMode:nt.HiddenMode.Display}dispose(){let t=this[Symbol.iterator]();this._items.forEach((t=>{t.dispose()})),this._box=null,this._root=null,this._items.clear();for(let e of t)e.dispose();super.dispose()}get hiddenMode(){return this._hiddenMode}set hiddenMode(t){if(this._hiddenMode!==t){this._hiddenMode=t;for(let t of this.tabBars())if(t.titles.length>1)for(let e of t.titles)e.owner.hiddenMode=this._hiddenMode}}get spacing(){return this._spacing}set spacing(t){t=ut.clampDimension(t),this._spacing!==t&&(this._spacing=t,this.parent&&this.parent.fit())}get isEmpty(){return null===this._root}[Symbol.iterator](){return this._root?this._root.iterAllWidgets():(0,b.empty)()}widgets(){return this._root?this._root.iterUserWidgets():(0,b.empty)()}selectedWidgets(){return this._root?this._root.iterSelectedWidgets():(0,b.empty)()}tabBars(){return this._root?this._root.iterTabBars():(0,b.empty)()}handles(){return this._root?this._root.iterHandles():(0,b.empty)()}moveHandle(t,e,r){let n=t.classList.contains("lm-mod-hidden");if(!this._root||n)return;let i,a=this._root.findSplitNode(t);a&&(i="horizontal"===a.node.orientation?e-t.offsetLeft:r-t.offsetTop,0!==i&&(a.node.holdSizes(),Q.adjust(a.node.sizers,a.index,i),this.parent&&this.parent.update()))}saveLayout(){return this._root?(this._root.holdAllSizes(),{main:this._root.createConfig()}):{main:null}}restoreLayout(t){let e,r=new Set;e=t.main?Pt.normalizeAreaConfig(t.main,r):null;let n=this.widgets(),i=this.tabBars(),a=this.handles();this._root=null;for(let t of n)r.has(t)||(t.parent=null);for(let t of i)t.dispose();for(let t of a)t.parentNode&&t.parentNode.removeChild(t);for(let t of r)t.parent=this.parent;this._root=e?Pt.realizeAreaConfig(e,{createTabBar:t=>this._createTabBar(),createHandle:()=>this._createHandle()},this._document):null,this.parent&&(r.forEach((t=>{this.attachWidget(t)})),this.parent.fit())}addWidget(t,e={}){let r=e.ref||null,n=e.mode||"tab-after",i=null;if(this._root&&r&&(i=this._root.findTabNode(r)),r&&!i)throw new Error("Reference widget is not in the layout.");switch(t.parent=this.parent,n){case"tab-after":this._insertTab(t,r,i,!0);break;case"tab-before":this._insertTab(t,r,i,!1);break;case"split-top":this._insertSplit(t,r,i,"vertical",!1);break;case"split-left":this._insertSplit(t,r,i,"horizontal",!1);break;case"split-right":this._insertSplit(t,r,i,"horizontal",!0);break;case"split-bottom":this._insertSplit(t,r,i,"vertical",!0);break;case"merge-top":this._insertSplit(t,r,i,"vertical",!1,!0);break;case"merge-left":this._insertSplit(t,r,i,"horizontal",!1,!0);break;case"merge-right":this._insertSplit(t,r,i,"horizontal",!0,!0);break;case"merge-bottom":this._insertSplit(t,r,i,"vertical",!0,!0)}this.parent&&(this.attachWidget(t),this.parent.fit())}removeWidget(t){this._removeWidget(t),this.parent&&(this.detachWidget(t),this.parent.fit())}hitTestTabAreas(t,e){if(!this._root||!this.parent||!this.parent.isVisible)return null;this._box||(this._box=i.boxSizing(this.parent.node));let r=this.parent.node.getBoundingClientRect(),n=t-r.left-this._box.borderLeft,a=e-r.top-this._box.borderTop,o=this._root.hitTestTabNodes(n,a);if(!o)return null;let{tabBar:s,top:l,left:c,width:u,height:h}=o,p=this._box.borderLeft+this._box.borderRight,f=this._box.borderTop+this._box.borderBottom;return{tabBar:s,x:n,y:a,top:l,left:c,right:r.width-p-(c+u),bottom:r.height-f-(l+h),width:u,height:h}}init(){super.init();for(let t of this)this.attachWidget(t);for(let t of this.handles())this.parent.node.appendChild(t);this.parent.fit()}attachWidget(t){this.parent.node!==t.node.parentNode&&(this._items.set(t,new ot(t)),this.parent.isAttached&&M.sendMessage(t,nt.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.isAttached&&M.sendMessage(t,nt.Msg.AfterAttach))}detachWidget(t){if(this.parent.node!==t.node.parentNode)return;this.parent.isAttached&&M.sendMessage(t,nt.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&M.sendMessage(t,nt.Msg.AfterDetach);let e=this._items.get(t);e&&(this._items.delete(t),e.dispose())}onBeforeShow(t){super.onBeforeShow(t),this.parent.update()}onBeforeAttach(t){super.onBeforeAttach(t),this.parent.fit()}onChildShown(t){this.parent.fit()}onChildHidden(t){this.parent.fit()}onResize(t){this.parent.isVisible&&this._update(t.width,t.height)}onUpdateRequest(t){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(t){this.parent.isAttached&&this._fit()}_removeWidget(t){if(!this._root)return;let e=this._root.findTabNode(t);if(!e)return;if(Pt.removeAria(t),e.tabBar.titles.length>1)return e.tabBar.removeTab(t.title),void(this._hiddenMode===nt.HiddenMode.Scale&&1==e.tabBar.titles.length&&(e.tabBar.titles[0].owner.hiddenMode=nt.HiddenMode.Display));if(e.tabBar.dispose(),this._root===e)return void(this._root=null);this._root.holdAllSizes();let r=e.parent;e.parent=null;let n=b.ArrayExt.removeFirstOf(r.children,e),i=b.ArrayExt.removeAt(r.handles,n);if(b.ArrayExt.removeAt(r.sizers,n),i.parentNode&&i.parentNode.removeChild(i),r.children.length>1)return void r.syncHandles();let a=r.parent;r.parent=null;let o=r.children[0],s=r.handles[0];if(r.children.length=0,r.handles.length=0,r.sizers.length=0,s.parentNode&&s.parentNode.removeChild(s),this._root===r)return o.parent=null,void(this._root=o);let l=a,c=l.children.indexOf(r);if(o instanceof Pt.TabLayoutNode)return o.parent=l,void(l.children[c]=o);let u=b.ArrayExt.removeAt(l.handles,c);b.ArrayExt.removeAt(l.children,c),b.ArrayExt.removeAt(l.sizers,c),u.parentNode&&u.parentNode.removeChild(u);for(let t=0,e=o.children.length;t=r.length)&&(n=0),{type:"tab-area",widgets:r,currentIndex:n}}(e,r):function(e,r){let n=e.orientation,i=[],a=[];for(let o=0,s=e.children.length;o{let l=i(n,r,a),c=e(t.sizes[s]),u=r.createHandle();o.children.push(l),o.handles.push(u),o.sizers.push(c),l.parent=o})),o.syncHandles(),o.normalizeSizes(),o}(a,o,s),l};class r{constructor(t){this.parent=null,this._top=0,this._left=0,this._width=0,this._height=0;let e=new tt,r=new tt;e.stretch=0,r.stretch=1,this.tabBar=t,this.sizers=[e,r]}get top(){return this._top}get left(){return this._left}get width(){return this._width}get height(){return this._height}*iterAllWidgets(){yield this.tabBar,yield*this.iterUserWidgets()}*iterUserWidgets(){for(let t of this.tabBar.titles)yield t.owner}*iterSelectedWidgets(){let t=this.tabBar.currentTitle;t&&(yield t.owner)}*iterTabBars(){yield this.tabBar}*iterHandles(){}findTabNode(t){return-1!==this.tabBar.titles.indexOf(t.title)?this:null}findSplitNode(t){return null}findFirstTabNode(){return this}hitTestTabNodes(t,e){return t=this._left+this._width||e=this._top+this._height?null:this}createConfig(){return{type:"tab-area",widgets:this.tabBar.titles.map((t=>t.owner)),currentIndex:this.tabBar.currentIndex}}holdAllSizes(){}fit(t,e){let r=0,n=0,i=e.get(this.tabBar),a=this.tabBar.currentTitle,o=a?e.get(a.owner):void 0,[s,l]=this.sizers;return i&&i.fit(),o&&o.fit(),i&&!i.isHidden?(r=Math.max(r,i.minWidth),n+=i.minHeight,s.minSize=i.minHeight,s.maxSize=i.maxHeight):(s.minSize=0,s.maxSize=0),o&&!o.isHidden?(r=Math.max(r,o.minWidth),n+=o.minHeight,l.minSize=o.minHeight,l.maxSize=1/0):(l.minSize=0,l.maxSize=1/0),{minWidth:r,minHeight:n,maxWidth:1/0,maxHeight:1/0}}update(t,e,r,n,i,a){this._top=e,this._left=t,this._width=r,this._height=n;let o=a.get(this.tabBar),s=this.tabBar.currentTitle,l=s?a.get(s.owner):void 0;if(Q.calc(this.sizers,n),o&&!o.isHidden){let n=this.sizers[0].size;o.update(t,e,r,n),e+=n}if(l&&!l.isHidden){let n=this.sizers[1].size;l.update(t,e,r,n)}}}t.TabLayoutNode=r;class n{constructor(t){this.parent=null,this.normalized=!1,this.children=[],this.sizers=[],this.handles=[],this.orientation=t}*iterAllWidgets(){for(let t of this.children)yield*t.iterAllWidgets()}*iterUserWidgets(){for(let t of this.children)yield*t.iterUserWidgets()}*iterSelectedWidgets(){for(let t of this.children)yield*t.iterSelectedWidgets()}*iterTabBars(){for(let t of this.children)yield*t.iterTabBars()}*iterHandles(){yield*this.handles;for(let t of this.children)yield*t.iterHandles()}findTabNode(t){for(let e=0,r=this.children.length;et.createConfig())),sizes:e}}syncHandles(){this.handles.forEach(((t,e)=>{t.setAttribute("data-orientation",this.orientation),e===this.handles.length-1?t.classList.add("lm-mod-hidden"):t.classList.remove("lm-mod-hidden")}))}holdSizes(){for(let t of this.sizers)t.sizeHint=t.size}holdAllSizes(){for(let t of this.children)t.holdAllSizes();this.holdSizes()}normalizeSizes(){let t=this.sizers.length;if(0===t)return;this.holdSizes();let e=this.sizers.reduce(((t,e)=>t+e.sizeHint),0);if(0===e)for(let e of this.sizers)e.size=e.sizeHint=1/t;else for(let t of this.sizers)t.size=t.sizeHint/=e;this.normalized=!0}createNormalizedSizes(){let t=this.sizers.length;if(0===t)return[];let e=this.sizers.map((t=>t.size)),r=e.reduce(((t,e)=>t+e),0);if(0===r)for(let r=e.length-1;r>-1;r--)e[r]=1/t;else for(let t=e.length-1;t>-1;t--)e[t]/=r;return e}fit(t,e){let r="horizontal"===this.orientation,n=Math.max(0,this.children.length-1)*t,i=r?n:0,a=r?0:n;for(let n=0,o=this.children.length;nthis._createTabBar(),createHandle:()=>this._createHandle()};this.layout=new zt({document:this._document,renderer:r,spacing:e.spacing,hiddenMode:e.hiddenMode}),this.overlay=e.overlay||new t.Overlay,this.node.appendChild(this.overlay.node)}dispose(){this._releaseMouse(),this.overlay.hide(0),this._drag&&this._drag.dispose(),super.dispose()}get hiddenMode(){return this.layout.hiddenMode}set hiddenMode(t){this.layout.hiddenMode=t}get layoutModified(){return this._layoutModified}get addRequested(){return this._addRequested}get renderer(){return this.layout.renderer}get spacing(){return this.layout.spacing}set spacing(t){this.layout.spacing=t}get mode(){return this._mode}set mode(t){if(this._mode===t)return;this._mode=t,this.dataset.mode=t;let e=this.layout;switch(t){case"multiple-document":for(let t of e.tabBars())t.show();break;case"single-document":e.restoreLayout(Dt.createSingleDocumentConfig(this));break;default:throw"unreachable"}M.postMessage(this,Dt.LayoutModified)}get tabsMovable(){return this._tabsMovable}set tabsMovable(t){this._tabsMovable=t;for(let e of this.tabBars())e.tabsMovable=t}get tabsConstrained(){return this._tabsConstrained}set tabsConstrained(t){this._tabsConstrained=t}get addButtonEnabled(){return this._addButtonEnabled}set addButtonEnabled(t){this._addButtonEnabled=t;for(let e of this.tabBars())e.addButtonEnabled=t}get isEmpty(){return this.layout.isEmpty}*widgets(){yield*this.layout.widgets()}*selectedWidgets(){yield*this.layout.selectedWidgets()}*tabBars(){yield*this.layout.tabBars()}*handles(){yield*this.layout.handles()}selectWidget(t){let e=(0,b.find)(this.tabBars(),(e=>-1!==e.titles.indexOf(t.title)));if(!e)throw new Error("Widget is not contained in the dock panel.");e.currentTitle=t.title}activateWidget(t){this.selectWidget(t),t.activate()}saveLayout(){return this.layout.saveLayout()}restoreLayout(t){this._mode="multiple-document",this.layout.restoreLayout(t),(a.IS_EDGE||a.IS_IE)&&M.flush(),M.postMessage(this,Dt.LayoutModified)}addWidget(t,e={}){"single-document"===this._mode?this.layout.addWidget(t):this.layout.addWidget(t,e),M.postMessage(this,Dt.LayoutModified)}processMessage(t){"layout-modified"===t.type?this._layoutModified.emit(void 0):super.processMessage(t)}handleEvent(t){switch(t.type){case"lm-dragenter":this._evtDragEnter(t);break;case"lm-dragleave":this._evtDragLeave(t);break;case"lm-dragover":this._evtDragOver(t);break;case"lm-drop":this._evtDrop(t);break;case"pointerdown":this._evtPointerDown(t);break;case"pointermove":this._evtPointerMove(t);break;case"pointerup":this._evtPointerUp(t);break;case"keydown":this._evtKeyDown(t);break;case"contextmenu":t.preventDefault(),t.stopPropagation()}}onBeforeAttach(t){this.node.addEventListener("lm-dragenter",this),this.node.addEventListener("lm-dragleave",this),this.node.addEventListener("lm-dragover",this),this.node.addEventListener("lm-drop",this),this.node.addEventListener("pointerdown",this)}onAfterDetach(t){this.node.removeEventListener("lm-dragenter",this),this.node.removeEventListener("lm-dragleave",this),this.node.removeEventListener("lm-dragover",this),this.node.removeEventListener("lm-drop",this),this.node.removeEventListener("pointerdown",this),this._releaseMouse()}onChildAdded(t){Dt.isGeneratedTabBarProperty.get(t.child)||t.child.addClass("lm-DockPanel-widget")}onChildRemoved(t){Dt.isGeneratedTabBarProperty.get(t.child)||(t.child.removeClass("lm-DockPanel-widget"),M.postMessage(this,Dt.LayoutModified))}_evtDragEnter(t){t.mimeData.hasData("application/vnd.lumino.widget-factory")&&(t.preventDefault(),t.stopPropagation())}_evtDragLeave(t){t.preventDefault(),(!this._tabsConstrained||t.source===this)&&(t.stopPropagation(),this.overlay.hide(1))}_evtDragOver(t){t.preventDefault(),this._tabsConstrained&&t.source!==this||"invalid"===this._showOverlay(t.clientX,t.clientY)?t.dropAction="none":(t.stopPropagation(),t.dropAction=t.proposedAction)}_evtDrop(t){if(t.preventDefault(),this.overlay.hide(0),"none"===t.proposedAction)return void(t.dropAction="none");let{clientX:e,clientY:r}=t,{zone:n,target:i}=Dt.findDropTarget(this,e,r,this._edges);if(this._tabsConstrained&&t.source!==this||"invalid"===n)return void(t.dropAction="none");let a=t.mimeData.getData("application/vnd.lumino.widget-factory");if("function"!=typeof a)return void(t.dropAction="none");let o=a();if(!(o instanceof nt))return void(t.dropAction="none");if(o.contains(this))return void(t.dropAction="none");let s=i?Dt.getDropRef(i.tabBar):null;switch(n){case"root-all":this.addWidget(o);break;case"root-top":this.addWidget(o,{mode:"split-top"});break;case"root-left":this.addWidget(o,{mode:"split-left"});break;case"root-right":this.addWidget(o,{mode:"split-right"});break;case"root-bottom":this.addWidget(o,{mode:"split-bottom"});break;case"widget-all":case"widget-tab":this.addWidget(o,{mode:"tab-after",ref:s});break;case"widget-top":this.addWidget(o,{mode:"split-top",ref:s});break;case"widget-left":this.addWidget(o,{mode:"split-left",ref:s});break;case"widget-right":this.addWidget(o,{mode:"split-right",ref:s});break;case"widget-bottom":this.addWidget(o,{mode:"split-bottom",ref:s});break;default:throw"unreachable"}t.dropAction=t.proposedAction,t.stopPropagation(),this.activateWidget(o)}_evtKeyDown(t){t.preventDefault(),t.stopPropagation(),27===t.keyCode&&(this._releaseMouse(),M.postMessage(this,Dt.LayoutModified))}_evtPointerDown(t){if(0!==t.button)return;let e=this.layout,r=t.target,n=(0,b.find)(e.handles(),(t=>t.contains(r)));if(!n)return;t.preventDefault(),t.stopPropagation(),this._document.addEventListener("keydown",this,!0),this._document.addEventListener("pointerup",this,!0),this._document.addEventListener("pointermove",this,!0),this._document.addEventListener("contextmenu",this,!0);let i=n.getBoundingClientRect(),a=t.clientX-i.left,o=t.clientY-i.top,s=window.getComputedStyle(n),l=B.overrideCursor(s.cursor,this._document);this._pressData={handle:n,deltaX:a,deltaY:o,override:l}}_evtPointerMove(t){if(!this._pressData)return;t.preventDefault(),t.stopPropagation();let e=this.node.getBoundingClientRect(),r=t.clientX-e.left-this._pressData.deltaX,n=t.clientY-e.top-this._pressData.deltaY;this.layout.moveHandle(this._pressData.handle,r,n)}_evtPointerUp(t){0===t.button&&(t.preventDefault(),t.stopPropagation(),this._releaseMouse(),M.postMessage(this,Dt.LayoutModified))}_releaseMouse(){this._pressData&&(this._pressData.override.dispose(),this._pressData=null,this._document.removeEventListener("keydown",this,!0),this._document.removeEventListener("pointerup",this,!0),this._document.removeEventListener("pointermove",this,!0),this._document.removeEventListener("contextmenu",this,!0))}_showOverlay(t,e){let{zone:r,target:n}=Dt.findDropTarget(this,t,e,this._edges);if("invalid"===r)return this.overlay.hide(100),r;let a,o,s,l,c=i.boxSizing(this.node),u=this.node.getBoundingClientRect();switch(r){case"root-all":a=c.paddingTop,o=c.paddingLeft,s=c.paddingRight,l=c.paddingBottom;break;case"root-top":a=c.paddingTop,o=c.paddingLeft,s=c.paddingRight,l=u.height*Dt.GOLDEN_RATIO;break;case"root-left":a=c.paddingTop,o=c.paddingLeft,s=u.width*Dt.GOLDEN_RATIO,l=c.paddingBottom;break;case"root-right":a=c.paddingTop,o=u.width*Dt.GOLDEN_RATIO,s=c.paddingRight,l=c.paddingBottom;break;case"root-bottom":a=u.height*Dt.GOLDEN_RATIO,o=c.paddingLeft,s=c.paddingRight,l=c.paddingBottom;break;case"widget-all":a=n.top,o=n.left,s=n.right,l=n.bottom;break;case"widget-top":a=n.top,o=n.left,s=n.right,l=n.bottom+n.height/2;break;case"widget-left":a=n.top,o=n.left,s=n.right+n.width/2,l=n.bottom;break;case"widget-right":a=n.top,o=n.left+n.width/2,s=n.right,l=n.bottom;break;case"widget-bottom":a=n.top+n.height/2,o=n.left,s=n.right,l=n.bottom;break;case"widget-tab":{let t=n.tabBar.node.getBoundingClientRect().height;a=n.top,o=n.left,s=n.right,l=n.bottom+n.height-t;break}default:throw"unreachable"}return this.overlay.show({top:a,left:o,right:s,bottom:l}),r}_createTabBar(){let t=this._renderer.createTabBar(this._document);return Dt.isGeneratedTabBarProperty.set(t,!0),"single-document"===this._mode&&t.hide(),t.tabsMovable=this._tabsMovable,t.allowDeselect=!1,t.addButtonEnabled=this._addButtonEnabled,t.removeBehavior="select-previous-tab",t.insertBehavior="select-tab-if-needed",t.tabMoved.connect(this._onTabMoved,this),t.currentChanged.connect(this._onCurrentChanged,this),t.tabCloseRequested.connect(this._onTabCloseRequested,this),t.tabDetachRequested.connect(this._onTabDetachRequested,this),t.tabActivateRequested.connect(this._onTabActivateRequested,this),t.addRequested.connect(this._onTabAddRequested,this),t}_createHandle(){return this._renderer.createHandle()}_onTabMoved(){M.postMessage(this,Dt.LayoutModified)}_onCurrentChanged(t,e){let{previousTitle:r,currentTitle:n}=e;r&&r.owner.hide(),n&&n.owner.show(),(a.IS_EDGE||a.IS_IE)&&M.flush(),M.postMessage(this,Dt.LayoutModified)}_onTabAddRequested(t){this._addRequested.emit(t)}_onTabActivateRequested(t,e){e.title.owner.activate()}_onTabCloseRequested(t,e){e.title.owner.close()}_onTabDetachRequested(t,e){if(this._drag)return;t.releaseMouse();let{title:r,tab:n,clientX:i,clientY:a,offset:o}=e,s=new w.MimeData;s.setData("application/vnd.lumino.widget-factory",(()=>r.owner));let l=n.cloneNode(!0);o&&(l.style.top=`-${o.y}px`,l.style.left=`-${o.x}px`),this._drag=new B({document:this._document,mimeData:s,dragImage:l,proposedAction:"move",supportedActions:"move",source:this}),n.classList.add("lm-mod-hidden"),this._drag.start(i,a).then((()=>{this._drag=null,n.classList.remove("lm-mod-hidden")}))}};!function(t){t.Overlay=class{constructor(){this._timer=-1,this._hidden=!0,this.node=document.createElement("div"),this.node.classList.add("lm-DockPanel-overlay"),this.node.classList.add("lm-mod-hidden"),this.node.style.position="absolute",this.node.style.contain="strict"}show(t){let e=this.node.style;e.top=`${t.top}px`,e.left=`${t.left}px`,e.right=`${t.right}px`,e.bottom=`${t.bottom}px`,clearTimeout(this._timer),this._timer=-1,this._hidden&&(this._hidden=!1,this.node.classList.remove("lm-mod-hidden"))}hide(t){if(!this._hidden){if(t<=0)return clearTimeout(this._timer),this._timer=-1,this._hidden=!0,void this.node.classList.add("lm-mod-hidden");-1===this._timer&&(this._timer=window.setTimeout((()=>{this._timer=-1,this._hidden=!0,this.node.classList.add("lm-mod-hidden")}),t))}}};class e{createTabBar(t){let e=new Lt({document:t});return e.addClass("lm-DockPanel-tabBar"),e}createHandle(){let t=document.createElement("div");return t.className="lm-DockPanel-handle",t}}t.Renderer=e,t.defaultRenderer=new e}(Ot||(Ot={})),function(t){t.GOLDEN_RATIO=.618,t.DEFAULT_EDGES={top:12,right:40,bottom:40,left:40},t.LayoutModified=new E("layout-modified"),t.isGeneratedTabBarProperty=new I({name:"isGeneratedTabBar",create:()=>!1}),t.createSingleDocumentConfig=function(t){if(t.isEmpty)return{main:null};let e=Array.from(t.widgets()),r=t.selectedWidgets().next().value,n=r?e.indexOf(r):-1;return{main:{type:"tab-area",widgets:e,currentIndex:n}}},t.findDropTarget=function(t,e,r,n){if(!i.hitTest(t.node,e,r))return{zone:"invalid",target:null};let a=t.layout;if(a.isEmpty)return{zone:"root-all",target:null};if("multiple-document"===t.mode){let i=t.node.getBoundingClientRect(),a=e-i.left+1,o=r-i.top+1,s=i.right-e,l=i.bottom-r;switch(Math.min(o,s,l,a)){case o:if(op&&c>p&&l>f&&u>f)return{zone:"widget-all",target:o};switch(s/=p,l/=f,c/=p,u/=f,Math.min(s,l,c,u)){case s:h="widget-left";break;case l:h="widget-top";break;case c:h="widget-right";break;case u:h="widget-bottom";break;default:throw"unreachable"}return{zone:h,target:o}},t.getDropRef=function(t){return 0===t.titles.length?null:t.currentTitle?t.currentTitle.owner:t.titles[t.titles.length-1].owner}}(Dt||(Dt={}));var Rt,Ft=class t extends it{constructor(t={}){super(t),this._dirty=!1,this._rowSpacing=4,this._columnSpacing=4,this._items=[],this._rowStarts=[],this._columnStarts=[],this._rowSizers=[new tt],this._columnSizers=[new tt],this._box=null,void 0!==t.rowCount&&Rt.reallocSizers(this._rowSizers,t.rowCount),void 0!==t.columnCount&&Rt.reallocSizers(this._columnSizers,t.columnCount),void 0!==t.rowSpacing&&(this._rowSpacing=Rt.clampValue(t.rowSpacing)),void 0!==t.columnSpacing&&(this._columnSpacing=Rt.clampValue(t.columnSpacing))}dispose(){for(let t of this._items){let e=t.widget;t.dispose(),e.dispose()}this._box=null,this._items.length=0,this._rowStarts.length=0,this._rowSizers.length=0,this._columnStarts.length=0,this._columnSizers.length=0,super.dispose()}get rowCount(){return this._rowSizers.length}set rowCount(t){t!==this.rowCount&&(Rt.reallocSizers(this._rowSizers,t),this.parent&&this.parent.fit())}get columnCount(){return this._columnSizers.length}set columnCount(t){t!==this.columnCount&&(Rt.reallocSizers(this._columnSizers,t),this.parent&&this.parent.fit())}get rowSpacing(){return this._rowSpacing}set rowSpacing(t){t=Rt.clampValue(t),this._rowSpacing!==t&&(this._rowSpacing=t,this.parent&&this.parent.fit())}get columnSpacing(){return this._columnSpacing}set columnSpacing(t){t=Rt.clampValue(t),this._columnSpacing!==t&&(this._columnSpacing=t,this.parent&&this.parent.fit())}rowStretch(t){let e=this._rowSizers[t];return e?e.stretch:-1}setRowStretch(t,e){let r=this._rowSizers[t];r&&(e=Rt.clampValue(e),r.stretch!==e&&(r.stretch=e,this.parent&&this.parent.update()))}columnStretch(t){let e=this._columnSizers[t];return e?e.stretch:-1}setColumnStretch(t,e){let r=this._columnSizers[t];r&&(e=Rt.clampValue(e),r.stretch!==e&&(r.stretch=e,this.parent&&this.parent.update()))}*[Symbol.iterator](){for(let t of this._items)yield t.widget}addWidget(t){-1===b.ArrayExt.findFirstIndex(this._items,(e=>e.widget===t))&&(this._items.push(new ot(t)),this.parent&&this.attachWidget(t))}removeWidget(t){let e=b.ArrayExt.findFirstIndex(this._items,(e=>e.widget===t));if(-1===e)return;let r=b.ArrayExt.removeAt(this._items,e);this.parent&&this.detachWidget(t),r.dispose()}init(){super.init();for(let t of this)this.attachWidget(t)}attachWidget(t){this.parent.isAttached&&M.sendMessage(t,nt.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.isAttached&&M.sendMessage(t,nt.Msg.AfterAttach),this.parent.fit()}detachWidget(t){this.parent.isAttached&&M.sendMessage(t,nt.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&M.sendMessage(t,nt.Msg.AfterDetach),this.parent.fit()}onBeforeShow(t){super.onBeforeShow(t),this.parent.update()}onBeforeAttach(t){super.onBeforeAttach(t),this.parent.fit()}onChildShown(t){this.parent.fit()}onChildHidden(t){this.parent.fit()}onResize(t){this.parent.isVisible&&this._update(t.width,t.height)}onUpdateRequest(t){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(t){this.parent.isAttached&&this._fit()}_fit(){for(let t=0,e=this.rowCount;t!t.isHidden));for(let t=0,r=e.length;t({row:0,column:0,rowSpan:1,columnSpan:1}),changed:function(t){t.parent&&t.parent.layout instanceof Ft&&t.parent.fit()}}),t.normalizeConfig=function(t){return{row:Math.max(0,Math.floor(t.row||0)),column:Math.max(0,Math.floor(t.column||0)),rowSpan:Math.max(1,Math.floor(t.rowSpan||0)),columnSpan:Math.max(1,Math.floor(t.columnSpan||0))}},t.clampValue=function(t){return Math.max(0,Math.floor(t))},t.rowSpanCmp=function(e,r){let n=t.cellConfigProperty.get(e.widget),i=t.cellConfigProperty.get(r.widget);return n.rowSpan-i.rowSpan},t.columnSpanCmp=function(e,r){let n=t.cellConfigProperty.get(e.widget),i=t.cellConfigProperty.get(r.widget);return n.columnSpan-i.columnSpan},t.reallocSizers=function(t,e){for(e=Math.max(1,Math.floor(e));t.lengthe&&(t.length=e)},t.distributeMin=function(t,e,r,n){if(r=n)return;let a=(n-i)/(r-e+1);for(let n=e;n<=r;++n)t[n].minSize+=a}}(Rt||(Rt={}));var Bt,jt,Nt=class t extends nt{constructor(e={}){super({node:Bt.createNode()}),this._activeIndex=-1,this._tabFocusIndex=0,this._menus=[],this._childMenu=null,this._overflowMenu=null,this._menuItemSizes=[],this._overflowIndex=-1,this.addClass("lm-MenuBar"),this.setFlag(nt.Flag.DisallowLayout),this.renderer=e.renderer||t.defaultRenderer,this._forceItemsPosition=e.forceItemsPosition||{forceX:!0,forceY:!0},this._overflowMenuOptions=e.overflowMenuOptions||{isVisible:!0}}dispose(){this._closeChildMenu(),this._menus.length=0,super.dispose()}get childMenu(){return this._childMenu}get overflowIndex(){return this._overflowIndex}get overflowMenu(){return this._overflowMenu}get contentNode(){return this.node.getElementsByClassName("lm-MenuBar-content")[0]}get activeMenu(){return this._menus[this._activeIndex]||null}set activeMenu(t){this.activeIndex=t?this._menus.indexOf(t):-1}get activeIndex(){return this._activeIndex}set activeIndex(t){(t<0||t>=this._menus.length)&&(t=-1),t>-1&&0===this._menus[t].items.length&&(t=-1),this._activeIndex!==t&&(this._activeIndex=t,this.update())}get menus(){return this._menus}openActiveMenu(){-1!==this._activeIndex&&(this._openChildMenu(),this._childMenu&&(this._childMenu.activeIndex=-1,this._childMenu.activateNextItem()))}addMenu(t,e=!0){this.insertMenu(this._menus.length,t,e)}insertMenu(t,e,r=!0){this._closeChildMenu();let n=this._menus.indexOf(e),i=Math.max(0,Math.min(t,this._menus.length));if(-1===n)return b.ArrayExt.insert(this._menus,i,e),e.addClass("lm-MenuBar-menu"),e.aboutToClose.connect(this._onMenuAboutToClose,this),e.menuRequested.connect(this._onMenuMenuRequested,this),e.title.changed.connect(this._onTitleChanged,this),void(r&&this.update());i===this._menus.length&&i--,n!==i&&(b.ArrayExt.move(this._menus,n,i),r&&this.update())}removeMenu(t,e=!0){this.removeMenuAt(this._menus.indexOf(t),e)}removeMenuAt(t,e=!0){this._closeChildMenu();let r=b.ArrayExt.removeAt(this._menus,t);r&&(r.aboutToClose.disconnect(this._onMenuAboutToClose,this),r.menuRequested.disconnect(this._onMenuMenuRequested,this),r.title.changed.disconnect(this._onTitleChanged,this),r.removeClass("lm-MenuBar-menu"),e&&this.update())}clearMenus(){if(0!==this._menus.length){this._closeChildMenu();for(let t of this._menus)t.aboutToClose.disconnect(this._onMenuAboutToClose,this),t.menuRequested.disconnect(this._onMenuMenuRequested,this),t.title.changed.disconnect(this._onTitleChanged,this),t.removeClass("lm-MenuBar-menu");this._menus.length=0,this.update()}}handleEvent(t){switch(t.type){case"keydown":this._evtKeyDown(t);break;case"mousedown":this._evtMouseDown(t);break;case"mousemove":this._evtMouseMove(t);break;case"focusout":this._evtFocusOut(t);break;case"contextmenu":t.preventDefault(),t.stopPropagation()}}onBeforeAttach(t){this.node.addEventListener("keydown",this),this.node.addEventListener("mousedown",this),this.node.addEventListener("mousemove",this),this.node.addEventListener("focusout",this),this.node.addEventListener("contextmenu",this)}onAfterDetach(t){this.node.removeEventListener("keydown",this),this.node.removeEventListener("mousedown",this),this.node.removeEventListener("mousemove",this),this.node.removeEventListener("focusout",this),this.node.removeEventListener("contextmenu",this),this._closeChildMenu()}onActivateRequest(t){this.isAttached&&this._focusItemAt(0)}onResize(t){this.update(),super.onResize(t)}onUpdateRequest(t){var e;let r=this._menus,n=this.renderer,i=this._activeIndex,a=this._tabFocusIndex>=0&&this._tabFocusIndex-1?this._overflowIndex:r.length,s=0,l=!1;o=null!==this._overflowMenu?o-1:o;let c=new Array(o);for(let t=0;t{this._tabFocusIndex=t,this.activeIndex=t}}),s+=this._menuItemSizes[t],r[t].title.label===this._overflowMenuOptions.title&&(l=!0,o--);if(this._overflowMenuOptions.isVisible)if(this._overflowIndex>-1&&!l){if(null===this._overflowMenu){let t=null!==(e=this._overflowMenuOptions.title)&&void 0!==e?e:"...";this._overflowMenu=new Et({commands:new W}),this._overflowMenu.title.label=t,this._overflowMenu.title.mnemonic=0,this.addMenu(this._overflowMenu,!1)}for(let t=r.length-2;t>=o;t--){let e=this.menus[t];e.title.mnemonic=0,this._overflowMenu.insertItem(0,{type:"submenu",submenu:e}),this.removeMenu(e,!1)}c[o]=n.renderItem({title:this._overflowMenu.title,active:o===i&&0!==r[o].items.length,tabbable:o===a,disabled:0===r[o].items.length,onfocus:()=>{this._tabFocusIndex=o,this.activeIndex=o}}),o++}else if(null!==this._overflowMenu){let t=this._overflowMenu.items,e=this.node.offsetWidth,i=this._overflowMenu.items.length;for(let l=0;lthis._menuItemSizes[i]){let e=t[0].submenu;this._overflowMenu.removeItemAt(0),this.insertMenu(o,e,!1),c[o]=n.renderItem({title:e.title,active:!1,tabbable:o===a,disabled:0===r[o].items.length,onfocus:()=>{this._tabFocusIndex=o,this.activeIndex=o}}),o++}}0===this._overflowMenu.items.length&&(this.removeMenu(this._overflowMenu,!1),c.pop(),this._overflowMenu=null,this._overflowIndex=-1)}Z.render(c,this.contentNode),this._updateOverflowIndex()}_updateOverflowIndex(){if(!this._overflowMenuOptions.isVisible)return;let t=this.contentNode.childNodes,e=this.node.offsetWidth,r=0,n=-1,i=t.length;if(0==this._menuItemSizes.length)for(let a=0;ae&&-1===n&&(n=a)}else for(let t=0;te){n=t;break}this._overflowIndex=n}_evtKeyDown(t){let e=t.keyCode;if(9===e)return void(this.activeIndex=-1);if(t.preventDefault(),t.stopPropagation(),13===e||32===e||38===e||40===e){if(this.activeIndex=this._tabFocusIndex,this.activeIndex!==this._tabFocusIndex)return;return void this.openActiveMenu()}if(27===e)return this._closeChildMenu(),void this._focusItemAt(this.activeIndex);if(37===e||39===e){let t=37===e?-1:1,r=this._tabFocusIndex+t,n=this._menus.length;for(let e=0;ei.hitTest(e,t.clientX,t.clientY)));if(-1!==e){if(0===t.button)if(this._childMenu)this._closeChildMenu(),this.activeIndex=e;else{t.preventDefault();let r=this._positionForMenu(e);Et.saveWindowData(),this.activeIndex=e,this._openChildMenu(r)}}else this._closeChildMenu()}_evtMouseMove(t){let e=b.ArrayExt.findFirstIndex(this.contentNode.children,(e=>i.hitTest(e,t.clientX,t.clientY)));if(e===this._activeIndex||-1===e&&this._childMenu)return;let r=e>=0&&this._childMenu?this._positionForMenu(e):null;Et.saveWindowData(),this.activeIndex=e,r&&this._openChildMenu(r)}_positionForMenu(t){let e=this.contentNode.children[t],{left:r,bottom:n}=e.getBoundingClientRect();return{top:n,left:r}}_evtFocusOut(t){!this._childMenu&&!this.node.contains(t.relatedTarget)&&(this.activeIndex=-1)}_focusItemAt(t){let e=this.contentNode.childNodes[t];e&&e.focus()}_openChildMenu(t={}){let e=this.activeMenu;if(!e)return void this._closeChildMenu();let r=this._childMenu;if(r===e)return;this._childMenu=e,r?r.close():document.addEventListener("mousedown",this,!0),this._tabFocusIndex=this.activeIndex,M.sendMessage(this,nt.Msg.UpdateRequest);let{left:n,top:i}=t;(typeof n>"u"||typeof i>"u")&&({left:n,top:i}=this._positionForMenu(this._activeIndex)),r||this.addClass("lm-mod-active"),e.items.length>0&&e.open(n,i,this._forceItemsPosition)}_closeChildMenu(){if(!this._childMenu)return;this.removeClass("lm-mod-active"),document.removeEventListener("mousedown",this,!0);let t=this._childMenu;this._childMenu=null,t.close(),this.activeIndex=-1}_onMenuAboutToClose(t){t===this._childMenu&&(this.removeClass("lm-mod-active"),document.removeEventListener("mousedown",this,!0),this._childMenu=null,this.activeIndex=-1)}_onMenuMenuRequested(t,e){if(t!==this._childMenu)return;let r=this._activeIndex,n=this._menus.length;switch(e){case"next":this.activeIndex=r===n-1?0:r+1;break;case"previous":this.activeIndex=0===r?n-1:r-1}this.openActiveMenu()}_onTitleChanged(){this.update()}};!function(t){class e{renderItem(t){let e=this.createItemClass(t),r=this.createItemDataset(t),n=this.createItemARIA(t);return J.li({className:e,dataset:r,...t.disabled?{}:{tabindex:t.tabbable?"0":"-1"},onfocus:t.onfocus,...n},this.renderIcon(t),this.renderLabel(t))}renderIcon(t){let e=this.createIconClass(t);return J.div({className:e},t.title.icon,t.title.iconLabel)}renderLabel(t){let e=this.formatLabel(t);return J.div({className:"lm-MenuBar-itemLabel"},e)}createItemClass(t){let e="lm-MenuBar-item";return t.title.className&&(e+=` ${t.title.className}`),t.active&&!t.disabled&&(e+=" lm-mod-active"),e}createItemDataset(t){return t.title.dataset}createItemARIA(t){return{role:"menuitem","aria-haspopup":"true","aria-disabled":t.disabled?"true":"false"}}createIconClass(t){let e="lm-MenuBar-itemIcon",r=t.title.iconClass;return r?`${e} ${r}`:e}formatLabel(t){let{label:e,mnemonic:r}=t.title;if(r<0||r>=e.length)return e;let n=e.slice(0,r),i=e.slice(r+1),a=e[r];return[n,J.span({className:"lm-MenuBar-itemMnemonic"},a),i]}}t.Renderer=e,t.defaultRenderer=new e}(Nt||(Nt={})),function(t){t.createNode=function(){let t=document.createElement("div"),e=document.createElement("ul");return e.className="lm-MenuBar-content",t.appendChild(e),e.setAttribute("role","menubar"),t},t.findMnemonic=function(t,e,r){let n=-1,i=-1,a=!1,o=e.toUpperCase();for(let e=0,s=t.length;e=0&&u1&&this.widgets.forEach((t=>{t.hiddenMode=this._hiddenMode})))}dispose(){for(let t of this._items)t.dispose();this._box=null,this._items.length=0,super.dispose()}attachWidget(t,e){this._hiddenMode===nt.HiddenMode.Scale&&this._items.length>0?(1===this._items.length&&(this.widgets[0].hiddenMode=nt.HiddenMode.Scale),e.hiddenMode=nt.HiddenMode.Scale):e.hiddenMode=nt.HiddenMode.Display,b.ArrayExt.insert(this._items,t,new ot(e)),this.parent.isAttached&&M.sendMessage(e,nt.Msg.BeforeAttach),this.parent.node.appendChild(e.node),this.parent.isAttached&&M.sendMessage(e,nt.Msg.AfterAttach),this.parent.fit()}moveWidget(t,e,r){b.ArrayExt.move(this._items,t,e),this.parent.update()}detachWidget(t,e){let r=b.ArrayExt.removeAt(this._items,t);this.parent.isAttached&&M.sendMessage(e,nt.Msg.BeforeDetach),this.parent.node.removeChild(e.node),this.parent.isAttached&&M.sendMessage(e,nt.Msg.AfterDetach),r.widget.node.style.zIndex="",this._hiddenMode===nt.HiddenMode.Scale&&(e.hiddenMode=nt.HiddenMode.Display,1===this._items.length&&(this._items[0].widget.hiddenMode=nt.HiddenMode.Display)),r.dispose(),this.parent.fit()}onBeforeShow(t){super.onBeforeShow(t),this.parent.update()}onBeforeAttach(t){super.onBeforeAttach(t),this.parent.fit()}onChildShown(t){this.parent.fit()}onChildHidden(t){this.parent.fit()}onResize(t){this.parent.isVisible&&this._update(t.width,t.height)}onUpdateRequest(t){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(t){this.parent.isAttached&&this._fit()}_fit(){let t=0,e=0;for(let r=0,n=this._items.length;r{this.createGraph(this._model)}))}renderModel(t){if(this.hasGraphElement())return Promise.resolve();this._model=t;let e=t.data["image/png"];return null!=e?(this.updateImage(e),Promise.resolve()):this.createGraph(t)}hasGraphElement(){return null!==this.node.querySelector(".plot-container")}updateImage(t){this.hideGraph(),this._img_el.src="data:image/png;base64,"+t,this.showImage()}hideGraph(){let t=this.node.querySelector(".plot-container");null!=t&&(t.style.display="none")}showGraph(){let t=this.node.querySelector(".plot-container");null!=t&&(t.style.display="block")}hideImage(){let t=this.node.querySelector(".plot-img");null!=t&&(t.style.display="none")}showImage(){let t=this.node.querySelector(".plot-img");null!=t&&(t.style.display="block")}createGraph(e){let{data:r,layout:n,frames:i,config:a}=e.data[this._mimeType];return n.height||(n.height=360),(async()=>(null===t.Plotly&&(t.Plotly=await Promise.resolve().then((()=>y(_()))),t._resolveLoadingPlotly()),t.loadingPlotly))().then((()=>t.Plotly.react(this.node,r,n,a))).then((r=>{this.showGraph(),this.hideImage(),this.update(),i&&t.Plotly.addFrames(this.node,i),this.node.offsetWidth>0&&this.node.offsetHeight>0&&t.Plotly.toImage(r,{format:"png",width:this.node.offsetWidth,height:this.node.offsetHeight}).then((t=>{let r=t.split(",")[1];e.data["image/png"]!==r&&e.setData({data:{...e.data,"image/png":r}})})),this.node.on("plotly_webglcontextlost",(()=>{let t=e.data["image/png"];if(null!=t)return this.updateImage(t),Promise.resolve()}))}))}onAfterShow(t){this.update()}onResize(t){this.update()}onUpdateRequest(e){t.Plotly&&this.isVisible&&this.hasGraphElement()&&t.Plotly.redraw(this.node).then((()=>{t.Plotly.Plots.resize(this.node)}))}static{this.Plotly=null}static{this.loadingPlotly=new Promise((e=>{t._resolveLoadingPlotly=e}))}},Wt={safe:!0,mimeTypes:[Ht],createRenderer:t=>new Gt(t)},Zt=[{id:"@jupyterlab/plotly-extension:factory",rendererFactory:Wt,rank:2,dataType:"json",fileTypes:[{name:"plotly",mimeTypes:[Ht],extensions:[".plotly",".plotly.json"],iconClass:"jp-MaterialIcon jp-PlotlyIcon"}],documentWidgetFactoryOptions:{name:"Plotly",primaryFileType:"plotly",fileTypes:["plotly","json"],defaultFor:["plotly"]}}]},606:t=>{var e,r,n=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function o(t){if(e===setTimeout)return setTimeout(t,0);if((e===i||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch(r){try{return e.call(null,t,0)}catch(r){return e.call(this,t,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:i}catch(t){e=i}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(t){r=a}}();var s,l=[],c=!1,u=-1;function h(){c&&s&&(c=!1,s.length?l=s.concat(l):u=-1,l.length&&p())}function p(){if(!c){var t=o(h);c=!0;for(var e=l.length;e;){for(s=l,l=[];++u1)for(var r=1;r{"use strict";var e,r,t={987:(e,r,t)=>{var o={"./index":()=>t.e(340).then((()=>()=>t(340))),"./mimeExtension":()=>t.e(340).then((()=>()=>t(340)))},a=(e,r)=>(t.R=r,r=t.o(o,e)?o[e]():Promise.resolve().then((()=>{throw new Error('Module "'+e+'" does not exist in container.')})),t.R=void 0,r),n=(e,r)=>{if(t.S){var o="default",a=t.S[o];if(a&&a!==e)throw new Error("Container initialization failed as it has already been initialized with a different share scope");return t.S[o]=e,t.I(o,r)}};t.d(r,{get:()=>a,init:()=>n})}},o={};function a(e){var r=o[e];if(void 0!==r)return r.exports;var n=o[e]={exports:{}};return t[e](n,n.exports,a),n.exports}a.m=t,a.c=o,a.amdO={},a.d=(e,r)=>{for(var t in r)a.o(r,t)&&!a.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},a.f={},a.e=e=>Promise.all(Object.keys(a.f).reduce(((r,t)=>(a.f[t](e,r),r)),[])),a.u=e=>e+".2a23c8275d47a2531dae.js?v=2a23c8275d47a2531dae",a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},r="jupyterlab-plotly:",a.l=(t,o,n,i)=>{if(e[t])e[t].push(o);else{var l,u;if(void 0!==n)for(var d=document.getElementsByTagName("script"),p=0;p{l.onerror=l.onload=null,clearTimeout(f);var a=e[t];if(delete e[t],l.parentNode&&l.parentNode.removeChild(l),a&&a.forEach((e=>e(o))),r)return r(o)},f=setTimeout(c.bind(null,void 0,{type:"timeout",target:l}),12e4);l.onerror=c.bind(null,l.onerror),l.onload=c.bind(null,l.onload),u&&document.head.appendChild(l)}},a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{a.S={};var e={},r={};a.I=(t,o)=>{o||(o=[]);var n=r[t];if(n||(n=r[t]={}),!(o.indexOf(n)>=0)){if(o.push(n),e[t])return e[t];a.o(a.S,t)||(a.S[t]={});var i=a.S[t],l="jupyterlab-plotly",u=[];return"default"===t&&((e,r,t,o)=>{var n=i[e]=i[e]||{},u=n[r];(!u||!u.loaded&&(1!=!u.eager?o:l>u.from))&&(n[r]={get:()=>a.e(340).then((()=>()=>a(340))),from:l,eager:!1})})("jupyterlab-plotly","6.0.1"),e[t]=u.length?Promise.all(u).then((()=>e[t]=1)):1}}})(),(()=>{var e;a.g.importScripts&&(e=a.g.location+"");var r=a.g.document;if(!e&&r&&(r.currentScript&&"SCRIPT"===r.currentScript.tagName.toUpperCase()&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName("script");if(t.length)for(var o=t.length-1;o>-1&&(!e||!/^http(s?):/.test(e));)e=t[o--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=e})(),(()=>{var e={80:0};a.f.j=(r,t)=>{var o=a.o(e,r)?e[r]:void 0;if(0!==o)if(o)t.push(o[2]);else{var n=new Promise(((t,a)=>o=e[r]=[t,a]));t.push(o[2]=n);var i=a.p+a.u(r),l=new Error;a.l(i,(t=>{if(a.o(e,r)&&(0!==(o=e[r])&&(e[r]=void 0),o)){var n=t&&("load"===t.type?"missing":t.type),i=t&&t.target&&t.target.src;l.message="Loading chunk "+r+" failed.\n("+n+": "+i+")",l.name="ChunkLoadError",l.type=n,l.request=i,o[1](l)}}),"chunk-"+r,r)}};var r=(r,t)=>{var o,n,[i,l,u]=t,d=0;if(i.some((r=>0!==e[r]))){for(o in l)a.o(l,o)&&(a.m[o]=l[o]);u&&u(a)}for(r&&r(t);d{t.d(o,{Z:()=>c});var e=t(81),i=t.n(e),n=t(645),l=t.n(n)()(i());l.push([r.id,"\n/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n/* This file was auto-generated by generate_css.py in jupyterlab_pygments */\n\n.highlight .hll { background-color: var(--jp-cell-editor-active-background) }\n.highlight { background: var(--jp-cell-editor-background); color: var(--jp-mirror-editor-variable-color) }\n.highlight .c { color: var(--jp-mirror-editor-comment-color); font-style: italic } /* Comment */\n.highlight .err { color: var(--jp-mirror-editor-error-color) } /* Error */\n.highlight .k { color: var(--jp-mirror-editor-keyword-color); font-weight: bold } /* Keyword */\n.highlight .o { color: var(--jp-mirror-editor-operator-color); font-weight: bold } /* Operator */\n.highlight .p { color: var(--jp-mirror-editor-punctuation-color) } /* Punctuation */\n.highlight .ch { color: var(--jp-mirror-editor-comment-color); font-style: italic } /* Comment.Hashbang */\n.highlight .cm { color: var(--jp-mirror-editor-comment-color); font-style: italic } /* Comment.Multiline */\n.highlight .cp { color: var(--jp-mirror-editor-comment-color); font-style: italic } /* Comment.Preproc */\n.highlight .cpf { color: var(--jp-mirror-editor-comment-color); font-style: italic } /* Comment.PreprocFile */\n.highlight .c1 { color: var(--jp-mirror-editor-comment-color); font-style: italic } /* Comment.Single */\n.highlight .cs { color: var(--jp-mirror-editor-comment-color); font-style: italic } /* Comment.Special */\n.highlight .kc { color: var(--jp-mirror-editor-keyword-color); font-weight: bold } /* Keyword.Constant */\n.highlight .kd { color: var(--jp-mirror-editor-keyword-color); font-weight: bold } /* Keyword.Declaration */\n.highlight .kn { color: var(--jp-mirror-editor-keyword-color); font-weight: bold } /* Keyword.Namespace */\n.highlight .kp { color: var(--jp-mirror-editor-keyword-color); font-weight: bold } /* Keyword.Pseudo */\n.highlight .kr { color: var(--jp-mirror-editor-keyword-color); font-weight: bold } /* Keyword.Reserved */\n.highlight .kt { color: var(--jp-mirror-editor-keyword-color); font-weight: bold } /* Keyword.Type */\n.highlight .m { color: var(--jp-mirror-editor-number-color) } /* Literal.Number */\n.highlight .s { color: var(--jp-mirror-editor-string-color) } /* Literal.String */\n.highlight .ow { color: var(--jp-mirror-editor-operator-color); font-weight: bold } /* Operator.Word */\n.highlight .pm { color: var(--jp-mirror-editor-punctuation-color) } /* Punctuation.Marker */\n.highlight .w { color: var(--jp-mirror-editor-variable-color) } /* Text.Whitespace */\n.highlight .mb { color: var(--jp-mirror-editor-number-color) } /* Literal.Number.Bin */\n.highlight .mf { color: var(--jp-mirror-editor-number-color) } /* Literal.Number.Float */\n.highlight .mh { color: var(--jp-mirror-editor-number-color) } /* Literal.Number.Hex */\n.highlight .mi { color: var(--jp-mirror-editor-number-color) } /* Literal.Number.Integer */\n.highlight .mo { color: var(--jp-mirror-editor-number-color) } /* Literal.Number.Oct */\n.highlight .sa { color: var(--jp-mirror-editor-string-color) } /* Literal.String.Affix */\n.highlight .sb { color: var(--jp-mirror-editor-string-color) } /* Literal.String.Backtick */\n.highlight .sc { color: var(--jp-mirror-editor-string-color) } /* Literal.String.Char */\n.highlight .dl { color: var(--jp-mirror-editor-string-color) } /* Literal.String.Delimiter */\n.highlight .sd { color: var(--jp-mirror-editor-string-color) } /* Literal.String.Doc */\n.highlight .s2 { color: var(--jp-mirror-editor-string-color) } /* Literal.String.Double */\n.highlight .se { color: var(--jp-mirror-editor-string-color) } /* Literal.String.Escape */\n.highlight .sh { color: var(--jp-mirror-editor-string-color) } /* Literal.String.Heredoc */\n.highlight .si { color: var(--jp-mirror-editor-string-color) } /* Literal.String.Interpol */\n.highlight .sx { color: var(--jp-mirror-editor-string-color) } /* Literal.String.Other */\n.highlight .sr { color: var(--jp-mirror-editor-string-color) } /* Literal.String.Regex */\n.highlight .s1 { color: var(--jp-mirror-editor-string-color) } /* Literal.String.Single */\n.highlight .ss { color: var(--jp-mirror-editor-string-color) } /* Literal.String.Symbol */\n.highlight .il { color: var(--jp-mirror-editor-number-color) } /* Literal.Number.Integer.Long */",""]);const c=l},645:r=>{r.exports=function(r){var o=[];return o.toString=function(){return this.map((function(o){var t="",e=void 0!==o[5];return o[4]&&(t+="@supports (".concat(o[4],") {")),o[2]&&(t+="@media ".concat(o[2]," {")),e&&(t+="@layer".concat(o[5].length>0?" ".concat(o[5]):""," {")),t+=r(o),e&&(t+="}"),o[2]&&(t+="}"),o[4]&&(t+="}"),t})).join("")},o.i=function(r,t,e,i,n){"string"==typeof r&&(r=[[null,r,void 0]]);var l={};if(e)for(var c=0;c0?" ".concat(g[5]):""," {").concat(g[1],"}")),g[5]=n),t&&(g[2]?(g[1]="@media ".concat(g[2]," {").concat(g[1],"}"),g[2]=t):g[2]=t),i&&(g[4]?(g[1]="@supports (".concat(g[4],") {").concat(g[1],"}"),g[4]=i):g[4]="".concat(i)),o.push(g))}},o}},81:r=>{r.exports=function(r){return r[1]}},379:r=>{var o=[];function t(r){for(var t=-1,e=0;e{var o={};r.exports=function(r,t){var e=function(r){if(void 0===o[r]){var t=document.querySelector(r);if(window.HTMLIFrameElement&&t instanceof window.HTMLIFrameElement)try{t=t.contentDocument.head}catch(r){t=null}o[r]=t}return o[r]}(r);if(!e)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");e.appendChild(t)}},216:r=>{r.exports=function(r){var o=document.createElement("style");return r.setAttributes(o,r.attributes),r.insert(o,r.options),o}},565:(r,o,t)=>{r.exports=function(r){var o=t.nc;o&&r.setAttribute("nonce",o)}},795:r=>{r.exports=function(r){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var o=r.insertStyleElement(r);return{update:function(t){!function(r,o,t){var e="";t.supports&&(e+="@supports (".concat(t.supports,") {")),t.media&&(e+="@media ".concat(t.media," {"));var i=void 0!==t.layer;i&&(e+="@layer".concat(t.layer.length>0?" ".concat(t.layer):""," {")),e+=t.css,i&&(e+="}"),t.media&&(e+="}"),t.supports&&(e+="}");var n=t.sourceMap;n&&"undefined"!=typeof btoa&&(e+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(n))))," */")),o.styleTagTransform(e,r,o.options)}(o,r,t)},remove:function(){!function(r){if(null===r.parentNode)return!1;r.parentNode.removeChild(r)}(o)}}}},589:r=>{r.exports=function(r,o){if(o.styleSheet)o.styleSheet.cssText=r;else{for(;o.firstChild;)o.removeChild(o.firstChild);o.appendChild(document.createTextNode(r))}}},747:(r,o,t)=>{t.r(o);var e=t(379),i=t.n(e),n=t(795),l=t.n(n),c=t(569),a=t.n(c),h=t(565),g=t.n(h),s=t(216),d=t.n(s),p=t(589),m=t.n(p),u=t(150),v={};v.styleTagTransform=m(),v.setAttributes=g(),v.insert=a().bind(null,"head"),v.domAPI=l(),v.insertStyleElement=d(),i()(u.Z,v),u.Z&&u.Z.locals&&u.Z.locals}}]); \ No newline at end of file diff --git a/emissary-ml/llm-scripts/fine-tuning/llama3/venv/share/jupyter/labextensions/jupyterlab_pygments/static/remoteEntry.5cbb9d2323598fbda535.js b/emissary-ml/llm-scripts/fine-tuning/llama3/venv/share/jupyter/labextensions/jupyterlab_pygments/static/remoteEntry.5cbb9d2323598fbda535.js new file mode 100644 index 0000000000000000000000000000000000000000..a3e013e59faf325a4acc7a37430f90aa566486b6 --- /dev/null +++ b/emissary-ml/llm-scripts/fine-tuning/llama3/venv/share/jupyter/labextensions/jupyterlab_pygments/static/remoteEntry.5cbb9d2323598fbda535.js @@ -0,0 +1 @@ +var _JUPYTERLAB;(()=>{"use strict";var e,r,t={741:(e,r,t)=>{var n={"./index":()=>t.e(568).then((()=>()=>t(568))),"./extension":()=>t.e(568).then((()=>()=>t(568))),"./style":()=>t.e(747).then((()=>()=>t(747)))},a=(e,r)=>(t.R=r,r=t.o(n,e)?n[e]():Promise.resolve().then((()=>{throw new Error('Module "'+e+'" does not exist in container.')})),t.R=void 0,r),o=(e,r)=>{if(t.S){var n="default",a=t.S[n];if(a&&a!==e)throw new Error("Container initialization failed as it has already been initialized with a different share scope");return t.S[n]=e,t.I(n,r)}};t.d(r,{get:()=>a,init:()=>o})}},n={};function a(e){var r=n[e];if(void 0!==r)return r.exports;var o=n[e]={id:e,exports:{}};return t[e](o,o.exports,a),o.exports}a.m=t,a.c=n,a.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return a.d(r,{a:r}),r},a.d=(e,r)=>{for(var t in r)a.o(r,t)&&!a.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},a.f={},a.e=e=>Promise.all(Object.keys(a.f).reduce(((r,t)=>(a.f[t](e,r),r)),[])),a.u=e=>e+"."+{568:"1e2faa2ba0bbe59c4780",747:"67662283a5707eeb4d4c"}[e]+".js?v="+{568:"1e2faa2ba0bbe59c4780",747:"67662283a5707eeb4d4c"}[e],a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},r="jupyterlab_pygments:",a.l=(t,n,o,i)=>{if(e[t])e[t].push(n);else{var l,u;if(void 0!==o)for(var s=document.getElementsByTagName("script"),d=0;d{l.onerror=l.onload=null,clearTimeout(f);var a=e[t];if(delete e[t],l.parentNode&&l.parentNode.removeChild(l),a&&a.forEach((e=>e(n))),r)return r(n)},f=setTimeout(p.bind(null,void 0,{type:"timeout",target:l}),12e4);l.onerror=p.bind(null,l.onerror),l.onload=p.bind(null,l.onload),u&&document.head.appendChild(l)}},a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{a.S={};var e={},r={};a.I=(t,n)=>{n||(n=[]);var o=r[t];if(o||(o=r[t]={}),!(n.indexOf(o)>=0)){if(n.push(o),e[t])return e[t];a.o(a.S,t)||(a.S[t]={});var i=a.S[t],l="jupyterlab_pygments",u=[];return"default"===t&&((e,r,t,n)=>{var o=i[e]=i[e]||{},u=o[r];(!u||!u.loaded&&(1!=!u.eager?n:l>u.from))&&(o[r]={get:()=>a.e(568).then((()=>()=>a(568))),from:l,eager:!1})})("jupyterlab_pygments","0.3.0"),e[t]=u.length?Promise.all(u).then((()=>e[t]=1)):1}}})(),(()=>{var e;a.g.importScripts&&(e=a.g.location+"");var r=a.g.document;if(!e&&r&&(r.currentScript&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName("script");if(t.length)for(var n=t.length-1;n>-1&&!e;)e=t[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=e})(),(()=>{var e={761:0};a.f.j=(r,t)=>{var n=a.o(e,r)?e[r]:void 0;if(0!==n)if(n)t.push(n[2]);else{var o=new Promise(((t,a)=>n=e[r]=[t,a]));t.push(n[2]=o);var i=a.p+a.u(r),l=new Error;a.l(i,(t=>{if(a.o(e,r)&&(0!==(n=e[r])&&(e[r]=void 0),n)){var o=t&&("load"===t.type?"missing":t.type),i=t&&t.target&&t.target.src;l.message="Loading chunk "+r+" failed.\n("+o+": "+i+")",l.name="ChunkLoadError",l.type=o,l.request=i,n[1](l)}}),"chunk-"+r,r)}};var r=(r,t)=>{var n,o,[i,l,u]=t,s=0;if(i.some((r=>0!==e[r]))){for(n in l)a.o(l,n)&&(a.m[n]=l[n]);u&&u(a)}for(r&&r(t);s 0 -%} + {% for tag in (cell.metadata.tags) -%} + {{ (' celltag_' ~ tag) | escape_html -}} + {%- endfor -%} + {%- endif %} +{%- endmacro %} diff --git a/emissary-ml/llm-scripts/fine-tuning/llama3/venv/share/jupyter/nbconvert/templates/basic/conf.json b/emissary-ml/llm-scripts/fine-tuning/llama3/venv/share/jupyter/nbconvert/templates/basic/conf.json new file mode 100644 index 0000000000000000000000000000000000000000..e8f3ed98201f61f24887bb24b60a6b047f4e2294 --- /dev/null +++ b/emissary-ml/llm-scripts/fine-tuning/llama3/venv/share/jupyter/nbconvert/templates/basic/conf.json @@ -0,0 +1,6 @@ +{ + "base_template": "classic", + "mimetypes": { + "text/html": true + } +} diff --git a/emissary-ml/llm-scripts/fine-tuning/llama3/venv/share/jupyter/nbconvert/templates/basic/index.html.j2 b/emissary-ml/llm-scripts/fine-tuning/llama3/venv/share/jupyter/nbconvert/templates/basic/index.html.j2 new file mode 100644 index 0000000000000000000000000000000000000000..89d894d2135a578b119c67bf1e60a0d80d82787d --- /dev/null +++ b/emissary-ml/llm-scripts/fine-tuning/llama3/venv/share/jupyter/nbconvert/templates/basic/index.html.j2 @@ -0,0 +1 @@ +{%- extends 'classic/base.html.j2' -%} diff --git a/emissary-ml/llm-scripts/fine-tuning/llama3/venv/share/jupyter/nbconvert/templates/classic/base.html.j2 b/emissary-ml/llm-scripts/fine-tuning/llama3/venv/share/jupyter/nbconvert/templates/classic/base.html.j2 new file mode 100644 index 0000000000000000000000000000000000000000..5b8713ddfab0a7c9815e4827e20818eef62a7761 --- /dev/null +++ b/emissary-ml/llm-scripts/fine-tuning/llama3/venv/share/jupyter/nbconvert/templates/classic/base.html.j2 @@ -0,0 +1,292 @@ +{%- extends 'display_priority.j2' -%} +{% from 'celltags.j2' import celltags %} +{% from 'cell_id_anchor.j2' import cell_id_anchor %} + +{% block codecell %} +
+{{ super() }} +
+{%- endblock codecell %} + +{% block input_group -%} +
+{{ super() }} +
+{% endblock input_group %} + +{% block output_group %} +
+
+{{ super() }} +
+
+{% endblock output_group %} + +{% block in_prompt -%} +
+ {%- if cell.execution_count is defined -%} + In [{{ cell.execution_count|replace(None, " ") }}]: + {%- else -%} + In [ ]: + {%- endif -%} +
+{%- endblock in_prompt %} + +{% block empty_in_prompt -%} +
+
+{%- endblock empty_in_prompt %} + +{# + output_prompt doesn't do anything in HTML, + because there is a prompt div in each output area (see output block) +#} +{% block output_prompt %} +{% endblock output_prompt %} + +{% block input %} +
+
+{{ cell.source | highlight_code(metadata=cell.metadata) | clean_html }} +
+
+{%- endblock input %} + +{% block output_area_prompt %} +{%- if output.output_type == 'execute_result' -%} +
+ {%- if cell.execution_count is defined -%} + Out[{{ cell.execution_count|replace(None, " ") }}]: + {%- else -%} + Out[ ]: + {%- endif -%} +{%- else -%} +
+{%- endif -%} +
+{% endblock output_area_prompt %} + +{% block output %} +
+{% if resources.global_content_filter.include_output_prompt %} + {{ self.output_area_prompt() }} +{% endif %} +{{ super() }} +
+{% endblock output %} + +{% block markdowncell scoped %} +
+{%- if resources.global_content_filter.include_input_prompt-%} + {{ self.empty_in_prompt() }} +{%- endif -%} +
+
+{%- if resources.should_sanitize_html %} +{%- set html_value=cell.source | markdown2html | strip_files_prefix | clean_html -%} +{%- else %} +{%- set html_value=cell.source | markdown2html | strip_files_prefix -%} +{%- endif %} +{{ html_value }} +
+
+
+{%- endblock markdowncell %} + +{% block rawcell scoped %} +{%- if cell.metadata.get('raw_mimetype', '').lower() in resources.get('raw_mimetypes', ['']) -%} +{{ cell.source | clean_html }} +{%- endif -%} +{%- endblock rawcell %} + +{% block unknowncell scoped %} +unknown type {{ cell.type }} +{% endblock unknowncell %} + +{% block execute_result -%} +{%- set extra_class="output_execute_result" -%} +{% block data_priority scoped %} +{{ super() }} +{% endblock data_priority %} +{%- set extra_class="" -%} +{%- endblock execute_result %} + +{% block stream_stdout -%} +
+
+{{- output.text | ansi2html -}}
+
+
+{%- endblock stream_stdout %} + +{% block stream_stderr -%} +
+
+{{- output.text | ansi2html -}}
+
+
+{%- endblock stream_stderr %} + +{% block data_svg scoped -%} +
+{%- if output.svg_filename %} + +{%- else %} + {%- if resources.should_not_encode_svg %} + {{ output.data['image/svg+xml'].encode("utf-8") | clean_html }} + {%- else %} + + {%- endif %} +{%- endif %} +
+{%- endblock data_svg %} + +{% block data_html scoped -%} +
+{%- if resources.should_sanitize_html %} +{%- set html_value=output.data['text/html'] | clean_html -%} +{%- else %} +{%- set html_value=output.data['text/html'] -%} +{%- endif %} +{%- if output.get('metadata', {}).get('text/html', {}).get('isolated') -%} + +{%- else -%} +{{ html_value }} +{%- endif -%} +
+{%- endblock data_html %} + +{% block data_markdown scoped -%} +{%- if resources.should_sanitize_html %} +{%- set html_value=output.data['text/markdown'] | markdown2html | clean_html -%} +{%- else %} +{%- set html_value=output.data['text/markdown'] | markdown2html -%} +{%- endif %} +
+{{ html_value }} +
+{%- endblock data_markdown %} + +{% block data_png scoped %} +
+{%- if 'image/png' in output.metadata.get('filenames', {}) %} + +
+{%- endblock data_png %} + +{% block data_jpg scoped %} +
+{%- if 'image/jpeg' in output.metadata.get('filenames', {}) %} + +
+{%- endblock data_jpg %} + +{% block data_latex scoped %} +
+{{ output.data['text/latex'] | e }} +
+{%- endblock data_latex %} + +{% block error -%} +
+
+{{- super() -}}
+
+
+{%- endblock error %} + +{%- block traceback_line %} +{{ line | ansi2html }} +{%- endblock traceback_line %} + +{%- block data_text scoped %} +
+
+{{- output.data['text/plain'] | ansi2html -}}
+
+
+{%- endblock -%} + +{%- block data_javascript scoped %} +{% set div_id = uuid4() %} +
+{%- if not resources.should_sanitize_html %} + +{%- endif %} +
+{%- endblock -%} + +{%- block data_widget_view scoped %} +{%- if not resources.should_sanitize_html %} +{% set div_id = uuid4() %} +{% set datatype_list = output.data | filter_data_type %} +{% set datatype = datatype_list[0]%} +
+ + +
+{%- endif %} +{%- endblock data_widget_view -%} + +{%- block footer %} +{%- if not resources.should_sanitize_html %} +{% set mimetype = 'application/vnd.jupyter.widget-state+json'%} +{% if mimetype in nb.metadata.get("widgets",{})%} + +{% endif %} +{%- endif %} +{{ super() }} +{%- endblock footer-%} diff --git a/emissary-ml/llm-scripts/fine-tuning/llama3/venv/share/jupyter/nbconvert/templates/classic/conf.json b/emissary-ml/llm-scripts/fine-tuning/llama3/venv/share/jupyter/nbconvert/templates/classic/conf.json new file mode 100644 index 0000000000000000000000000000000000000000..df71075ffca8b499a2b444cbea76454a87d09527 --- /dev/null +++ b/emissary-ml/llm-scripts/fine-tuning/llama3/venv/share/jupyter/nbconvert/templates/classic/conf.json @@ -0,0 +1,13 @@ +{ + "base_template": "base", + "mimetypes": { + "text/html": true + }, + "preprocessors": { + "100-pygments": { + "type": "nbconvert.preprocessors.CSSHTMLHeaderPreprocessor", + "enabled": true, + "style": "default" + } + } +} diff --git a/emissary-ml/llm-scripts/fine-tuning/llama3/venv/share/jupyter/nbconvert/templates/compatibility/full.tpl b/emissary-ml/llm-scripts/fine-tuning/llama3/venv/share/jupyter/nbconvert/templates/compatibility/full.tpl new file mode 100644 index 0000000000000000000000000000000000000000..863c94b168afb6ece344c404731e8ee82a7d4dee --- /dev/null +++ b/emissary-ml/llm-scripts/fine-tuning/llama3/venv/share/jupyter/nbconvert/templates/compatibility/full.tpl @@ -0,0 +1,2 @@ +{{ resources.deprecated("This template is deprecated, please use classic/index.html.j2") }} +{%- extends 'index.html.j2' -%} diff --git a/emissary-ml/llm-scripts/fine-tuning/llama3/venv/share/jupyter/nbconvert/templates/lab/base.html.j2 b/emissary-ml/llm-scripts/fine-tuning/llama3/venv/share/jupyter/nbconvert/templates/lab/base.html.j2 new file mode 100644 index 0000000000000000000000000000000000000000..cebe8410479df22ed800d370e7f3c1c84bba6315 --- /dev/null +++ b/emissary-ml/llm-scripts/fine-tuning/llama3/venv/share/jupyter/nbconvert/templates/lab/base.html.j2 @@ -0,0 +1,331 @@ +{%- extends 'display_priority.j2' -%} +{% from 'celltags.j2' import celltags %} +{% from 'cell_id_anchor.j2' import cell_id_anchor %} + +{% block codecell %} +{%- if not cell.outputs -%} +{%- set no_output_class="jp-mod-noOutputs" -%} +{%- endif -%} +{%- if not resources.global_content_filter.include_input -%} +{%- set no_input_class="jp-mod-noInput" -%} +{%- endif -%} + +{%- endblock codecell %} + +{% block input_group -%} + +{% endblock input_group %} + +{% block input %} + +{%- endblock input %} + +{% block output_group %} + +{% endblock output_group %} + +{% block outputs %} + +{% endblock outputs %} + +{% block in_prompt -%} + +{%- endblock in_prompt %} + +{% block empty_in_prompt -%} + +{%- endblock empty_in_prompt %} + +{# + output_prompt doesn't do anything in HTML, + because there is a prompt div in each output area (see output block) + #} +{% block output_prompt %} +{% endblock output_prompt %} + +{% block output_area_prompt %} + +{% endblock output_area_prompt %} + +{% block output %} +{%- if output.output_type == 'execute_result' -%} +